[Newcompiler] Finding enough bytecodes for closures.

Klaus D. Witzel klaus.witzel at cobss.com
Wed May 2 06:04:59 UTC 2007


On Tue, 01 May 2007 22:54:21 +0200, Bryce wrote:
> Klaus D. Witzel writes:
>  > On Tue, 01 May 2007 21:10:29 +0200, Marcus Denker wrote:
>  > > We never need to push the thisContext at all...
>  >
>  > *except* in ClosureEnvironment>>#return: ...
>
> Good point, but it's hard to avoid paying for a feature when you're
> actually using it. That's probably the one place where normal code
> does need to capture the enclosing method context. I forgot about
> return from method during this discussion.
>
> And we may need a return from method from closure bytecode if we
> want that to be as fast as it's now.

Given the bytecode set you proposed in the other message I'd suggest to  
not be lazy and add a #nonLocalReturnFromClosure bytecode which guarantees  
not to cancel the context-recycling condition (since a single NLR is able  
to cancel the full stack).

After all, Squeak is also fun and an asymmetrical bytecode set looks  
sympathetic to me :)

Moreover, after recompiling the full image with closures, there's then  
only MethodContext around which additionally behaves like a very close  
approximation of flat stack ;-)

Cheers
Klaus

> Bryce




More information about the Newcompiler mailing list