<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>What exactly are you trying to do?&nbsp;When do you consider an object to be "used"?&nbsp;</div><div><br></div><div><span class="Apple-style-span" style="border-collapse: separate; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; color: rgb(0, 0, 0); font-family: 'Lucida Grande'; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; -webkit-text-decorations-in-effect: none; text-indent: 0px; -webkit-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><span class="Apple-style-span" style="font-family: Helvetica; ">- Bert -</span></div><br class="Apple-interchange-newline"></span></div><div><div>On 03.10.2010, at 12:12, Mariano Martinez Peck wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi. I have a related question once again with this topic. I've changed Interpreter &gt;&gt; normalSend to something like this:<br><br><br>normalSend<br>&nbsp;&nbsp;&nbsp; "Send a message, starting lookup with the receiver's class."<br>
&nbsp;&nbsp;&nbsp; "Assume: messageSelector and argumentCount have been set, and that <br>&nbsp;&nbsp;&nbsp; the receiver and arguments have been pushed onto the stack,"<br>&nbsp;&nbsp;&nbsp; "Note: This method is inlined into the interpreter dispatch loop."<br>
&nbsp;&nbsp;&nbsp; | rcvr |<br>&nbsp;&nbsp;&nbsp; self inline: true.<br>&nbsp;&nbsp;&nbsp; self sharedCodeNamed: 'normalSend' inCase: 131.<br>&nbsp;&nbsp;&nbsp; rcvr := self internalStackValue: argumentCount.<br>&nbsp;<span style="background-color: rgb(255, 0, 0);">&nbsp;&nbsp; ((self isIntegerObject: rcvr) not and: [hasToTrace])</span><br style="background-color: rgb(255, 0, 0);">
<span style="background-color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ifTrue: [ </span><br style="background-color: rgb(255, 0, 0);"><span style="background-color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; self internalTurnOnUsedBit: rcvr.</span><br style="background-color: rgb(255, 0, 0);">
<span style="background-color: rgb(255, 0, 0);">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ].</span><br>&nbsp;&nbsp;&nbsp; lkupClass := self fetchClassOf: rcvr.<br>&nbsp;&nbsp;&nbsp; receiverClass := lkupClass.<br>&nbsp;&nbsp;&nbsp; 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&nbsp; MyClass &gt;&gt; #foo<br>b) MyClass<br><br>should they be marked?<br><br>In other words:<br><br>self deny: (unUsed primitiveGetUsedBit: anObject).<br>&nbsp;&nbsp;&nbsp; self deny: (unUsed primitiveGetUsedBit: anObject class).<br>
&nbsp;&nbsp;&nbsp; self deny: (unUsed primitiveGetUsedBit: (anObject class &gt;&gt; #foo)).<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;anObject foo.<br><br>&nbsp;&nbsp;&nbsp; self assert: (unUsed primitiveGetUsedBit: anObject).<br>&nbsp;&nbsp;&nbsp; self assert: (unUsed primitiveGetUsedBit: anObject class).<br>
&nbsp;&nbsp;&nbsp; self assert: (unUsed primitiveGetUsedBit: (anObject class &gt;&gt; #foo)).<br>&nbsp;&nbsp;&nbsp; <br><br>should all the asserts pass?&nbsp; 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">&lt;<a href="mailto:siguctua@gmail.com">siguctua@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex; position: static; z-index: auto; "><div class="im"><br>
On 11 May 2010 17:40, Mariano Martinez Peck &lt;<a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Thanks Igor. I could see #class does not the normal way. It was logic as it already has the pointer there ;)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Now I wonder...to avoid those special cases, do you think it makes sense to intercept in commonSend rather than commonSend ?&nbsp; or it would be the same ?<br>
&gt;&gt; &gt;<br>
&gt;&gt; err... commonSend or commonSend? i think it would be the same :)<br>
&gt;&gt;<br>
&gt;<br>
&gt; hahahah sorry, I meant commonSend instead of normalSend.<br>
&gt;<br>
&gt;<br>
&gt;&gt;<br>
&gt;&gt; the other point, where you can try intercept a send is cache lookup.<br>
&gt;&gt;<br>
&gt;<br>
&gt; internalFindNewMethod&nbsp; ?<br>
&gt;<br>
<br>
</div>I don't know, maybe :)<br>
<div class="im"><br>
&gt; Thanks<br>
&gt;<br>
&gt; Mariano<br>
&gt;<br></div></blockquote></div></blockquote></div><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="font-family: Helvetica; "><font class="Apple-style-span" face="'Lucida Grande'"><span class="Apple-style-span" style="font-size: medium;"><font class="Apple-style-span" face="Helvetica"><br></font></span></font></div></span></div></body></html>