Francis McCabe
Francis McCabe
I think that the crucial point here is that JS code calling into 'suspendable' computations currently uses the async/await pattern. (Ignoring wasm at this point). With that pattern in place,...
JSPI is already reentrant. I agree that that can cause issues for wasm code: it must be structured correctly.
The memory performance question has been addressed in the V8 implementation of JSPI.
V8 does indeed switch to the central stack; furthermore, suspended computations may only contain wasm frames. However, there are other issues. For example, CFI mitigation schemes based on shadow stacks...
+1 to growable stacks. Also, implicit should be some expectation for scale: e.g., how many suspended computations is reasonable to expect in a 'reasonable' resource. For me, any 64bit system...
The idea was always use use the underlying stack resource to store the extra 'stuff'. One consequence of this is that cont.bind would invalidate its continuation argument
cont.bind must invalidate its argument; otherwise you would effectively get multi-shot continuations.
As for implementation cost of cont.bind; a 'natural' strategy would be to use the underlying stack resource. This is similar to how argument spilling for a normal call would work....
I havent completely parsed your register assignments; but, yes, that is what I had in mind. Using the normal function call mechanism for stack switching where at all possible. In...
plain (without jspi) wasm-to-wasm cross module calls are working (we have tests for that case).