How to track message sends in CompiledMethod object?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

How to track message sends in CompiledMethod object?

Mariano Martinez Peck
 
Hi folks. I am using the lsat free bit of the Squeak Object header to do some experiments. What I need to do now is to be able to set such bit for the CompiledMethod objects, when those selectors are sent.

Suppose that from the image side I do "Date today yyyymmdd"  then I want to set that bit in the object header of the CompiledMethod Date>> #today and CompiledMethod Date>> #yyyymmdd

Now....I check in the VM and I am not sure where I should do that. I already have my own primitive so that I can do something like this:

((self isIntegerObject: rcvr) not and: [hasToTrace])
        ifTrue: [
            self internalTurnOnUsedBit: rcvr.
            ].

Now...where I can intercept this in the VM? I found Interpreter >> internalExecuteNewMethod

is it there? should I access to "newMethod" and do something like this:

rcvr := "somehow I access to Interpreter newMethod"
((self isIntegerObject: rcvr) not and: [hasToTrace])
        ifTrue: [
            self internalTurnOnUsedBit: rcvr.
            ].


thanks for any help

mariano
Reply | Threaded
Open this post in threaded view
|

Re: How to track message sends in CompiledMethod object?

Eliot Miranda-2
 
Hi Mariano,

I would put it in addNewMethodToCache.  I wold also consider using the unused header bit in CompiledMethod instead of the unused object header bit (see CompiledMethod>>clearFlag & CompiledMethod>>flag).

On Mon, Aug 23, 2010 at 9:34 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi folks. I am using the lsat free bit of the Squeak Object header to do some experiments. What I need to do now is to be able to set such bit for the CompiledMethod objects, when those selectors are sent.

Suppose that from the image side I do "Date today yyyymmdd"  then I want to set that bit in the object header of the CompiledMethod Date>> #today and CompiledMethod Date>> #yyyymmdd

Now....I check in the VM and I am not sure where I should do that. I already have my own primitive so that I can do something like this:

((self isIntegerObject: rcvr) not and: [hasToTrace])
        ifTrue: [
            self internalTurnOnUsedBit: rcvr.
            ].

Now...where I can intercept this in the VM? I found Interpreter >> internalExecuteNewMethod

is it there? should I access to "newMethod" and do something like this:

rcvr := "somehow I access to Interpreter newMethod"
((self isIntegerObject: rcvr) not and: [hasToTrace])
        ifTrue: [
            self internalTurnOnUsedBit: rcvr.
            ].


thanks for any help

mariano


Reply | Threaded
Open this post in threaded view
|

Re: How to track message sends in CompiledMethod object?

Mariano Martinez Peck
 


On Mon, Aug 23, 2010 at 8:41 PM, Eliot Miranda <[hidden email]> wrote:
 
Hi Mariano,

I would put it in addNewMethodToCache.

Thanks Eliot, puting it here worked perfect :)
 
 I wold also consider using the unused header bit in CompiledMethod instead of the unused object header bit (see CompiledMethod>>clearFlag & CompiledMethod>>flag).


The thing is that I also want to track all objects in addition to CompiledMethod....so..

thanks

Mariano
 
On Mon, Aug 23, 2010 at 9:34 AM, Mariano Martinez Peck <[hidden email]> wrote:
 
Hi folks. I am using the lsat free bit of the Squeak Object header to do some experiments. What I need to do now is to be able to set such bit for the CompiledMethod objects, when those selectors are sent.

Suppose that from the image side I do "Date today yyyymmdd"  then I want to set that bit in the object header of the CompiledMethod Date>> #today and CompiledMethod Date>> #yyyymmdd

Now....I check in the VM and I am not sure where I should do that. I already have my own primitive so that I can do something like this:

((self isIntegerObject: rcvr) not and: [hasToTrace])
        ifTrue: [
            self internalTurnOnUsedBit: rcvr.
            ].

Now...where I can intercept this in the VM? I found Interpreter >> internalExecuteNewMethod

is it there? should I access to "newMethod" and do something like this:

rcvr := "somehow I access to Interpreter newMethod"
((self isIntegerObject: rcvr) not and: [hasToTrace])
        ifTrue: [
            self internalTurnOnUsedBit: rcvr.
            ].


thanks for any help

mariano