benilla-re systems structs docs

luaK_exp2val

function · lua · boundary

Address
0x700ff0 · 18 bytes, up to 0x701001
Meaning
Makes an expression a value, in a register when it has jumps
Confidence
verified, proof one
Finding
lua/codegen#discharging-expressions

Finding: Discharging expressions in lua: the code generator

luaK_dischargevars turns a variable into a value: a local is already in its register, an upvalue, global or field gets its load instruction, and a call is cut to one result by luaK_setcallreturns. discharge2reg puts a value without jumps into a given register: OP_LOADNIL, OP_LOADBOOL, OP_LOADK, the target register of a relocatable instruction or OP_MOVE. luaK_exp2reg adds the jump lists, loading false and true through code_label when some jump yields no value. luaK_exp2RK answers a constant operand when the index fits in 9 bits after the 250 bias.

functionnamedecided by
0x700bd0luaK_setcallreturnscall (0x700bd3), C = n + 1 (0x700beb..0x700c00), one result to its register (0x700c08..0x700c18)
0x700c20luaK_dischargevarsswitch on kind 5 to 12 (0x700c25..0x700c30), local (0x700c38), OP_GETUPVAL (0x700c42), OP_GETGLOBAL (0x700c56), field frees and OP_GETTABLE (0x700c67..0x700c8c), call (0x700ca3)
0x700eb0discharge2regluaK_dischargevars (0x700eba), switch on kind 1 to 11 (0x700ec1..0x700ed4), nil (0x700ee4), booleans (0x700efe..0x700f07), constant (0x700f1d), relocatable (0x700f45..0x700f52), register (0x700f6a..0x700f76)
0x701350discharge2anyregin a register (0x701354), luaK_reserveregs (0x701360), discharge2reg (0x70136e)
0x700e90code_labelluaK_getlabel (0x700e93), OP_LOADBOOL (0x700ea6)
0x700d40luaK_exp2regdischarge2reg (0x700d50), jump kind (0x700d55..0x700d63), need_value (0x700d7f, 0x700d8e), code_label (0x700db6, 0x700dc6), two luaK_patchlistaux (0x700df1, 0x700e0d)
0x700cf0luaK_exp2nextregluaK_dischargevars (0x700cf6), freeexp (0x700cff), luaK_reserveregs (0x700d0b), luaK_exp2reg (0x700d19)
0x700fb0luaK_exp2anyregregister without jumps (0x700fbb..0x700fc9), not a local (0x700fcb, 0x700fd5), else luaK_exp2nextreg (0x700fe4)
0x700ff0luaK_exp2valjumps (0x700ff3), luaK_exp2anyreg (0x700ff8) or luaK_dischargevars (0x700ffd)
0x701010luaK_exp2RKluaK_exp2val (0x701016), nil (0x701037..0x701057), constant (0x701025..0x70102d), else luaK_exp2anyreg (0x701064)

The derivation is in the doc.

Callers 4

Callees 2

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