Undo change in the handling of 'L->top' (commit b80077b8f3)

With MMBIN instructions, there are fewer opcodes that need to update
'L->top', so that change does not seem to pay for the increased
complexity.
This commit is contained in:
Roberto Ierusalimschy
2019-08-29 12:52:37 -03:00
parent 46b84580d6
commit 72a094bda7
4 changed files with 9 additions and 16 deletions

2
lapi.c
View File

@@ -329,14 +329,12 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
o1 = index2value(L, index1);
o2 = index2value(L, index2);
if (isvalid(L, o1) && isvalid(L, o2)) {
ptrdiff_t top = savestack(L, L->top);
switch (op) {
case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break;
case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break;
case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break;
default: api_check(L, 0, "invalid option");
}
L->top = restorestack(L, top);
}
lua_unlock(L);
return i;