lua-users home
lua-l archive

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

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.