Re: Make the VM Lua-version-agnostic and modularize

  • From: "Soni L." <fakedme+lj@xxxxxxxxx>
  • To: luajit@xxxxxxxxxxxxx
  • Date: Thu, 24 Sep 2015 14:30:12 -0300



On 24/09/15 02:26 PM, Peter Cawley wrote:

On Thu, Sep 24, 2015 at 6:10 PM, Vyacheslav Egorov
<dmarc-noreply@xxxxxxxxxxxxx> wrote:
In interpreter for functions that don't redefine _ENV you can just
cache an GCupval object for _ENV upvalue on entry to the function -
removing the indirection.

Though I doubt this is the problem worth thinking much about.
You'd need to keep to extra tracking data to know which upvalue (if
any) was _ENV, and you'd need to be careful about the debug library
(the particularly nasty case is using debug.upvaluejoin to change the
GCupval* which is in the GCfunc, the slightly less nasty case is using
debug.setupvalue to change the TValue within the GCupval).

_ENV is already in.

Other related posts: