constructor
function · lua · boundary
- Address
0x6fd430· 334 bytes, up to0x6fd57d- Meaning
- Compiles a table constructor and sets the new table's initial array and hash sizes
- Confidence
- verified, proof one
- Finding
- lua/compiler#table-constructors
Finding: Table constructors in lua: the compiler
constructor emits OP_NEWTABLE, then reads fields separated by , or ;: a name followed by
= or a bracketed key is a keyed field, compiled at once into OP_SETTABLE; anything else is a
positional item. Positional items wait in registers and are stored by OP_SETLIST every 32 items,
and the last group by OP_SETLISTO when its last item is a call, which then keeps all its results.
The table's B operand gets the array size through luaO_int2fb and C the log2 of the keyed
count plus 1.
| function | name | decided by |
|---|---|---|
0x6fd430 | constructor | OP_NEWTABLE (0x6fd453), { (0x6fd493), closelistfield (0x6fd4b6), [ and name with = ahead (0x6fd4be..0x6fd4db), } (0x6fd51f), lastlistfield (0x6fd529), luaO_int2fb (0x6fd53c), luaO_log2 (0x6fd563) |
0x6fd590 | recfield | name count limit (0x6fd5bc), checkname (0x6fd5cd) or luaY_index (0x6fd5d7), = (0x6fd5e3), OP_SETTABLE (0x6fd620), free register restored (0x6fd629) |
0x6fd790 | listfield | expr (0x6fd796), limit 0x3ffff (0x6fd7aa), counts (0x6fd7b8, 0x6fd7bb) |
0x6fd6c0 | closelistfield | no item (0x6fd6c3), luaK_exp2nextreg (0x6fd6cb), 32 pending (0x6fd6d0), OP_SETLIST (0x6fd6ef) |
0x6fd710 | lastlistfield | none pending (0x6fd716), call (0x6fd71f), luaK_setcallreturns -1 (0x6fd726), OP_SETLISTO (0x6fd73e), OP_SETLIST (0x6fd770) |
The derivation is in the doc.
Callers 2
Callees 13
- luaO_int2fb lua
- luaO_log2 lua
- testnext lua
- check_match lua
- check lua
- init_exp lua
- lookahead lua
- recfield lua
- closelistfield lua
- lastlistfield lua
- listfield lua
- luaK_exp2nextreg lua
- luaK_codeABC lua
Calls and jumps by a bare address, from tables/calls.tsv.