[Vm-dev] FFI callbacks

Bert Freudenberg bert at freudenbergs.de
Mon Nov 24 22:49:26 UTC 2014

How do they actually work? I want to know what information the thunk needs, and what happens when it is activated. I think SqueakJS would benefit from callback support.

I imagine that somehow the VM's state needs to be saved, then the context that defined the block is activated, and then the VM would run the block until it returns (or until the return prim is called?), then the VM's state would need to be restored to what it was, and the result is passed back by the thunk returning.

Am I close? Since the callback can happen at any time, and it could do anything, saving the whole VM state seems daunting.

- Bert -

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4142 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20141124/d44bf6f8/smime.bin

More information about the Vm-dev mailing list