[Newcompiler] Implementing bytecode for closur

bryce at kampjes.demon.co.uk bryce at kampjes.demon.co.uk
Thu Apr 26 21:25:17 UTC 2007


Marcus Denker writes:
 > 
 > On 26.04.2007, at 21:28, <bryce at kampjes.demon.co.uk> wrote:
 > 
 > > 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.
 > >
 > 
 > as closure activation is just "calling a method", the best would be to
 > speed up all method activation... and get fast closure activation for  
 > free.

Well, Exupery can already double send performance and full dynamic
inlining will be much better than that but that's off topic .

Context recycling has been used by the interpreter for many years. It
definately works. It is worthwhile knowing about when implementing
send like functionality. It does work but it is possible to break
it when adding other "optimisations". 

 > > 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.
 > >
 > 
 > that would be cool if that would work...
 > 
 > > What's the easiest way to get a BlockClosure image to play with?
 > 
 > 
 > http://www.iam.unibe.ch/~scg/Research/NewCompiler/
 > 
 > In the Preferences, you will find "compileNewCompiler" to turn on
 > the new compiler in non-closure mode,  and #compileBlocksAsClosures,
 > which can be turned on in addtion to that and then will make the  
 > newcompiler
 > generate closure code.
 > 
 > To get the complete image be compiled with closures, it needs to be  
 > recompiled, of course.
 > (see eg. class Recompiler)
 
It's recompiling now. I'll try to get some time this weekend to
explore it.

Bryce


More information about the Newcompiler mailing list