aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-29 12:52:37 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-29 12:52:37 -0300
commit72a094bda7d71050a91a88474d67d39aa2bc1c46 (patch)
treeb14358bae6d5e0ba4a4d2c2bf515d82d8cf25b40 /lapi.c
parent46b84580d6d7890f4ba813f312e52514fffc38a7 (diff)
downloadlua-72a094bda7d71050a91a88474d67d39aa2bc1c46.tar.gz
lua-72a094bda7d71050a91a88474d67d39aa2bc1c46.tar.bz2
lua-72a094bda7d71050a91a88474d67d39aa2bc1c46.zip
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.
Diffstat (limited to '')
-rw-r--r--lapi.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/lapi.c b/lapi.c
index a9ffad80..0ea3dc0f 100644
--- a/lapi.c
+++ b/lapi.c
@@ -329,14 +329,12 @@ LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) {
329 o1 = index2value(L, index1); 329 o1 = index2value(L, index1);
330 o2 = index2value(L, index2); 330 o2 = index2value(L, index2);
331 if (isvalid(L, o1) && isvalid(L, o2)) { 331 if (isvalid(L, o1) && isvalid(L, o2)) {
332 ptrdiff_t top = savestack(L, L->top);
333 switch (op) { 332 switch (op) {
334 case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break; 333 case LUA_OPEQ: i = luaV_equalobj(L, o1, o2); break;
335 case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break; 334 case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break;
336 case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break; 335 case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break;
337 default: api_check(L, 0, "invalid option"); 336 default: api_check(L, 0, "invalid option");
338 } 337 }
339 L->top = restorestack(L, top);
340 } 338 }
341 lua_unlock(L); 339 lua_unlock(L);
342 return i; 340 return i;