[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LBCI replacement for LuaJIT 2
- From: Mike Pall <mikelu-1011@...>
- Date: Thu, 25 Nov 2010 11:14:34 +0100
Alexander Gladysh wrote:
> Now I need to traverse all nested chunks as well.
>
> Can you please hint me how to do this? I was not able to find a
> solution by looking at LJ2 code...
There's no explicit list of child prototypes, since the VM doesn't
need it. You could traverse the GC constants (negative indexes)
and look for prototype objects. But since you're already scanning
the whole bytecode, look for FNEW, get the constant for RD and run
your code recursively on the prototype object. The bytecode
reflection functions work for both closures and prototypes.
--Mike