<br><br><div class="gmail_quote">On Mon, Nov 22, 2010 at 7:58 PM, David T. Lewis <span dir="ltr">&lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
On Sun, Nov 21, 2010 at 05:06:01PM -0800, Eliot Miranda wrote:<br>
&gt;<br>
&gt; On Sun, Nov 21, 2010 at 3:48 PM, Mariano Martinez Peck &lt;<br>
<div><div></div><div class="h5">&gt; <a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt; &gt;<br>
&gt; &gt; On Sun, Nov 21, 2010 at 8:18 PM, David T. Lewis &lt;<a href="mailto:lewis@mail.msen.com">lewis@mail.msen.com</a>&gt;wrote:<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; On Sat, Nov 20, 2010 at 08:41:44PM +0100, Mariano Martinez Peck wrote:<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; On Sat, Nov 20, 2010 at 7:50 PM, Eliot Miranda &lt;<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a><br>
&gt; &gt;&gt; &gt;wrote:<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt; On Sat, Nov 20, 2010 at 10:28 AM, Mariano Martinez Peck &lt;<br>
&gt; &gt;&gt; &gt; &gt; <a href="mailto:marianopeck@gmail.com">marianopeck@gmail.com</a>&gt; wrote:<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt;&gt; It doesn&#39;t work here. It seems I cannot use SmallInteger like<br>
&gt; &gt;&gt; methods. The<br>
&gt; &gt;&gt; &gt; &gt;&gt; #run:with:in: is never call and the image crashes.<br>
&gt; &gt;&gt; &gt; &gt;&gt;<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt; That&#39;s simply a bug and we should fix it.  What crashes, the<br>
&gt; &gt;&gt; Interpreter,<br>
&gt; &gt;&gt; &gt; &gt; Cog or both?  Prepare a reproducible test case (image, change set etc)<br>
&gt; &gt;&gt; and<br>
&gt; &gt;&gt; &gt; &gt; we can try and fix this.<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; &gt;<br>
&gt; &gt;&gt; &gt; To reproduce just file in the attached cs. Then evaluate the following:<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; TestCase methodDict at: #assert: put: 4.<br>
&gt; &gt;&gt; &gt; TestCase new assert: &#39;zaraza&#39;.<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; If works, you should have a debugger in SmallInteger &gt;&gt; #run:with:in:<br>
&gt; &gt;&gt; &gt; otherwise, a crash.<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; I&#39;ve tested in mac vms like:<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Squeak 4.2.5beta1U<br>
&gt; &gt;&gt; &gt; Squeak 5.8b4<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; and it crash.<br>
&gt; &gt;&gt; &gt; In Squeak 64-32 5.7b1   it just hangs forever (I guess at some point it<br>
&gt; &gt;&gt; will<br>
&gt; &gt;&gt; &gt; crash).<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; And in Cog it works perfect!  The problem is that I am using my own VM<br>
&gt; &gt;&gt; and I<br>
&gt; &gt;&gt; &gt; cannot use COG. So, if Cog has fixed this, I would like to know the<br>
&gt; &gt;&gt; changes<br>
&gt; &gt;&gt; &gt; so that to apply it to my VM.<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt; &gt; Maybe it is already fixed in latest VMMaker, but I couldn&#39;t compile<br>
&gt; &gt;&gt; &gt; it....(other story)<br>
&gt; &gt;&gt; &gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt; It is definitely not fixed in the latest VMMaker (interpreter).<br>
&gt; &gt;&gt;<br>
&gt; &gt;&gt;<br>
&gt; &gt;<br>
&gt; &gt; Thanks Dave. Then I guess it was integrated in Cog by Eliot, or maybe just<br>
&gt; &gt; a side effect in Eliot changes that automagically fixed this?<br>
&gt; &gt;<br>
&gt;<br>
</div></div>&gt; Yes.  When I did run:as:in: support for Cog I fixed this.  I introduced<br>
&gt;<br>
&gt; isOopCompiledMethod: oop<br>
&gt;     &quot;Answer whether the oop is an object of compiled method format&quot;<br>
&gt; &lt;api&gt;<br>
&gt;     ^(self isNonIntegerObject: oop) and: [(self formatOf: oop) &gt;= 12]<br>
&gt;<br>
&gt; and used it in the relevant places.  perhaps you could look at the usage in<br>
&gt; Cog and apply the same to the interpreter?<br>
&gt;<br>
&gt; The existing method is<br>
&gt;<br>
&gt; isCompiledMethod: oop<br>
&gt;     &quot;Answer whether the argument object is of compiled method format&quot;<br>
&gt;     ^(self formatOf: oop) &gt;= 12<br>
&gt;<br>
&gt; and may crash if given a SmallInteger (alas on x86 it won&#39;t always crash :)<br>
&gt; ).<br>
<br>
Thanks Eliot,<br>
<br>
I put the check only into Interpreter&gt;&gt;lookupMethodInDictionary (not because<br>
I wanted to do it differently, but because I&#39;m behind in my email and did not<br>
notice your message until now). This seems sufficient for the moment, and I&#39;ll<br>
make a note to apply your more general fixes in the next update.<br></blockquote><div><br>Yes, because with only that change there are still problems. For example, if you put a SmallInteger as method and then you send #perform:<br>
Example:<br><br>TestCase methodDict at: #assert: put: 5.<br>(TestCase &gt;&gt; #assert:) perform: #literals.<br><br>cheers<br><br>mariano<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<br>
In any case, it was educational figuring it out on my own :)<br>
<br>
Dave<br>
<br>
</blockquote></div><br>