lua-users home
lua-l archive

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


> (As I imagined) only items with implicit indexes go to the optimized array part of a table (filled with SETLIST). On item read (the RETURN line), if the index happens to be a positive integer, then the array part is first checked by the VM, possibly hiding an overriding item in the regular map part of the table (filled with SETTABLE).

The array part and the hash part are implementation details. A table is
simply a container of pairs (key,value). SETLIST and SETTABLE both create
pairs in a table; SETLIST has implicit integer key and SETTABLE has explicit
arbitrary keys.

> I take the opportunity to ask about the numbers before ';' in the bytecode listing. I guess the first one is the index of a local var (since they are stored in an array). But I have no idea about the other numbers.

See the VM description in http://www.lua.org/source/5.1/lopcodes.h.html
starting at OP_MOVE.