[Newcompiler] Implementing bytecode for closur

bryce at kampjes.demon.co.uk bryce at kampjes.demon.co.uk
Sat Apr 28 13:37:17 UTC 2007


Damien Pollet writes:
 > On 27/04/07, bryce at kampjes.demon.co.uk <bryce at kampjes.demon.co.uk> wrote:
 > > With the closure compilers environments, it should be possible to make
 > > all MethodContexts recyclable except for explicit uses of thisContext.
 > 
 > Maybe I missed something... what if we remember thisContext sender in
 > some variable? Then the parent context is not recyclable even if it
 > didn't use thisContext explicitly.

When you access thisContext you stop all existing contexts from being
recycled which will include the sender.

Only contexts created after the thisContext are eligible for
recycling.

Imagine there is a stack of recyclable contexts, you throw away all
contexts on that stack when you access thisContext. That's almost true
except the stack is the current processes stack and there's a counter
that keeps track of how many contexts on that stack may be recyclable.

Bryce


More information about the Newcompiler mailing list