lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Alexander Gladysh wrote:
> I use it to get a list of GET/SETGLOBAL instructions from a given
> function and to get number of upvalues. (Note that in future I'll
> probably want to traverse the list of upvalues and check if they're
> allowed...)
> 
> Is there a way to implement my function (see below) in current LJ2?
> I'll settle for non-stable API.

See: http://lua-users.org/lists/lua-l/2009-11/msg00535.html

The opcodes you're looking for are GGET and GSET. The table
returned by jit.util.funcinfo() has the field "upvalues", which
contains the number of upvalues.

--Mike