|
#define | LUAOP_A_SIZE 8 |
|
#define | LUAOP_B_SIZE 8 |
|
#define | LUAOP_C_SIZE 8 |
|
#define | LUAOP_Bx_SIZE (LUAOP_C_SIZE + LUAOP_B_SIZE + 1) |
|
#define | LUAOP_Ax_SIZE (LUAOP_Bx_SIZE + LUAOP_A_SIZE) |
|
#define | LUAOP_sJ_SIZE (LUAOP_Bx_SIZE + LUAOP_A_SIZE) |
|
#define | LUAOP_OP_SIZE 7 |
|
#define | LUAOP_OP_OFFSET 0 |
|
#define | LUAOP_A_OFFSET (LUAOP_OP_OFFSET + LUAOP_OP_SIZE) |
|
#define | LUAOP_k_OFFSET (LUAOP_A_OFFSET + LUAOP_A_SIZE) |
|
#define | LUAOP_B_OFFSET (LUAOP_k_OFFSET + 1) |
|
#define | LUAOP_C_OFFSET (LUAOP_B_OFFSET + LUAOP_B_SIZE) |
|
#define | LUAOP_Bx_OFFSET LUAOP_k_OFFSET |
|
#define | LUAOP_Ax_OFFSET LUAOP_A_OFFSET |
|
#define | LUAOP_sJ_OFFSET LUAOP_A_OFFSET |
|
#define | LUAOP_MAXARG_Bx ((1 << LUAOP_Bx_SIZE) - 1) |
|
#define | LUAOP_MAXARG_Ax ((1 << LUAOP_Ax_SIZE) - 1) |
|
#define | LUAOP_MAXARG_sJ ((1 << LUAOP_sJ_SIZE) - 1) |
|
#define | LUAOP_MAXARG_A ((1 << LUAOP_A_SIZE) - 1) |
|
#define | LUAOP_MAXARG_B ((1 << LUAOP_B_SIZE) - 1) |
|
#define | LUAOP_MAXARG_C ((1 << LUAOP_C_SIZE) - 1) |
|
#define | LUAOP_FIX_sBx (LUAOP_MAXARG_Bx >> 1) |
|
#define | LUAOP_FIX_sJ (LUAOP_MAXARG_sJ >> 1) |
|
#define | LUAOP_FIX_sC (LUAOP_MAXARG_C >> 1) |
|
#define | LUA_NUM_OPCODES ((int)(OP_EXTRAARG) + 1) |
|
#define | LUA_CAST(x, y) ((x)y) |
|
#define | int2sC(i) ((i) + LUAOP_FIX_sC) |
|
#define | sC2int(i) ((i)-LUAOP_FIX_sC) |
|
#define | LUA_MASK1(n, p) ((~((~(LuaInstruction)0) << (n))) << (p)) |
|
#define | LUA_MASK0(n, p) (~LUA_MASK1(n, p)) |
|
#define | LUA_GET_OPCODE(i) (LUA_CAST(LuaOpCode, ((i) >> LUAOP_OP_OFFSET) & LUA_MASK1(LUAOP_OP_SIZE, 0))) |
|
#define | LUA_SET_OPCODE(i, o) |
|
#define | LUA_GETARG(i, offset, size) (LUA_CAST(int, ((i) >> (offset)) & LUA_MASK1(size, 0))) |
|
#define | LUA_SETARG(i, v, pos, size) |
|
#define | LUA_GETARG_A(i) LUA_GETARG(i, LUAOP_A_OFFSET, LUAOP_A_SIZE) |
|
#define | LUA_GETARG_B(i) LUA_GETARG(i, LUAOP_B_OFFSET, LUAOP_B_SIZE) |
|
#define | LUA_GETARG_C(i) LUA_GETARG(i, LUAOP_C_OFFSET, LUAOP_C_SIZE) |
|
#define | LUA_GETARG_Bx(i) LUA_GETARG(i, LUAOP_Bx_OFFSET, LUAOP_Bx_SIZE) |
|
#define | LUA_GETARG_Ax(i) LUA_GETARG(i, LUAOP_Ax_OFFSET, LUAOP_Ax_SIZE) |
|
#define | LUA_GETARG_sBx(i) (LUA_GETARG_Bx(i) - LUAOP_FIX_sBx) |
|
#define | LUA_GETARG_sJ(i) (LUA_GETARG(i, LUAOP_sJ_OFFSET, LUAOP_sJ_SIZE) - LUAOP_FIX_sJ) |
|
#define | LUA_GETARG_sC(i) sC2int(LUA_GETARG_C(i)) |
|
#define | LUA_GETARG_sB(i) sC2int(LUA_GETARG_B(i)) |
|
#define | LUA_GETARG_k(i) LUA_GETARG(i, LUAOP_k_OFFSET, 1) |
|
#define | SETARG_A(i, v) LUA_SETARG(i, v, LUAOP_A_OFFSET, LUAOP_A_SIZE) |
|
#define | SETARG_B(i, v) LUA_SETARG(i, v, LUAOP_B_OFFSET, LUAOP_B_SIZE) |
|
#define | SETARG_C(i, v) LUA_SETARG(i, v, LUAOP_C_OFFSET, LUAOP_C_SIZE) |
|
#define | SETARG_Bx(i, v) LUA_SETARG(i, v, LUAOP_Bx_OFFSET, LUAOP_Bx_SIZE) |
|
#define | SETARG_Ax(i, v) LUA_SETARG(i, v, LUAOP_Ax_OFFSET, LUAOP_Ax_SIZE) |
|
#define | SETARG_sBx(i, b) SETARG_Bx((i), LUA_CAST(ut32, (b) + LUAOP_FIX_sBx)) |
|
#define | SETARG_sJ(i, j) LUA_SETARG((i), LUA_CAST(ut32, (j) + LUAOP_FIX_sJ), LUAOP_sJ_OFFSET, LUAOP_sJ_SIZE) |
|
#define | SETARG_sC(i, v) SETARG_C((i), int2sC(v)) |
|
#define | SETARG_sB(i, v) SETARG_B((i), int2sC(v)) |
|
#define | SETARG_k(i, v) LUA_SETARG(i, v, LUAOP_k_OFFSET, 1) |
|
#define | PARAM_A 1 |
|
#define | PARAM_B 2 |
|
#define | PARAM_C 4 |
|
#define | PARAM_Ax 8 |
|
#define | PARAM_Bx 16 |
|
#define | PARAM_sBx 32 |
|
#define | PARAM_sJ 64 |
|
#define | PARAM_sC 128 |
|
#define | PARAM_sB 256 |
|
#define | PARAM_k 512 |
|
#define | has_param_flag(flag, bit) ((flag) & (bit)) ? true : false |
|
#define | ISK(isk) ((isk) ? "#CONST" : "#R") |
|
#define | ISFLIP(isk) ((isk) ? "#FLIP" : "") |
|
|
enum | LuaOpMode {
iABC
, iABx
, iAsBx
, iAx
,
iABC
, iABx
, iAsBx
, iAx
,
isJ
} |
|
enum | LuaOpCode {
OP_MOVE
, OP_LOADK
, OP_LOADKX
, OP_LOADBOOL
,
OP_LOADNIL
, OP_GETUPVAL
, OP_GETTABUP
, OP_GETTABLE
,
OP_SETTABUP
, OP_SETUPVAL
, OP_SETTABLE
, OP_NEWTABLE
,
OP_SELF
, OP_ADD
, OP_SUB
, OP_MUL
,
OP_MOD
, OP_POW
, OP_DIV
, OP_IDIV
,
OP_BAND
, OP_BOR
, OP_BXOR
, OP_SHL
,
OP_SHR
, OP_UNM
, OP_BNOT
, OP_NOT
,
OP_LEN
, OP_CONCAT
, OP_JMP
, OP_EQ
,
OP_LT
, OP_LE
, OP_TEST
, OP_TESTSET
,
OP_CALL
, OP_TAILCALL
, OP_RETURN
, OP_FORLOOP
,
OP_FORPREP
, OP_TFORCALL
, OP_TFORLOOP
, OP_SETLIST
,
OP_CLOSURE
, OP_VARARG
, OP_EXTRAARG
, OP_MOVE
,
OP_LOADI
, OP_LOADF
, OP_LOADK
, OP_LOADKX
,
OP_LOADFALSE
, OP_LFALSESKIP
, OP_LOADTRUE
, OP_LOADNIL
,
OP_GETUPVAL
, OP_SETUPVAL
, OP_GETTABUP
, OP_GETTABLE
,
OP_GETI
, OP_GETFIELD
, OP_SETTABUP
, OP_SETTABLE
,
OP_SETI
, OP_SETFIELD
, OP_NEWTABLE
, OP_SELF
,
OP_ADDI
, OP_ADDK
, OP_SUBK
, OP_MULK
,
OP_MODK
, OP_POWK
, OP_DIVK
, OP_IDIVK
,
OP_BANDK
, OP_BORK
, OP_BXORK
, OP_SHRI
,
OP_SHLI
, OP_ADD
, OP_SUB
, OP_MUL
,
OP_MOD
, OP_POW
, OP_DIV
, OP_IDIV
,
OP_BAND
, OP_BOR
, OP_BXOR
, OP_SHL
,
OP_SHR
, OP_MMBIN
, OP_MMBINI
, OP_MMBINK
,
OP_UNM
, OP_BNOT
, OP_NOT
, OP_LEN
,
OP_CONCAT
, OP_CLOSE
, OP_TBC
, OP_JMP
,
OP_EQ
, OP_LT
, OP_LE
, OP_EQK
,
OP_EQI
, OP_LTI
, OP_LEI
, OP_GTI
,
OP_GEI
, OP_TEST
, OP_TESTSET
, OP_CALL
,
OP_TAILCALL
, OP_RETURN
, OP_RETURN0
, OP_RETURN1
,
OP_FORLOOP
, OP_FORPREP
, OP_TFORPREP
, OP_TFORCALL
,
OP_TFORLOOP
, OP_SETLIST
, OP_CLOSURE
, OP_VARARG
,
OP_VARARGPREP
, OP_EXTRAARG
} |
|