<div dir="ltr">Hi Nicolai,<div><br></div><div>    please try and remember to invlude vm-dev when you see a VM issue...<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Aug 10, 2014 at 7:34 AM, Nicolai Hess <span dir="ltr">&lt;<a href="mailto:nicolaihess@web.de" target="_blank">nicolaihess@web.de</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>There is a certain risk, that the mustBeBooleanMagicIn method rewrite can crash the<br>
vm<br></div><a href="https://pharo.fogbugz.com/default.asp?13805" target="_blank">Issue 13805</a></div></div></div></div></blockquote><div><br></div><div>Since you&#39;re using the Opal compiler ca you add the description of the bytecode (aCompiledMethod symbolic) to the issue?  I&#39;ll try and take a look soon but want to be sure I&#39;m debugging the relevant code.</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><div><div>The receiver of the rewritten method is the &quot;nonboolean&quot; value receiving the<br>
</div>
ifTrue:ifFalse: message. But the rewritten method can include <br>instvar accessor and self sends of the original method.<br><br></div>We can include more rewrite rules in mustBeBooleanMagicIn like<br></div>  &quot;rewrite instvar accessing&quot;<br>

<div>    context receiver class instVarNamesAndOffsetsDo: [ :n :o | <br>        RBParseTreeRewriter new <br>        replace: n with: (&#39;ThisContext receiver instVarAt: &#39;, o asString);<br>        executeTree: methodNode.<br>

        ].<br></div><div>&quot;rewrite self sends&quot;<br></div><div>    RBParseTreeRewriter new <br>        replace: &#39;self&#39; with: &#39;ThisContext receiver&#39;;<br>        executeTree: methodNode.<br><br></div>

<div>But I don&#39;t know if this works for all possible situations. Or if there are<br>better ways to do the rewriting.</div></div></blockquote><div><br></div><div>Remember the mirror methods:</div><div>    thisContext object: o instVarAt:</div>
<div>which doesn&#39;t send to o, reaching directly into it.</div><div><br></div><div>But what&#39;s the point of replacing &quot;self&quot; with &quot;thisContext receiver&quot;?  The latter is potentially an extremely slow way of doing the former.  The former won&#39;t create a context object in a method activation that doesn&#39;t need one (doesn&#39;t include a block), whereas the latter always will.  But they will always yield the same result.</div>
</div>-- <br>curious,<div>Eliot</div>
</div></div></div>