[squeak-dev] FullBlockClosures and ignoreOuterContext?

Eliot Miranda eliot.miranda at gmail.com
Tue Dec 22 08:35:07 UTC 2020


Hi Fabio,

> On Dec 20, 2020, at 1:27 PM, Fabio Niephaus <lists at fniephaus.com> wrote:
> 
> Hi Eliot,
> 
>> On Tue, Dec 15, 2020 at 3:06 AM Eliot Miranda <eliot.miranda at gmail.com> wrote:
>> 
>> Hi Fabio,
>> 
>>> On Mon, Dec 14, 2020 at 1:33 PM Fabio Niephaus <lists at fniephaus.com> wrote:
>>> 
>>> Hi all,
>>> 
>>> While digging through the implementation of FullBlockClosure with
>>> Hernan, we were wondering about full closures that ignore their
>>> outerContext. We noticed that the following method has two senders:
>>> EncoderForSistaV1>>#genPushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:
>>> 
>>> One of them seems to be the only one in use, and it's passing in false
>>> as defaults for both receiverOnstack and ignoreOuterContext. The other
>>> sender (BytecodeEncoder>>#sizePushFullClosure:numCopied:receiverOnStack:ignoreOuterContext:),
>>> in turn, doesn't seem to have any further senders.
>>> 
>>> Unless we missed something, it looks like the outerContext will never
>>> be ignored at the moment. Similarly, the receiver is never on the
>>> stack. Is this something only Scorch can do or is this just "not yet
>>> implemented"?
>>> 
>>> When can the outerContext be ignored?
>> 
>> 
>> 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.
>>> 
> 
> Ok, thanks for the info!
> 
>>> When does it make sense to pop the receiver from the stack?
>> 
>> 
>> 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.
>> 
> 
> Makes sense, thanks!
> 
>> 
>>> 
>>> And where can we find the latest version
>>> of Scorch. Is it still the one at [1]?
>> 
>> 
>> http://smalltalkhub.com/mc/ClementBera/Scorch/main
> 
> Oh, isn't smalltalkhub read-only these days?

If it is then things need to move once time is found to work on the code again.

> 
>> 
>> 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.
> 
> Since we turned on full closures and Sista in Squeak, I could no
> longer use trunk images on top of TruffleSqueak. I finally decided to
> bite the bullet and worked on support for both in the last two weeks.
> It's not that I don't want to collaborate and help evolve Scorch (it's
> a fascinating project!). It's just that I don't have the time to work
> on any significant contributions in that direction. Nonetheless, I'd
> love to see someone working on it again.

Ah ok, makes sense.  Now you’ve implemented the Sista set I’m curious how you evaluate the design.

Eliot
_,,,^..^,,,_ (phone)

> 
> Fabio
> 
>>> 
>>> Cheers,
>>> Fabio
>>> 
>>> [1] https://github.com/clementbera/Scorch
>> 
>> 
>> _,,,^..^,,,_
>> best, Eliot
>> 
> 


More information about the Squeak-dev mailing list