Hi Nicolas,<div><br></div><div> this is fixed in my working image. I'll try and move changes into trunk later this week. There are also some compiler fixes for nilling block-local temps tat need to be included (i.e. in the below delta should have the value nil before the assignment, not the value it had from the previous iteration). But I can't get to it right now.</div>
<div><br></div><div>best</div><div>Eliot<br><br><div class="gmail_quote">On Tue, Mar 2, 2010 at 2:17 PM, Nicolas Cellier <span dir="ltr"><<a href="mailto:nicolas.cellier.aka.nice@gmail.com">nicolas.cellier.aka.nice@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I think I narrowed a bit the offending code:<br>
<br>
eventTickler2<br>
"For debugging Decompiler"<br>
[| delta |<br>
[delta := true] yourself.<br>
delta ] whileTrue.<br>
<br>
(EventSensor>>#eventTickler2) decompile<br>
eventTickler2<br>
[[_r1 := true] yourself.<br>
_r1] whileTrue<br>
<br>
<br>
17 <8A 01> push: (Array new: 1)<br>
19 <68> popIntoTemp: 0<br>
20 <10> pushTemp: 0<br>
21 <8F 10 00 05> closureNumCopied: 1 numArgs: 0 bytes 25 to 29<br>
25 <71> pushConstant: true<br>
26 <8D 00 00> storeIntoTemp: 0 inVectorAt: 0<br>
29 <7D> blockReturn<br>
30 <D0> send: yourself<br>
31 <87> pop<br>
32 <8C 00 00> pushTemp: 0 inVectorAt: 0<br>
35 <99> jumpFalse: 38<br>
36 <A3 EB> jumpTo: 17<br>
38 <78> returnSelf<br>
<br>
<br>
All is well untill Decompiler tries to interpret instruction 35 <99><br>
jumpFalse: 38<br>
We enter Decompiler>>#jump:if:<br>
...snip...<br>
"if jump goes back, then it's a loop"<br>
thenJump < elseStart<br>
ifTrue:<br>
["Must be a while loop...<br>
thenJump will jump to the beginning of the while expr. In the<br>
case of while's<br>
with a block in the condition, the while expr should include more than just<br>
the last expression: find all the statements needed by re-decompiling."<br>
stack := saveStack.<br>
pc := thenJump.<br>
blockBody := self statementsTo: elsePc.<br>
We go back and reinterpret what we already interpreted... But this<br>
time we already get a RemoteTempVectorNode in the tempVars...<br>
And we are gonna create a RemoteTempVectorNode on a<br>
RemoteTempVectorNode next time we interpret the closure byte code 17<br>
<8A 01> push: (Array new: 1)...<br>
So the second pass will decompile _r1 instead of t1...<br>
<br>
I don't feel like correcting the monster Decompiler>>#jump:if:<br>
Maybe I will just set a tweak in RemoteTempVectorNode creation...<br>
<font color="#888888"><br>
Nicolas<br>
<br>
</font></blockquote></div><br></div>