<div dir="ltr">Hi Tty,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 4, 2014 at 2:42 PM, gettimothy <span dir="ltr">&lt;<a href="mailto:gettimothy@zoho.com" target="_blank">gettimothy@zoho.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> <br><u></u><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">
See attached screen shot.<br></div></div></blockquote><div><br></div><div>Looking good!</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">Hi All,<br><br>Quick progress report.<br><br>1. I created a mockup of Bert&#39;s SqueakJS. Its stubbed out, but the run and help button work. If anybody can tell me where to pull the current context from the vm sim, I can replace the bottom middle panel with that.<br>
It currently uses: <br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>SimpleHierarchicalListMorph on: [ Array with: (ObjectExplorerWrapper with: (self model vm) name: &#39;root&#39; model: (self model vm) parent: nil) ] where &#39;vm&#39; is the running StackInterpreterSimulator.</div>
</blockquote> <br><br>So something like:<br><blockquote style="border:1px solid rgb(204,204,204);padding:7px;background-color:rgb(245,245,245)"><div>SimpleHierarchicalListMorph on: [ Array with: (ObjectExplorerWrapper  with: (self model vm getTheActiveContext) name: &#39;root&#39; model: (self model vm somethingOrOtherToHangTheActiveContextUnder) parent: nil) ]<br>
</div></blockquote> <br>would be appreciated if its easy.<br></div></div></blockquote><div><br></div><div>There is no active context in the StackInterpreter except at snapshot load or save.  There is an active stack frame almost always, but sometimes it is defined by the localFP,localSP inst vars of StackInterpreter (when executing bytecodes) and sometimes by the framePointer,stackPointer inst vars of InterpreterPrimitives (when executing non-inlined primitives).</div>
<div><br></div><div>In the Cog VM it&#39;s even more complicated.  Sometimes the VM is in the interpreter (frame is localFP,localSP or framePointer,stackPointer as above), sometimes in machine-code, when the current frame is either the machine&#39;s frame pointer,stack pointer pair (e.g. %ebp,%esp) or framePointer,stackPointer (when machine-code calls interpreter primitives).</div>
<div><br></div><div>Knowing which state the VM is in is non-trivial.  So I don&#39;t know what to do here.  In the old sim window you&#39;ll see the context menu has options for printing the stack in each of these states.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">
2. Ah, events, events, events...how do I know thee...let me count the ways.<br><br>Standard Morphic events are created by HandMorph&gt;&gt;processEvents when invoked by  WorldState doOneCycleNowFor:<br><br>HandMorph grabs the raw evtBuf array off the Sensor (exactly as I forwarded in round one of this) and then wraps them to make them handy for Morphic. Unfortunately what is handy for Morphic is not handy for the VM Simulator.<br>
<br>2.a. The obvious solution is to reverse the wrapping. I do not see any existing work that does this, and it looks a bit daunting. My hunch is that I will have to do it. At that point, you can ridicule my lack of low-level bit fiddling experience.<br>
</div></div></blockquote><div><br></div><div>:-)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">2.a.1 Unfortunately, HandMorph&#39;s  addEventListener/sendListenEvent/handleListenEvent event broadcasting  framework sends these wrapped events.<br>
<br>2.b. I modified HandMorph and added a parallel event broadcasting/listener framework with addPrimitiveEventListener/sendListenPrimitiveEvent/handleListenPrimitiveEvent and that works just fine. I am able to subscribe to the primitive events from<br>
my Morph&#39;s model and forward them to the vm simulator--just like with my previous approach with EventSensor.<br><br>2.b.1 I am going to continue with this for a bit, as next up, I think I can improve performance by injecting only those events that fall within the bounds of the ImageMorph that houses the simulated World. I will be on that tomorrow.<br>
<br>2.c. Tim R. requested a means to feed events directly to the simulator. The eventListener framework in HandMorph can be ported to the GUI in 10 minutes, so there is hope there.<br><br>3. After 2.b.1, I am going to see about injecting Morphic Events that only occur on the ImageMorph that houses the simulated World. I started with this approach initially, but chickened out when I saw the wrapping task and went with  the 2 series instead.<br>
<br>I will try to get a clean copy of my code to you all in a couple of  days. I have a lot of missteps in my work due to the various approaches I  am trying, so its a bit messy at the moment.<br></div></div></blockquote>
<div><br></div><div>Take missteps as a sign that you&#39;re effectively exploring the solution space.  Anyway, this is great!  Thanks!</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div><div style="font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif">Anyway, that&#39;s the update.<br><br><br>cordially,<br><br><br>tty<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br></div></div><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>