On Fri, May 7, 2010 at 10:04 PM, Eliot Miranda <eliot.miranda@gmail.com> wrote:

On Fri, May 7, 2010 at 2:30 AM, Mariano Martinez Peck <marianopeck@gmail.com> wrote:
Hi folks. I need to intercept ALL message sends. For the moment, I intercepted in Interpreter >> normalSend

But now, I have a question: I know there is that specialObjectArray that contain objects that may be accessed by the VM.

So, the first question is, they are only ACCESSED and to things with pointers or they also send messages to those objects from the VM?

Only accessed. The Interpreter has specialObjectsArray as one of its object references (along with nil, true, false) and indexes it with indices stored in class variables such as SpecialSelectors, CharacterTable, ClassMessage et al.  See implementors and senders of splObj:.

Ok, perfect. Thanks for the hints.


If the VM really send messages to those object, how that is done ?  The code goes also by normalSend ? Or they go from somewhere else that I am not intercepting.

At the bottom the VM has to access objects directly to avoid infinite regress.  So the only sends are in response to send bytecodes, the perform: primitives, and other edge cases (looking up run:with:in: in the invoke-object-as-method prim and looking up a callback entry point in the Alien FFI).

I didn't understand very much this last sentence. I once experimented implementing run:with:in:  and changed that in the MethodDictionary...so I tried to see what you said but I didn't understand. I saw it is index 50 of the array and it is done this:

    SelectorAttemptToAssign := 50.

But I couldn't see anything else.




Thank you very much.