Callbacks, simplified.

Dave Mason dmason at sarg.ryerson.ca
Tue Jun 6 19:59:27 UTC 2006


> An alternative I have pondered was to give interpret() an argument,
> namely a pointer to a variable that external code can set when it's
> time to return. This would solve the problem without doing
> setjmp/longjmp, BUT it would come at the cost of a
> pointer-dereferencing and test at every single bytecode (at the very
> least at each primitiveResponse but there are gotchas with that) and
> would potentially defeat the dispatch optimization in gnuification.

I don't know the vm internals at all, but a standard place to put such
tests in other contexts is on backward-jumps and method-returns (maybe
that's what primitiveResponse is).  The cost of that wouldn't be too
significant.

../Dave



More information about the Vm-dev mailing list