From df13f259487459f3a28d31d76c890aa6c2d061e0 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 27 Aug 2019 13:59:39 -0300 Subject: First version of OP_MMBIN opcodes In arithmetic/bitwise operators, the call to metamethods is made in a separate opcode following the main one. (The main opcode skips this next one when the operation succeeds.) This change reduces slightly the size of the binary and the complexity of the arithmetic/bitwise opcodes. It also simplfies the treatment of errors and yeld/resume in these operations, as there are much fewer cases to consider. (Only OP_MMBIN/OP_MMBINI/OP_MMBINK, instead of all variants of all arithmetic/bitwise operators.) --- ltm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ltm.c') diff --git a/ltm.c b/ltm.c index 19233a87..991e62c1 100644 --- a/ltm.c +++ b/ltm.c @@ -173,7 +173,7 @@ void luaT_tryconcatTM (lua_State *L) { void luaT_trybinassocTM (lua_State *L, const TValue *p1, const TValue *p2, - StkId res, int flip, TMS event) { + int flip, StkId res, TMS event) { if (flip) luaT_trybinTM(L, p2, p1, res, event); else @@ -185,7 +185,7 @@ void luaT_trybiniTM (lua_State *L, const TValue *p1, lua_Integer i2, int flip, StkId res, TMS event) { TValue aux; setivalue(&aux, i2); - luaT_trybinassocTM(L, p1, &aux, res, flip, event); + luaT_trybinassocTM(L, p1, &aux, flip, res, event); } -- cgit v1.2.3-55-g6feb