[Vm-dev] Set and get values from the VM AND the image
Mariano Martinez Peck
marianopeck at gmail.com
Mon May 10 20:10:56 UTC 2010
On Mon, May 10, 2010 at 5:09 PM, Igor Stasenko <siguctua at gmail.com> wrote:
> just add some flag to interpreter state (ivar), like 'enableTrace'
> and a primitive which sets it to true or false.
What an idiot I am...thanks Igor. Sorry for the newbie/stupid questions. I
am still new in this VM world and sometimes I don't know where I am (in OO
or C world) and how to communicate from one to the other one.
That worked perfectly.
> On 10 May 2010 17:33, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
> > Hi folks. I need to intercept all messages. For such purpose, I modified
> Interpreter >> normalSend like this:
> > normalSend
> > "Send a message, starting lookup with the receiver's class."
> > "Assume: messageSelector and argumentCount have been set, and that
> > the receiver and arguments have been pushed onto the stack,"
> > "Note: This method is inlined into the interpreter dispatch loop."
> > | rcvr |
> > self inline: true.
> > self sharedCodeNamed: 'normalSend' inCase: 131.
> > rcvr := self internalStackValue: argumentCount.
> > (self isIntegerObject: rcvr)
> > ifFalse: [
> > self doSomething: rcvr.
> > ].
> > lkupClass := self fetchClassOf: rcvr.
> > receiverClass := lkupClass.
> > self commonSend.
> > But now, from the IMAGE side I would like to enable or disable such
> intercept. It would be great if from the Image side I can set a value to a
> boolean and read such value and ask, from the VM side.
> > Do you know if I can do this? Should I use specialObjectArray ? If
> true, can you give me a hint of how to do it ?
> > Thank you very much.
> > Mariano
> Best regards,
> Igor Stasenko AKA sig.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Vm-dev