<br><br><div class="gmail_quote">On Tue, Nov 16, 2010 at 4:21 PM, Levente Uzonyi <span dir="ltr"><<a href="mailto:leves@elte.hu">leves@elte.hu</a>></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't be used in "atomic" code anymore?<br></blockquote><div><br></div><div>But it couldn't before. You could only use it if the classes and ranges were just right. For example, #= isn't "atomic" for large integers, and the #= primitive will fail for large integers > 64 bits. In assuming #= is "atomic" for SmallInteger x Float you're relying on an optimization in the Interpreter. Look at the Blue book and you won't see this behaviour. Read the ANSI spec and you won't see this behaviour specified. So you're juts getting away with it on one particular implementation. (IMO)</div>
<div><br></div><div>Again IMO, you /can/ assume that SmallInteger>#= and Float>#= won't fail if their argument is of the same class as the receiver, but you can't assume that there won'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>