benilla-re systems structs docs

luaK_patchlistaux

function · lua · boundary

Address
0x700890 · 112 bytes, up to 0x7008ff
Meaning
Points the jumps of a list at targets chosen by each test's sense, setting test registers
Confidence
verified, proof one
Finding
lua/codegen#jump-lists

Finding: Jump lists in lua: the code generator

A jump list is chained through the jumps' own offsets, -1 ending it. luaK_jump emits OP_JMP carrying the jumps pending to here; luaK_concat appends a list; luaK_patchtohere adds a list to the pending jumps, which the next instruction resolves. luaK_patchlistaux points each jump at a target: a jump under a value test (OP_TEST) goes to the true or false target by the test's C and gets that target's register, any other to the default target. need_value answers whether a list holds a jump that is no value test of the given sense.

functionnamedecided by
0x700810luaK_jumppending jumps taken (0x700818, 0x700827), OP_JMP with sBx -1 (0x70082e), luaK_concat (0x70083c)
0x701320luaK_condjumpluaK_codeABC (0x701334), luaK_jump (0x70133b)
0x700900luaK_fixjumpoffset dest - (pc + 1) (0x70090c), above 0x1ffff control structure too long (0x70091a..0x700929), store (0x700943)
0x700850luaK_getlabellast jump target set to the pc (0x700853)
0x700950luaK_getjumpsBx (0x700958..0x700960), -1 ends (0x700965), pc + 1 + offset (0x70096d)
0x700980getjumpcontrolpc at least 1 (0x700980), test bit of the previous opcode's mode (0x700997, 0x7009a0)
0x700e30need_valuegetjumpcontrol (0x700e46), not OP_TEST or C not the sense gives 1 (0x700e52..0x700e61), luaK_getjump (0x700e67)
0x7009b0patchtestregregister 255 takes B (0x7009b0..0x7009bd), A set (0x7009c5..0x7009d1)
0x700890luaK_patchlistauxret 0x14 (0x7008fd), OP_TEST (0x7008bd), C (0x7008c8), true pair (0x7008cf, 0x7008d7), false pair (0x7008dd, 0x7008e5), luaK_fixjump (0x7008ed)
0x700860luaK_patchlisttarget at the pc gives luaK_patchtohere (0x700866, 0x70086b), else one target three times (0x700874..0x700881)
0x7009e0luaK_patchtohereluaK_getlabel (0x7009e0), luaK_concat into the pending jumps (0x7009e6, 0x7009e9)
0x7009f0luaK_concatempty second list (0x7009f7), empty first takes it (0x700a02, 0x700a09), walk to the end (0x700a14..0x700a2e), luaK_fixjump (0x700a35)

The derivation is in the doc.

Callers 3

Callees 4

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