<br><br><div class="gmail_quote">On Fri, Sep 25, 2009 at 8:15 AM, Ang Beepeng <span dir="ltr">&lt;<a href="mailto:beepeng86@yahoo.com">beepeng86@yahoo.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I&#39;m running Squeak in debugging mode. I put a breakpoint at &quot;primitiveAdd&quot;. I<br>
open a workspace and type &quot;3+4&quot;, then I print it.<br>
Message &#39;+&#39; should have cause execution of &quot;primitiveAdd&quot;, which lead to<br>
Squeak stops at the breakpoint.<br>
Instead, the result return as 7, as if code execution do not reach<br>
&quot;primitiveAdd&quot; at all.<br>
I try again, typing in &quot;3+4&quot;. This time, I choose to debug &quot;3+4&quot;. I step<br>
into &quot;+4&quot;, the program stops at breakpoint &quot;primitiveAdd&quot;.<br>
Therefore, I&#39;m wondering what are the differences between the two. And why,<br>
breakpoint at primitiveAdd not triggered?<br></blockquote><div><br></div><div>As Bert said, there are special bytecodes for sends of +, -, etc.  See Smalltalk specialSelectors.  Some of these bytecodes have code to perform the operations on typical types (SmallInteger, Float, 32-bit LargePositiveInteger) inlined into the bytecode implementations.  This is a technique known as static receiver type prediction.</div>
<div><br></div><div>You need to put a breakpoint in bytecodePrimAdd</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Thanks.<br>
<br>
Ang Beepeng<br>
<font color="#888888">--<br>
View this message in context: <a href="http://www.nabble.com/breakpoint-at-primitiveAdd-tp25612297p25613917.html" target="_blank">http://www.nabble.com/breakpoint-at-primitiveAdd-tp25612297p25613917.html</a><br>
</font><div><div></div><div class="h5">Sent from the Squeak - Dev mailing list archive at Nabble.com.<br>
<br>
<br>
</div></div></blockquote></div><br>