diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-30 11:29:18 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2017-11-30 11:29:18 -0200 |
commit | 10b8c99bbbb5405f5fb37513645421b8e3c3ba43 (patch) | |
tree | 9314d4ab53f9394e2199e05cf6c41b4d0ff0d52e /lvm.c | |
parent | bdc751ce2346e95f96de3d55d48ddb25674073c5 (diff) | |
download | lua-10b8c99bbbb5405f5fb37513645421b8e3c3ba43.tar.gz lua-10b8c99bbbb5405f5fb37513645421b8e3c3ba43.tar.bz2 lua-10b8c99bbbb5405f5fb37513645421b8e3c3ba43.zip |
small peephole optimizations
Diffstat (limited to 'lvm.c')
-rw-r--r-- | lvm.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lvm.c,v 2.321 2017/11/29 13:02:17 roberto Exp roberto $ | 2 | ** $Id: lvm.c,v 2.322 2017/11/29 16:57:36 roberto Exp roberto $ |
3 | ** Lua virtual machine | 3 | ** Lua virtual machine |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -1453,7 +1453,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1453 | /* next instruction will do the return */ | 1453 | /* next instruction will do the return */ |
1454 | } | 1454 | } |
1455 | else { /* tail call */ | 1455 | else { /* tail call */ |
1456 | if (cl->p->sizep > 0) /* close upvalues from previous call */ | 1456 | if (TESTARG_k(i)) /* close upvalues from previous call */ |
1457 | luaF_close(L, ci->func + 1); | 1457 | luaF_close(L, ci->func + 1); |
1458 | luaD_pretailcall(L, ci, ra, b); /* prepare call frame */ | 1458 | luaD_pretailcall(L, ci, ra, b); /* prepare call frame */ |
1459 | goto tailcall; | 1459 | goto tailcall; |
@@ -1462,7 +1462,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1462 | } | 1462 | } |
1463 | vmcase(OP_RETURN) { | 1463 | vmcase(OP_RETURN) { |
1464 | int b = GETARG_B(i); | 1464 | int b = GETARG_B(i); |
1465 | if (cl->p->sizep > 0) | 1465 | if (TESTARG_k(i)) |
1466 | luaF_close(L, base); | 1466 | luaF_close(L, base); |
1467 | halfProtect( | 1467 | halfProtect( |
1468 | luaD_poscall(L, ci, ra, (b != 0 ? b - 1 : cast_int(L->top - ra))) | 1468 | luaD_poscall(L, ci, ra, (b != 0 ? b - 1 : cast_int(L->top - ra))) |
@@ -1470,7 +1470,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1470 | return; | 1470 | return; |
1471 | } | 1471 | } |
1472 | vmcase(OP_RETURN0) { | 1472 | vmcase(OP_RETURN0) { |
1473 | if (cl->p->sizep > 0) | 1473 | if (TESTARG_k(i)) |
1474 | luaF_close(L, base); | 1474 | luaF_close(L, base); |
1475 | if (L->hookmask) | 1475 | if (L->hookmask) |
1476 | halfProtect(luaD_poscall(L, ci, ra, 0)); /* no hurry... */ | 1476 | halfProtect(luaD_poscall(L, ci, ra, 0)); /* no hurry... */ |
@@ -1484,7 +1484,7 @@ void luaV_execute (lua_State *L, CallInfo *ci) { | |||
1484 | return; | 1484 | return; |
1485 | } | 1485 | } |
1486 | vmcase(OP_RETURN1) { | 1486 | vmcase(OP_RETURN1) { |
1487 | if (cl->p->sizep > 0) | 1487 | if (TESTARG_k(i)) |
1488 | luaF_close(L, base); | 1488 | luaF_close(L, base); |
1489 | if (L->hookmask) | 1489 | if (L->hookmask) |
1490 | halfProtect(luaD_poscall(L, ci, ra, 1)); /* no hurry... */ | 1490 | halfProtect(luaD_poscall(L, ci, ra, 1)); /* no hurry... */ |