<div dir="ltr">So I spent two more hours on this this morning and finally got some good results. <br><br>a) I turned on _immutable_ = True on the Code object. Should have done this before. <br><br>Then I noticed that the trace contained the creation of the argument list, but that that list was never made. The trace was also making a call out to some C function so that it could do the array = [None] * argc. I couldn't get that to go away even with promoting argc. So I changed pop_values to this instead:<br>
<br><div>def pop_values(frame, argc):<br></div><div>    if argc == 0:</div><div>        return Arguments([], argc)</div><div>    elif argc == 1:</div><div>        return Arguments([frame.pop()], argc)</div><div>    elif argc == 2:</div>
<div>        b = frame.pop()</div><div>        a = frame.pop()</div><div>        return Arguments([a, b], argc)</div><div>    assert False<br><br>Since Clojure only supports up to 20 positional arguments, that'll work just fine. Now the last part of my trace consists of this:<br>
<br><div>+266: label(p0, i26, p5, p7, p15, p17, i21, i25, descr=TargetToken(4302275472))</div><div>debug_merge_point(0, 0, 'NO_OP')</div><div>debug_merge_point(0, 0, 'PUSH_LOCAL 0')</div><div>debug_merge_point(0, 0, 'PUSH_LOCAL 2')</div>
<div>debug_merge_point(0, 0, 'EQ')</div><div>+280: i27 = int_eq(i21, i26)</div><div>guard_false(i27, descr=<Guard0x1006f6480>) [p0, p5, p7, p15, p17, i26]</div><div>debug_merge_point(0, 0, 'COND_JMP 26')</div>
<div>debug_merge_point(0, 0, 'PUSH_LOCAL 0')</div><div>debug_merge_point(0, 0, 'PUSH_CONST 1')</div><div>debug_merge_point(0, 0, 'PUSH_CONST 2')</div><div>debug_merge_point(0, 0, 'INVOKE 2')</div>
<div>debug_merge_point(1, 1, 'ADD')</div><div>+289: i28 = int_add(i25, i26)</div><div>debug_merge_point(1, 1, 'RETURN')</div><div>debug_merge_point(0, 0, 'STORE_LOCAL 0')</div><div>debug_merge_point(0, 0, 'JMP 6')</div>
<div>debug_merge_point(0, 0, 'NO_OP')</div><div>+295: jump(p0, i28, p5, p7, p15, p17, i21, i25, descr=TargetToken(4302275472))<br><br>Which is exactly what I was looking for, an add and an eq.<br><br>Thanks for the help everyone!<br>
<br>Timothy</div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 25, 2014 at 2:56 AM, Armin Rigo <span dir="ltr"><<a href="mailto:arigo@tunes.org" target="_blank">arigo@tunes.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Maciej,<br>
<div class=""><br>
On 25 February 2014 09:09, Maciej Fijalkowski <<a href="mailto:fijall@gmail.com">fijall@gmail.com</a>> wrote:<br>
> ugh that looks really odd, why is p67 not removed escapes my attention<br>
<br>
</div>Because we do setarrayitem and getarrayitem on non-constant indexes.<br>
<div class=""><br>
> On Tue, Feb 25, 2014 at 6:36 AM, Timothy Baldridge <<a href="mailto:tbaldridge@gmail.com">tbaldridge@gmail.com</a>> wrote:<br>
</div><div class="">>> I'm attaching a copy of my latest trace. The part I'm not happy with is at<br>
>> the end of the trace:<br>
<br>
</div>We need tricks to avoid allocating the frame when we *leave* the<br>
function.  In PyPy it can only be done if we know for sure that nobody<br>
can potentially grab a reference to the frame for later (e.g. via<br>
exceptions).  I'm unsure to remember the latest version of this logic,<br>
but there were several ones...<br>
<br>
<br>
A bientôt,<br>
<br>
Armin.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>“One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”<br>(Robert Firth) 
</div>