@fitzgen (he/him) question before I get much further, there's a comment about wasm code reading the next
field of the activations table
is that still used?
I can't actually find where wasm reads the next
field
this will happen in future PRs, as I implement table.get
and all that. currently it is not yet used by Wasm
hm...
so you'd basically inline the fast path in jit code?
exactly, and only call out to host code when next == end
@fitzgen (he/him) why is the stack map registry stored in the VMContext
?
or rather, do you have a future intention in the jit to read that?
no intentions for the JIT to read the registry -- but it is needed for GC, and that means wasmtime-runtime
needs a way to get it from inside a libcall
, and hanging it off the VMContext
is the easiest way to do that
@Alex Crichton
ah ok
I'm personally less of a fan than others I think about making code future-proof
I would personally just go ahead and drop it from this PR if it's not needed yet, saving it for later when it's needed
I'm always afraid that the actual feature would look different than a pre-implementation b/c requirements change over time or something like that
minor point though
when next == end
, we need to do a libcall to insert the reference into the table, which will basically do:
I'm p sure of the requirement in this case
oh sorry yeah next/end make sense
but the registry for GC far in the future is what I mean
next/end is like "the next PR needs this" which is fine
but afaik we don't even have plans yet for GC in the future
when I say "gc" I mean the wasmtime_runtime::gc
function that is in the PR now
not the wasm GC proposal
oh wait it's actually used?
I think I missed where it was used?
table.get
of a reference type will have a fast path where it can bump into the table if it isn't full, but if next == end
, then the current chunk is full, so it will call out to host code via a libcall, that will do gc(); infallible_insert_into_table()
as described above
this isn't in the current PR, but coming in the next PR
does that make sense?
er sorry I'm not talking about next/end
lemme get a link
in order to do gc(); infallible_insert_into_table()
we need the stack map registry
because the gc
function takes it as a parameter
hence, we hang the stack map registry off the vmctx
aha I see
does that clear it up for you?
yeah thanks
np! thanks for review!
Last updated: Nov 22 2024 at 16:03 UTC