[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: The removal of function environments: An opportunity for optimization?
- From: Mark Hamburg <mark@...>
- Date: Sun, 23 May 2010 12:20:33 -0700
On May 23, 2010, at 11:48 AM, Florian Weimer wrote:
> * Stuart P. Bentley:
>
>> Also, don't all functions still have an _ENV upvalue? (Unless all
>> upvalues can be from higher lexical scopes.)
>
> Yes, but that's not a problem because it is the same for all functions
> in a chunk. You can still move the function to the toplevel, even if
> it references globals.
I hadn't thought about the fact that for functions that do reference _ENV, you can still lift it as high as the definition of _ENV.
Mark