<div dir="ltr"><div dir="ltr"><div dir="ltr"><div class="gmail_default" style="font-size:large">Hi Fabio,<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 14, 2020 at 1:33 PM Fabio Niephaus <<a href="mailto:lists@fniephaus.com">lists@fniephaus.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi all,<br>
<br>
While digging through the implementation of FullBlockClosure with<br>
Hernan, we were wondering about full closures that ignore their<br>
outerContext. We noticed that the following method has two senders:<br>
EncoderForSistaV1>>#genPushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:<br>
<br>
One of them seems to be the only one in use, and it's passing in false<br>
as defaults for both receiverOnstack and ignoreOuterContext. The other<br>
sender (BytecodeEncoder>>#sizePushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:),<br>
in turn, doesn't seem to have any further senders.<br>
<br>
Unless we missed something, it looks like the outerContext will never<br>
be ignored at the moment. Similarly, the receiver is never on the<br>
stack. Is this something only Scorch can do or is this just "not yet<br>
implemented"?<br>
<br>
When can the outerContext be ignored? </blockquote><div><br></div><div class="gmail_default">When the Sista optimizer determines that it isn't needed. i.e. this option is nover used in vanilla code but exists for an optimizing compiler to avoid the overhead in cases where it wants to avoid inlining but knows there is no real suspension point during some evaluation.  Now, whether we'll ever use this facility I can't say, but it was certainly in Clément's mind to do so at some point.</div><div class="gmail_default"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">When does it make sense to pop<span class="gmail_default" style="font-size:large"> </span>the receiver from the stack?</blockquote><div><br></div><div class="gmail_default" style="font-size:large">The point isn't really to pop the receiver from the stack.  The point is to be able to take the closures receiver form the stack rather than it being implicitly the receiver of the current method.  If closure creation gets inlined by the optimizer then there will be potentially a mismatch between the current method's receiver and an inlined closure's receiver, which necessitates having the facility to specify a distinct receiver.</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">And where can we find the latest version<br>
of Scorch. Is it still the one at [1]?<br></blockquote><div><br></div><div><a href="http://smalltalkhub.com/mc/ClementBera/Scorch/main">http://smalltalkhub.com/mc/ClementBera/Scorch/main</a></div><div><br></div><div class="gmail_default">If you're interested in looking at Scorch I'm very interested in collaborating.  And there ius one significant modification to perform first which will make development much easier, and that is to restructure the interface between the optimizer and the image via mirrors, allowing the optimizer to be mated with an image being simulated, rather than having to be a full peer of the image it is optimizing.</div><div class="gmail_default"></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Cheers,<br>
Fabio<br>
<br>
[1] <a href="https://github.com/clementbera/Scorch" rel="noreferrer" target="_blank">https://github.com/clementbera/Scorch</a><br>
</blockquote></div><div><br></div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div></div></div>