Hi. I have a related question once again with this topic. I've changed Interpreter >> normalSend to something like this:<br><br><br>normalSend<br> "Send a message, starting lookup with the receiver's class."<br>
"Assume: messageSelector and argumentCount have been set, and that <br> the receiver and arguments have been pushed onto the stack,"<br> "Note: This method is inlined into the interpreter dispatch loop."<br>
| rcvr |<br> self inline: true.<br> self sharedCodeNamed: 'normalSend' inCase: 131.<br> rcvr := self internalStackValue: argumentCount.<br> <span style="background-color: rgb(255, 0, 0);"> ((self isIntegerObject: rcvr) not and: [hasToTrace])</span><br style="background-color: rgb(255, 0, 0);">
<span style="background-color: rgb(255, 0, 0);"> ifTrue: [ </span><br style="background-color: rgb(255, 0, 0);"><span style="background-color: rgb(255, 0, 0);"> self internalTurnOnUsedBit: rcvr.</span><br style="background-color: rgb(255, 0, 0);">
<span style="background-color: rgb(255, 0, 0);"> ].</span><br> lkupClass := self fetchClassOf: rcvr.<br> receiverClass := lkupClass.<br> self commonSend.<br><br><br>So...if it is not a SmallInetger and if the flag is on, I turn on a bit. <br>
<br>The question is, if I send a normal message to a normal object. Example:<br><br>| anObject |<br>anObject := MyClass new.<br>anObject foo<br><br>Now...I am sure that "anObject" was marked with the bit. But what about:<br>
a) the compiled method MyClass >> #foo<br>b) MyClass<br><br>should they be marked?<br><br>In other words:<br><br>self deny: (unUsed primitiveGetUsedBit: anObject).<br> self deny: (unUsed primitiveGetUsedBit: anObject class).<br>
self deny: (unUsed primitiveGetUsedBit: (anObject class >> #foo)).<br> <br> anObject foo.<br><br> self assert: (unUsed primitiveGetUsedBit: anObject).<br> self assert: (unUsed primitiveGetUsedBit: anObject class).<br>
self assert: (unUsed primitiveGetUsedBit: (anObject class >> #foo)).<br> <br><br>should all the asserts pass? I ask because I don't know how CompiledMethods are executed (they receive a normalSend like any other object?) nor how class are accessed.<br>
<br>Thanks in advance,<br><br>Mariano<br><br><br><div class="gmail_quote">On Tue, May 11, 2010 at 5:43 PM, Igor Stasenko <span dir="ltr"><<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im"><br>
On 11 May 2010 17:40, Mariano Martinez Peck <<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>> wrote:<br>
><br>
><br>
>> ><br>
>> > Thanks Igor. I could see #class does not the normal way. It was logic as it already has the pointer there ;)<br>
>> ><br>
>> > Now I wonder...to avoid those special cases, do you think it makes sense to intercept in commonSend rather than commonSend ? or it would be the same ?<br>
>> ><br>
>> err... commonSend or commonSend? i think it would be the same :)<br>
>><br>
><br>
> hahahah sorry, I meant commonSend instead of normalSend.<br>
><br>
><br>
>><br>
>> the other point, where you can try intercept a send is cache lookup.<br>
>><br>
><br>
> internalFindNewMethod ?<br>
><br>
<br>
</div>I don't know, maybe :)<br>
<div class="im"><br>
> Thanks<br>
><br>
> Mariano<br>
><br>
><br>
>><br>
>> > Thanks!<br>
>> ><br>
>> > Mariano<br>
>> ><br>
>> ><br>
>> ><br>
>> >><br>
>> >> >><br>
>> >> >> Thank you very much.<br>
>> >> >><br>
>> >> >> Mariano<br>
>> >> ><br>
>> >> > chers<br>
>> >> > Eliot<br>
>> >> ><br>
>> >> ><br>
>> >><br>
>> >><br>
>> >><br>
>> >> --<br>
>> >> Best regards,<br>
>> >> Igor Stasenko AKA sig.<br>
>> ><br>
>> ><br>
>> ><br>
>><br>
>><br>
>><br>
>> --<br>
>> Best regards,<br>
>> Igor Stasenko AKA sig.<br>
><br>
><br>
><br>
<br>
<br>
<br>
</div>--<br>
<div><div></div><div class="h5">Best regards,<br>
Igor Stasenko AKA sig.<br>
</div></div></blockquote></div><br>