benilla-re systems structs docs

indexupvalue

function · lua · boundary

Address
0x6fdf80 · 208 bytes, up to 0x6fe04f
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.

functionnamedecided by
0x6fd8e0new_localvar200 local variables (0x6fd903), luaI_registerlocalvar (0x6fd90c), the active index (0x6fd917)
0x6fd930luaI_registerlocalvarluaM_growaux of 12-byte records (0x6fd958), the name (0x6fd969), the count (0x6fd973)
0x6fd8b0new_localvarstrluaS_newlstr (0x6fd8cb), new_localvar (0x6fd8d4)
0x6fd850create_localnew_localvarstr (0x6fd855), tail jmp to adjustlocalvars 1 (0x6fd862)
0x6fd870adjustlocalvarscount raised (0x6fd87b), first instruction stored (0x6fd899)
0x6fcc50removevarscount lowered (0x6fcc66), last instruction stored (0x6fcc76)
0x6fdab0code_paramsadjustlocalvars (0x6fdaba), 100 parameters (0x6fdacb), counts (0x6fdad5, 0x6fdadf), arg (0x6fdaeb), luaK_reserveregs (0x6fdaf5)
0x6fdea0singlevarstr_checkname (0x6fdeaa), singlevaraux (0x6fdebb)
0x6fded0singlevarauxno function: global, register 255 (0x6fdee1), searchvar (0x6fdefb), markupval (0x6fdf1f), the parent (0x6fdf36), luaK_stringK (0x6fdf4b), indexupvalue (0x6fdf5f)
0x6fdf80indexupvaluedescriptor match (0x6fdfb3, 0x6fdfba), 32 upvalues (0x6fdfde), luaM_growaux (0x6fe004), descriptor copy (0x6fe02d)
0x6fe050searchvarinnermost first (0x6fe053), name compare (0x6fe069), -1 (0x6fe076)
0x6fe080markupvalblocks above the level skipped (0x6fe087), flag set (0x6fe093)

The derivation is in the doc.

Callers 1

Callees 2

Calls and jumps by a bare address, from tables/calls.tsv.