On Sat, May 17, 2003 at 01:18:37PM -0700, Avi Bryant wrote:
Yup :). Incidentally, does anyone know of prior art for doing that kind of jumping from VM to meta-interpreter and back, in Smalltalk or other similar (OO, bytecode) systems? There's a company doing exactly that to enable call/cc in Java, and I'm curious if their patent application has any validity.
I did some experiments with smalltalk/x in this direction (playing with implementing an interpreter for Smalltalk in Smalltalk)
If I remember correctly, this worked somewhat like this:
In Smalltalk/X the vm sends "cannotInterpret" to the CompiledMethod if there are no Bytecodes in the compiledMethod. CompiledMethods are real Objects in SmalltalkX, the bytecodes are stored in a ByteArray which is referenced in a instVar of the CompiledMethod.
And so you can simply make a subclass that has an aditional instVar for your new set of bytecodes, "cannotInterpret" then would call the interpreter for these bytecodes...
Marcus