[Newcompiler] Implementing bytecode for closur

Stéphane Ducasse stephane.ducasse at univ-savoie.fr
Sat Apr 28 06:23:23 UTC 2007


Hi bryce

are you planning to attend esug?
Because math, marcus and me will be there. Even if this is a bit late.
Where are you living now?
Stef

On 28 avr. 07, at 00:51, <bryce at kampjes.demon.co.uk>  
<bryce at kampjes.demon.co.uk> wrote:

> Mathieu Suen writes:
>> Hi,
>>
>> I have implement a bytecode to push the closure environment.
>> So instead of this peace of bytecode:
>>
>> pushThisContext
>> pushConstant: 5
>> send: privGetInstVar:
>>
>> You get:
>>
>> pushClosureEnvironment
>>
>> I have run benchmark and it result that the system was running 16%
>> faster.
>
> You may want to add a storeClosureEnvironment bytecode too.
>
> That way you can avoid accessing the context by the bytecode which
> reduces context recycling.
>
> With a storeClosureEnvironment methods like:
>
>    ifFalse
> 	1 to 100000 do: [self doSomethingIfFalse: [^ self]].
>
> May become faster than their equivalents in the current system.
>
> A simple bytecode that just implements:
>     pushThisContext:
>     pushConstant: 5
>     send: privStoreIn:instVar:
>
> Would be enough to allow for benchmarking.
>
> The aim is just to remove pushThisContext: which stops context
> recycling. The current system has to use pushThisContext to create
> the BlockContext. So the current system creates a BlockContext and
> stops any existing contexts being recycled. The closure compiler
> would then just create an environment.
>
> Do you have the tools to profile the VM?
>
> If you've got access to Linux (with root access, it may need a kernel
> module compiled) then I could explain how to use oprofile for
> profiling. If not, I can run a few benchmarks here.
>
> Bryce



More information about the Newcompiler mailing list