[Newcompiler] Implementing bytecode for closur

Marcus Denker denker at iam.unibe.ch
Thu Apr 26 20:55:04 UTC 2007


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.

> 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)

	Marcus
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3947 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/newcompiler/attachments/20070426/40c8743b/smime-0001.bin


More information about the Newcompiler mailing list