[Vm-dev] callbacks and Cog

Eliot Miranda eliot.miranda at gmail.com
Wed May 6 15:47:19 UTC 2009

Hi All,
    I'm canvassing for some opinions on callback support in Cog.  The
underlying implementation issue is that while a callback is in progress,
(execution has reentered Smalltalk) the generated machine-code zone may be
compacted (because new Smalltalk methods are being compiled)  which will
move the site of the original callout and cause a crash unless something is
done about it.  The "something to do about it" is to have a slightly more
expensive call in the first place such that the return path of the callout
doesn't come back through the machine code following the call but through
some other piece of code that figures out the right thing to do.  So there
is a small but significant penalty for primitive calls in which callbacks
can happen which is more noticeable the quicker the code called is.

I would rather not pay this performance penalty for every external primitive
call and only pay it for FFI calls.  Is this restriction reasonable?  i.e.
is it OK for the VM to refuse to accept callbacks in the context of vanilla
named plugin primitive calls?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/vm-dev/attachments/20090506/db442457/attachment.htm

More information about the Vm-dev mailing list