Hi Yoshiki,<br><br><div class="gmail_quote">On Thu, Apr 12, 2012 at 4:27 PM, Yoshiki Ohshima <span dir="ltr">&lt;<a href="mailto:Yoshiki.Ohshima@acm.org">Yoshiki.Ohshima@acm.org</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
At Thu, 12 Apr 2012 16:08:53 -0700,<br>
<div class="im">Eliot Miranda wrote:<br>
&gt;<br>
&gt; Hi Yoshiki,<br>
&gt;<br>
&gt;     what&#39;s the image you&#39;re using, or at least what is it derived from?  Also, what&#39;s the result of (OMeta2 &gt;&gt; #token) symbolic ?<br>
<br>
</div>The image is one started from &quot;Squeak4.3alpha-11481&quot; and updated by<br>
pressing the &quot;update code from server&quot; button.  The result of<br>
#symbolic is like this:<br>
<br>
37 &lt;71&gt; pushConstant: true<br>
38 &lt;AC 0F&gt; jumpFalse: 55<br>
40 &lt;70&gt; self<br>
41 &lt;21&gt; pushConstant: #anything<br>
42 &lt;E0&gt; send: apply:<br>
43 &lt;68&gt; popIntoTemp: 0<br>
44 &lt;70&gt; self<br>
45 &lt;22&gt; pushConstant: #spaces<br>
46 &lt;E0&gt; send: apply:<br>
47 &lt;87&gt; pop<br>
48 &lt;70&gt; self<br>
49 &lt;24&gt; pushConstant: #seq<br>
50 &lt;10&gt; pushTemp: 0<br>
51 &lt;8A 81&gt; pop 1 into (Array new: 1)<br>
53 &lt;F3&gt; send: apply:withArgs:<br>
54 &lt;90&gt; jumpTo: 56<br>
55 &lt;73&gt; pushConstant: nil<br>
56 &lt;7C&gt; returnTop<br>
<br>
-- Yoshiki<br></blockquote><div><br></div><div>I can&#39;t reproduce this.  When I debug the following doit (which mimics your code) and inspect the context  I get a valid decompilation:</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| t |</div>
<div>       ^ true</div><div>               ifTrue: [t := self apply: #anything.</div><div>                       self apply: #spaces.</div><div>                       self apply: #seq withArgs: {t}]</div><div><br></div><div>
the same code:</div><div><br></div><div>method symbolic</div><div>&#39;37 &lt;71&gt; pushConstant: true</div><div>38 &lt;AC 0F&gt; jumpFalse: 55</div><div>40 &lt;70&gt; self</div><div>41 &lt;21&gt; pushConstant: #anything</div>
<div>42 &lt;E0&gt; send: apply:</div><div>43 &lt;68&gt; popIntoTemp: 0</div><div>44 &lt;70&gt; self</div><div>45 &lt;22&gt; pushConstant: #spaces</div><div>46 &lt;E0&gt; send: apply:</div><div>47 &lt;87&gt; pop</div><div>
48 &lt;70&gt; self</div><div>49 &lt;24&gt; pushConstant: #seq</div><div>50 &lt;10&gt; pushTemp: 0</div><div>51 &lt;8A 81&gt; pop 1 into (Array new: 1)</div><div>53 &lt;F3&gt; send: apply:withArgs:</div><div>54 &lt;90&gt; jumpTo: 56</div>
<div>55 &lt;73&gt; pushConstant: nil</div><div>56 &lt;7C&gt; returnTop</div><div>&#39;</div><div><br></div><div>and decompileWithTemps returns something correct:</div><div><br></div><div>method decompileWithTemps</div><div>
DoIt</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| t |</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>^ true</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>ifTrue: [t := self apply: #anything.</div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>self apply: #spaces.</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>self apply: #seq withArgs: {t}] </div><div><br></div><div>So has OMeta patched some old bug in the decompiler which is now obsoleted by some other fix?</div>
<div><br></div><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>
<br>
&gt;<br>
&gt; On Thu, Apr 12, 2012 at 3:09 PM, Yoshiki Ohshima &lt;<a href="mailto:Yoshiki.Ohshima@acm.org">Yoshiki.Ohshima@acm.org</a>&gt; wrote:<br>
&gt;<br>
&gt;     I noticed that when I debug grammar written in OMeta2/Squeak, there is<br>
&gt;     a problem with some particular methods.  For example, I load<br>
&gt;     OMeta2-preload and -postload, and do:<br>
&gt;<br>
&gt;                   (OMeta2 compiledMethodAt: #token) decompileWithTemps<br>
&gt;<br>
&gt;     I get something like:<br>
&gt;     ------------------------------------<br>
&gt;      token<br>
&gt;            | t |<br>
&gt;            ^ true<br>
&gt;                    ifTrue: [_r1 := self apply: #anything.<br>
&gt;                            self apply: #spaces.<br>
&gt;                            self apply: #seq withArgs: {_r1}]<br>
&gt;     ------------------------------------<br>
&gt;     Debugger uses this to obtain the source code and then it trys to parse<br>
&gt;     it to get the source map. But &quot;_r1&quot; is not a valid variable name so<br>
&gt;     this process fails.<br>
&gt;<br>
&gt;     It appears that the underscore is originated from the method:<br>
&gt;     ------------------------------------<br>
&gt;     codeRemoteTemp: index remoteTemps: tempVector<br>
&gt;<br>
&gt;            ^(RemoteTempVectorNode new<br>
&gt;                    name: &#39;_r&#39;, index printString<br>
&gt;                    index: index<br>
&gt;                    type: LdTempType<br>
&gt;                    scope: 0)<br>
&gt;                            remoteTemps: tempVector;<br>
&gt;                            yourself<br>
&gt;     ------------------------------------<br>
&gt;     But I cannot tell why it is &quot;leaking out&quot; to the final result.  Does<br>
&gt;     anybody know what is going on?<br>
&gt;<br>
&gt;     -- Yoshiki<br>
&gt;<br>
&gt; --<br>
&gt; best,<br>
&gt; Eliot<br>
&gt;<br>
&gt;<br>
</div></div>&gt; [2  &lt;text/plain; us-ascii (7bit)&gt;]<br>
&gt;<br>
<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div><br>