<div dir="ltr"><div>Yay! Tried compiling the method with optimizations turned off (essentially forcing the message send instead of inlining) and it worked fine.<br></div><div><br></div><div>Thanks for the pointers and the quick response, this was really helpful.</div><div><br></div><div>Cheers,</div><div>Nico PM</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Jan 29, 2021 at 10:24 AM Nicolas Cellier via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st">cuis-dev@lists.cuis.st</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">It's a limitation of bytecodes. There are possible workarounds, like splitting the jump in several pieces... Very technical, and will fool the decompiler and the debugger. If closures bytecodes are stored separately then it's also possible to un-optimize the block (do not inline but just use a message send).</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 29 janv. 2021 à 13:33, Nicolás Papagna Maldonado via Cuis-dev <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Aloha folks,<div><br></div><div>I was making some changes to Code Coverage and ran into this compiler error while I was trying to re-compile a method with code coverage tracing added to it.</div><div>In short, Code Coverage wraps each message send in a block and calls a special selector on it that evaluates it and register code coverage information of the wrapped collaborations.</div><div><br></div><div>I've found that for some methods the "genJumpLong: distance index is out of range" and I quite don't understand why.</div><div>In this case "emitCodeForWhile: stack encoder: encoder value: forValue" is called, which in turn calls "emitCodeForJump: dist encoder: encoder", which ends up raising the error a couple stack frames later.</div><div><br></div><div>As far as I understand, it looks like "the body of the while loop was long enough to make the compiler unable to generate the jump". But that's all I got :)</div><div><br></div><div>Do you have any pointers about how to avoid this altogether?</div><div>It's kind of a blocker to me, as there are some methods that cannot be analyzed by Code Coverage right now.</div><div><br></div><div>Thanks in advance!</div><div>Nico PM</div><div><br></div></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" rel="noreferrer" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div>
-- <br>
Cuis-dev mailing list<br>
<a href="mailto:Cuis-dev@lists.cuis.st" target="_blank">Cuis-dev@lists.cuis.st</a><br>
<a href="https://lists.cuis.st/mailman/listinfo/cuis-dev" rel="noreferrer" target="_blank">https://lists.cuis.st/mailman/listinfo/cuis-dev</a><br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><br>Nicolás Papagna</div>