<br><br><div class="gmail_quote">On Fri, Dec 3, 2010 at 11:12 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: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div></div><div class="h5"><br>
On Fri, 3 Dec 2010, stephane ducasse wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<br>
On Dec 3, 2010, at 7:02 PM, Andreas Raab wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

maybe supporting SmallInteger as methods was not a good idea :(<br>
</blockquote>
<br>
FWIW, Objects as methods weren&#39;t intended for SmallInts; they were intended for stuff like method wrappers. Using SmallIntegers for methods is a hack and I&#39;m not surprised it doesn&#39;t work.<br>
</blockquote>
<br>
Me too. They were worked well for normal objects. This is good and valuable hook.<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
But it is easy to fix - just wrap your ints into something else and you&#39;re good to go.<br>
</blockquote>
<br>
It does not work in mariano special need because the idea was to push as far as possible the idea that we do not have to allocate any new objects and avoid any proxy memory allocation cost. So clearly this is may be a too hackish hack. Else a plain simple (but allocating memory proxy works well but we wanted to know what is the lowest boundary).<br>

</blockquote>
<br></div></div>
I have a working package that can swap out CompiledMethods and replace them with SmallIntegers in the MethodDictionaries. When the method is about to be used by the system, the CompiledMethod is automatically swapped back. It uses the existing ObjectsAsMethods implementation, so I say that SmallIntegers can be used like any other object in this regard.</blockquote>
<div><br>Thanks Levente. I did more or less the same. In addition, I did some modifications to the VM to mark objects usage, in order to be able to automatically swap out &quot;unused objects&quot;. <br>All these changes, I did it in normal SqueakVM, and this is why I am using such VM. I was just checking Cog and seems it supports much more these problems.<br>
For example, what I said in the first mail of this thread: when Interpreter does the #markAndTraceInterpreterOops:    and tries to do  self markAndTrace: newMethod.<br> <br>That, in SqueakVM crash (as explained in my first email). However, in Cog, it does:<br>
<br><br>| header lastFieldOffset action |<br><span style="background-color: rgb(255, 255, 102);">    self assert: (self addressCouldBeObjWhileForwarding: oop).</span><br>    header := self longAt: oop.<br><br><br>notice that assert.  So...I guess Cog is more prepare to supports non-objects for methods.<br>
<br>Eliot, can you confirm that?<br><br>I couldn&#39;t even compile Cog but now JB gave me some hints....so maybe I will try to give it a shoot and see what happens. <br><br><br>Thanks Levente.<br><br>Mariano<br><br></div>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"> I didn&#39;t test it with SqueakVM, but it definitely works with CogVM.<br>
<br>
<br>
Levente<br>
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Cheers,<br>
 - Andreas<br>
</blockquote>
<br>
<br>
</blockquote>
</blockquote></div><br>