[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LBCI replacement for LuaJIT 2
- From: Mike Pall <mikelu-1008@...>
- Date: Tue, 31 Aug 2010 20:23:34 +0200
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