From 758c1ef445ab27d89bace746111add04083a8e20 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 15 Jul 2019 14:59:35 -0300 Subject: Unification of size representation in OP_NEWTABLE and OP_SETLIST Opcodes OP_NEWTABLE and OP_SETLIST use the same representation to store the size of the array part of a table. This new representation can go up to 2^33 (8 + 25 bits). --- lcode.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lcode.h') diff --git a/lcode.h b/lcode.h index a924722c..0c12bb64 100644 --- a/lcode.h +++ b/lcode.h @@ -51,11 +51,11 @@ typedef enum UnOpr { OPR_MINUS, OPR_BNOT, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; #define luaK_jumpto(fs,t) luaK_patchlist(fs, luaK_jump(fs), t) +LUAI_FUNC int luaK_code (FuncState *fs, Instruction i); LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); LUAI_FUNC int luaK_codeAsBx (FuncState *fs, OpCode o, int A, int Bx); LUAI_FUNC int luaK_codeABCk (FuncState *fs, OpCode o, int A, int B, int C, int k); -LUAI_FUNC int luaK_codeextraarg (FuncState *fs, int a); LUAI_FUNC int luaK_isKint (expdesc *e); LUAI_FUNC int luaK_exp2const (FuncState *fs, const expdesc *e, TValue *v); LUAI_FUNC void luaK_fixline (FuncState *fs, int line); @@ -87,6 +87,8 @@ LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v, int line); LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2, int line); +LUAI_FUNC void luaK_settablesize (FuncState *fs, int pc, + int ra, int rb, int rc); LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); LUAI_FUNC void luaK_finish (FuncState *fs); LUAI_FUNC l_noret luaK_semerror (LexState *ls, const char *msg); -- cgit v1.2.3-55-g6feb