<br><br><div class="gmail_quote">On Sun, Sep 26, 2010 at 1:15 PM, stephane ducasse <span dir="ltr">&lt;<a href="mailto:stephane.ducasse@gmail.com">stephane.ducasse@gmail.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>
should I conclude that before your change even the default old vm would crash when we put a SmallInteger in a methodDict?<br></blockquote><div><br></div><div>Yes.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Because if I would have know I would not ask my question. I thought it was for something else you had in mind.<br>
<br>
Stef<br>
<div><div></div><div class="h5"><br>
&gt;<br>
&gt; Eliot<br>
&gt;<br>
&gt; I wanted to understand what: &#39;  Have various places check for isOopCOmpiledMethod:<br>
&gt; rather than isCompiledMethod: to allow SmallIntegers to be used as methods.&#39;<br>
&gt; means<br>
&gt;        in which circumstances do we want to have smalltalkIntegers used as methods?<br>
&gt;        when we put an object instead of a compiled method and that by accident this is an integer?<br>
&gt;<br>
&gt; Looking at the code for the standard Interpreter, if anyone tried<br>
&gt;<br>
&gt;     self class addSelector: #foo withMethod: 0.<br>
&gt;     self foo.<br>
&gt;<br>
&gt; then the VM would crash trying to determine if 0 was a compiled method because the VM uses isCompiledMethod: and isCompiledMethod: does not (and should not, because it is used elsewhere) guard against a tagged object.  isOopCompiledMethod: does guard against a tagged object:<br>

&gt;<br>
&gt; isOopCompiledMethod: oop<br>
&gt;     ^(self isNonIntegerObject: oop) and: [self isCompiledMethod: oop]<br>
&gt;<br>
&gt; isCompiledMethod: obj<br>
&gt;     ^(self formatOf: obj) &gt;= 12<br>
&gt;<br>
&gt; So in practice it&#39;s not an issue; presumably no-one is using SmallIntegers as methods (&quot;Doctor it hurts when I...&quot;).  But if the VM provides a facility it is nice for it to provide that facility robustly (if there is no significant impact on performance).<br>

&gt;<br>
&gt;<br>
<br>
</div></div></blockquote></div><br>