[Newcompiler] Implementing bytecode for closur

bryce at kampjes.demon.co.uk bryce at kampjes.demon.co.uk
Thu Apr 26 19:28:24 UTC 2007


Marcus Denker writes:
 > We can easily cut that down to one by making the #value on block a  
 > primitive. Then block activiation would be as fast
 > as calling a method.
 > 
 > In Squeak right now, it is faster, as there is a scheme to be able to  
 > execute block-contexts which do not require a full activation.

If you implement a BlockClosure>>value: primitive then have a look
at Context recycling. It's an optimisation that is very worthwhile.
I think it produces about a 10 times speed increase in sends, I've
broken it a few times inside Exupery.

All it does is keep old contexts in a list then recycles
them. Contexts are only recycled if they're in new space and not used
by anything else. The implementation is fairly simple.

What's the easiest way to get a BlockClosure image to play with?

Bryce


More information about the Newcompiler mailing list