indexupvalue
function · lua · boundary
- Address
0x6fdf80· 208 bytes, up to0x6fe04f- Meaning
- Returns a function's upvalue index for a variable, adding it under the limit of 32
- Confidence
- verified, proof one
- Finding
- lua/compiler#local-variables-and-upvalues
Finding: Local variables and upvalues in lua: the compiler
A local is declared by new_localvar, which records it in the prototype through
luaI_registerlocalvar, and enters scope through adjustlocalvars, which stores its first
instruction; removevars stores its last. A name resolves through singlevaraux: an active local
of the current function first, else the enclosing functions' locals and upvalues, which become an
upvalue here, else a global named by a string constant. markupval flags the block of a local that
an inner function captures, so that the block closes it.
| function | name | decided by |
|---|---|---|
0x6fd8e0 | new_localvar | 200 local variables (0x6fd903), luaI_registerlocalvar (0x6fd90c), the active index (0x6fd917) |
0x6fd930 | luaI_registerlocalvar | luaM_growaux of 12-byte records (0x6fd958), the name (0x6fd969), the count (0x6fd973) |
0x6fd8b0 | new_localvarstr | luaS_newlstr (0x6fd8cb), new_localvar (0x6fd8d4) |
0x6fd850 | create_local | new_localvarstr (0x6fd855), tail jmp to adjustlocalvars 1 (0x6fd862) |
0x6fd870 | adjustlocalvars | count raised (0x6fd87b), first instruction stored (0x6fd899) |
0x6fcc50 | removevars | count lowered (0x6fcc66), last instruction stored (0x6fcc76) |
0x6fdab0 | code_params | adjustlocalvars (0x6fdaba), 100 parameters (0x6fdacb), counts (0x6fdad5, 0x6fdadf), arg (0x6fdaeb), luaK_reserveregs (0x6fdaf5) |
0x6fdea0 | singlevar | str_checkname (0x6fdeaa), singlevaraux (0x6fdebb) |
0x6fded0 | singlevaraux | no function: global, register 255 (0x6fdee1), searchvar (0x6fdefb), markupval (0x6fdf1f), the parent (0x6fdf36), luaK_stringK (0x6fdf4b), indexupvalue (0x6fdf5f) |
0x6fdf80 | indexupvalue | descriptor match (0x6fdfb3, 0x6fdfba), 32 upvalues (0x6fdfde), luaM_growaux (0x6fe004), descriptor copy (0x6fe02d) |
0x6fe050 | searchvar | innermost first (0x6fe053), name compare (0x6fe069), -1 (0x6fe076) |
0x6fe080 | markupval | blocks above the level skipped (0x6fe087), flag set (0x6fe093) |
The derivation is in the doc.
Callers 1
- singlevaraux lua
Callees 2
- luaM_growaux lua
- luaX_checklimit lua
Calls and jumps by a bare address, from tables/calls.tsv.