Hi All,<br><br><div class="gmail_quote">On Wed, Jul 7, 2010 at 3:11 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
On Wed, Jul 07, 2010 at 11:22:33PM +0200, Levente Uzonyi wrote:<br>
&gt;<br>
&gt; I was wondering about how this will be done. Will it be done? If so, is<br>
&gt; there a plan for it? I saw that Eliot added Juan&#39;s BitBlt fixes to Cog,<br>
&gt; but that&#39;s only one of the many enhancements of the SqueakVM &quot;branch&quot;.<br>
<br>
</div></div>That&#39;s a very good question, thanks for opening the discussion.<br>
<br>
Personally, I do not have a good sense of how this should be handled.<br>
I expect that we will want to keep the traditional SqueakVM alive<br>
and healthy for at least a few years into the future, but I do not<br>
know if it is better to merge it with the StackVM, or just let it<br>
be separatedly maintained for some period of time.<br>
<br>
Does anyone have some perspective or recommendations on how this<br>
might best be handled?<br></blockquote><div><br></div><div>One issue is whether to have three VMs or two.  Notionally the StackInterpreter could replace the base interpreter because it is portable C with no JIT component.  However its event handling model requires at least a periodic timer and preferrably a separate heartbeat thread.  If we can assume all platforms will provide at least an interval timer (e.g. equivalent to unix&#39;s setitimer) then I see no need for Interpreter.</div>
<div><br></div><div>Another issue is that the current class hierarchy is poor; it couples the execution engine to the object representation, making it very difficult to change the object representation.  I have already changed this in Teleplace and some time we&#39;ll release this (again forgive me for not being able to give dates or firm commitments but you can be pretty confident it&#39;ll happen).  The new class structure looks like the following where S stands for Separate, as in separate from ObjectMemory.</div>
<div><br></div><div>    ObjectMemory</div><div>        NewObjectMemory             - performance improvements and support for non-GC allocations for stack-to-context mapping</div><div>            NewCoObjectMemoryS   - extensions for the JIT (method header can point to JIT method.  JIT needs a store check)</div>
<div><br></div><div>    StackInterpreterS                       - accesses a NewObjectMemory through an objectMemory inst var</div><div>        StackInterpreterSPrimitives    - primitives grouped for clarity</div><div>            CoInterpreterS                   - modifies StackInterpreter to mate with the JIT (two frame formats, etc, etc, etc)</div>
<div>                CoInterpreterSPrimitives - overridden primitives grouped for clarity</div><div>                    CoInterpreterMTS       - a subclass that implements a multi-threaded VM analogous to Python&#39;s Global Interpreter Lock</div>
<div>                                                       but far more efficient</div><div><br></div><div>Right now our threaded VM is working with a hack to stop objects moving while a threaded call is in progress.  First tenure any young arguments via a tenuring incremental GC, then lock out full GCs until the call is complete.  So old objects won&#39;t move whole calls are in progress which won&#39;t work as soon as one always has a threaded call in progress.  Further, the current object representation is over-complex and slow and doesn&#39;t exploit 64-bits as well as it might.  So I&#39;m starting work on a better object representation and a pinning garbage collector where specific objects (including arguments to threaded calls) can be kept stationary.</div>
<div><br></div><div><br></div><div><br></div><div>So I would like to see the following:</div><div><br></div><div>1. the Interpreter be allowed to die and the StackInterpreter take its place.</div><div><br></div><div>2. some time soon the current class structure be discarded in favour of the above or something like it (for example having Primitives at the top is probably a better structure; there are space and complexity advantages to creating a minimal CoInterpreter that doesn&#39;t have localIP localSP or localFP or the at cache, and so it could inherit from a root Primitives class and avoid StackInterpreter baggage necessary to make a fast interpreter but irrelevant to a JIT).</div>
<div><br></div><div>3. efforts in the dialects at creating a small base image and loadable packages so that when a faster object representation is available we can more easily convert the core image to the new object representation and build up the full image.</div>
<div><br></div><div>4. a 64-bit image format developed from the new object representation with immediate double support that will obsolete the existing 64-bit image by virtue of having much better performance (especially for Float).</div>
<div><br></div><div><br></div><div>Point 1 needs careful discussion.  I note that John McIntosh has started porting the StackInterpreter to iPhone which is a necessary first step in seeing whether the StackInterpreter is a suitable replacement for Interpreter.</div>
<div><br></div><div><br></div><div>There are a couple of minor things that need to get done soon.  One is to support objects-as-methods in the Cog JIT.  Another is to support JIT-ing long-running interpreted methods by checking backward branches.  Any brave soul who wants to learn Cog could have a go at these.</div>
<div><br></div><div><br></div><div>cheers,</div><div>Eliot</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<br>
Dave<br>
<br>
</blockquote></div><br>