Callbacks with Jitter Interpreter
Alejandro F. Reimondo
alereimondo at sugarweb.com
Wed Feb 4 17:20:50 UTC 1998
When implementing callbacks for Squeak in the "normal" Interpreter. I've implemented the callback processing loop as:
!ExternalInterface methodsFor: 'callBacks' !
interpretCallBack
" Private - Interpret bytecodes while processing callback."
self inline: false.
waitingCallBack _ true.
interpreterProxy internalizeIPandSP.
[waitingCallBack] whileTrue: [
interpreterProxy interpretNextByteCode.
].
interpreterProxy externalizeIPandSP.
waitingCallBack _ true.! !
And as an Interpreter instance method:
!Interpreter methodsFor: 'external calls' !
interpretNextByteCode
"Advance the receiver and interpret the next byteCode."
currentBytecode _ self fetchByte.
self dispatchOn: currentBytecode in: BytecodeTable.!
now I want to port callbacks to the new Jitter Interpreter, but I don't know what to do to fetch a bytecode and dispatch it.
I have tried with:
!DynamicInterpreter methodsFor: 'external calls'!
interpretNextByteCode
"Advance the receiver and interpret the next byteCode."
currentBytecode _ opcodeIndex.
self dispatchOn: currentBytecode in: OpcodeTable.!
But it doesn't works.
What must I do to run the DynamicInterpreter loop until some condition?
(Remember that I am in a callback, similar to be inside a primitive)
Thanks,
Ale.
More information about the Squeak-dev
mailing list
|