<br><br><div class="gmail_quote">On Fri, Sep 25, 2009 at 8:15 AM, Ang Beepeng <span dir="ltr"><<a href="mailto:beepeng86@yahoo.com">beepeng86@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
I'm running Squeak in debugging mode. I put a breakpoint at "primitiveAdd". I<br>
open a workspace and type "3+4", then I print it.<br>
Message '+' should have cause execution of "primitiveAdd", which lead to<br>
Squeak stops at the breakpoint.<br>
Instead, the result return as 7, as if code execution do not reach<br>
"primitiveAdd" at all.<br>
I try again, typing in "3+4". This time, I choose to debug "3+4". I step<br>
into "+4", the program stops at breakpoint "primitiveAdd".<br>
Therefore, I'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>