<br><br><div class="gmail_quote">On Tue, Nov 16, 2010 at 4:21 PM, Levente Uzonyi <span dir="ltr">&lt;<a href="mailto:leves@elte.hu">leves@elte.hu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, 16 Nov 2010, Eliot Miranda wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Um, on Cog it sends a message if the method containing the #= has been<br>
jitted.  But the issue is /not/ whether there is a send or not.  The issue<br>
</blockquote>
<br></div>
Does it mean, that #= can&#39;t be used in &quot;atomic&quot; code anymore?<br></blockquote><div><br></div><div>But it couldn&#39;t before.  You could only use it if the classes and ranges were just right.  For example, #= isn&#39;t &quot;atomic&quot; for large integers, and the #= primitive will fail for large integers &gt; 64 bits.  In assuming #= is &quot;atomic&quot; for SmallInteger x Float you&#39;re relying on an optimization in the Interpreter.  Look at the Blue book and you won&#39;t see this behaviour.  Read the ANSI spec and you won&#39;t see this behaviour specified.  So you&#39;re juts getting away with it on one particular implementation.  (IMO)</div>
<div><br></div><div>Again IMO, you /can/ assume that SmallInteger&gt;#= and Float&gt;#= won&#39;t fail if their argument is of the same class as the receiver, but you can&#39;t assume that there won&#39;t be a send.</div>
<div><br></div><div><br></div><div>best</div><div>Eliot</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
<br>
Levente<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
is what the behaviour of the primitive code is.  In the interpreter #= will<br>
short-circuit (avoid the send) if both the receiver and the argument are<br>
either a SmallInteger or a Float.  In the JIT the primitive will not fail if<br>
the receiver and argument are both SmallIntegers or Floats or if the<br>
receiver is a Float and the argument is an Integer, but will fail if the<br>
receiver is a SmallInteger and the argument is a Float.<br>
<br>
</blockquote>
<br></div>
snip<br>
<br>
</blockquote></div><br>