<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"><<a href="mailto:nicolaihess@web.de" target="_blank">nicolaihess@web.de</a>></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're using the Opal compiler ca you add the description of the bytecode (aCompiledMethod symbolic) to the issue? I'll try and take a look soon but want to be sure I'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 "nonboolean" 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> "rewrite instvar accessing"<br>
<div> context receiver class instVarNamesAndOffsetsDo: [ :n :o | <br> RBParseTreeRewriter new <br> replace: n with: ('ThisContext receiver instVarAt: ', o asString);<br> executeTree: methodNode.<br>
].<br></div><div>"rewrite self sends"<br></div><div> RBParseTreeRewriter new <br> replace: 'self' with: 'ThisContext receiver';<br> executeTree: methodNode.<br><br></div>
<div>But I don'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't send to o, reaching directly into it.</div><div><br></div><div>But what's the point of replacing "self" with "thisContext receiver"? The latter is potentially an extremely slow way of doing the former. The former won't create a context object in a method activation that doesn't need one (doesn'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>