[Newcompiler] Adding the create closure environment bytecode

Klaus D. Witzel klaus.witzel at cobss.com
Sun Aug 19 09:18:10 UTC 2007


On Sun, 19 Aug 2007 02:45:08 +0200, Math wrote:
> Hi,
>
> This last week I spend my time to implement the create closure  
> environment bytecode.
> This bytecode replace the creation and registration of the closure  
> environment:
>
> push: ClosureEnvironment
> push: 1
> send: #new:
>
> by a single bytecode.
>
> I have spend  a lote of time trying to fix a bug when the VM do a gc.  
> Finally I found out that was because the frame size of the method change  
> with my bytecode(i.e I don't use the stack to create the colsure). Then  
> the size of the method context is not correct. So instead of fixing the  
> frame size I have fixed the bytecode which it not the best optimization

I do not understand this (bug v.s. frame size v.s. not the best  
optimization v.s. you don't use the stack). Could you post the fileOut of  
your implementation of the bytecode.

Cheers
Klaus

> I have made a little benchmark to see the performance:
>
> a := 0.
> #(1 2 3 4 5 6 7 8 9 10)  do: [:each | a := each + a]] bench.
>
> Without the bytecode (with closure)
> '207 655.4689062188 per second.'.
> '207 615.876824635 per second.'.
> '206 797.6404719056 per second.'.
>
> With the bytecode
> '225 009.398120376 per second.'.
> '224 685.4629074185 per second.'.
> '225 539.6920615877 per second.'
>
> So with the bytecode we are about 8% faster
>
> 	Mth
>
>
>




More information about the Newcompiler mailing list