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.)
This commit is contained in:
4
ltm.c
4
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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user