<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 3, 2014 at 1:11 PM, Colin Putney <span dir="ltr">&lt;<a href="mailto:colin@wiresong.com" target="_blank">colin@wiresong.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> <br><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Nov 3, 2014 at 11:34 AM, Eliot Miranda <span dir="ltr">&lt;<a href="mailto:eliot.miranda@gmail.com" target="_blank">eliot.miranda@gmail.com</a>&gt;</span> wrote:<br><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If the bytecode is one that takes an integer on top of stack, and an Array literal containing bytecode pcs, falling through on out of range, then nothing other than the index need be pushed on top of stack.  That would be my preference.</div></div></div></div></blockquote><div><br></div><div>I think Levante&#39;s suggestion for jumpToTop was just to take the pc from the top of the stack, with no indirection through an Array literal. Then jumping to a pc in an array would be </div><div><br></div><div>- push the array</div><div>- push the index of the pc you want</div><div>- send #at:</div><div>- jumpToTop </div></div></div></div></blockquote><div><br></div><div>Right, and that doesn&#39;t play well with the JIT because conversion would be required and that&#39;s slow.  If one goes with teh explicit jump table in an Array literal</div><div>a) compilation is likely easier because one doesn&#39;t have to know the pc when generating the switch code</div><div>b) it plays well with teh JIT since the jit can convert the bytecode pcs to machine code pcs at compile-time, not run-time.</div><div><br></div><div>In any case one can play the stack top game as an experiment using thisContext pc:, no need for a bytecode.  But the bytecode should use the literal approach for the reasons stated.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>-Colin</div></div></div></div>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">best,<div>Eliot</div></div>
</div></div>