lua-users home
lua-l archive

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


On Thu, Nov 25, 2010 at 13:14, Mike Pall <mikelu-1011@mike.de> wrote:
> 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.

Ok, thanks, I'll try it and report back the results.

Alexander.