[Vm-dev] How to access Interpreter code from plugin?

Igor Stasenko siguctua at gmail.com
Wed Oct 13 20:33:27 UTC 2010


On 13 October 2010 19:52, Mariano Martinez Peck <marianopeck at gmail.com> wrote:
>
>
>
> On Wed, Oct 13, 2010 at 6:31 PM, Igor Stasenko <siguctua at gmail.com> wrote:
>>
>> Hi, Mariano.
>>
>> I don't understand, why you need to dive into specific primitive(s),
>> while you can simply place a hook before entering any primitive
>
> is there a way to do this in a genera way or I need to do it manually for each primitive?
>
>
>>
>> and
>> mark all objects, which passed as parameters
>> (receiver & args) as 'used', and then call primitive function?
>>
>
> The problem is that not all of them are "used" in all primitives. Just as an example, #bytecodeNew:
>
> bytecodePrimNew
>
>     messageSelector := self specialSelector: 28.
>     argumentCount := 0.
>     self normalSend.
>
> I don't want to trace the receiver there, but it is really not used there. I will trace it in #normalSend.
> Or sometimes a primitive fails because one of the arguments is more than 32bits or because it is not smallInteger or whatever...I don't want to mark them as used just for being a parameter. I want to mark them when they are really used by the VM.
>
> I want to avoid as much as overhead as possible.
>
> Right now I put the tracing in #normalSend, but then I modifed some bytecodes like those for #class or #== since they were not going throught normal send.
>

I don't know, what you put into 'userful' or 'used' objects.
At any moment of time, if you stop VM and look at current context, all
objects which directly reachable from it is 'userful'.
In this way, you can mark everything it meets during interpreting as
'used', and then simply do GC,
so, any 'used' objects which will become garbage will be of no
interest to you as well.

> Thanks
>
> Mariano
>
>



-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Vm-dev mailing list