summaryrefslogtreecommitdiff
path: root/lvm.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-11-02 09:43:17 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2015-11-02 09:43:17 -0200
commit07a2dcacbfb8f9a2332da19b5c5a178e87d7af21 (patch)
tree4703c1757e623f52b3fc800ce7ba08342520d655 /lvm.c
parentc874abac98b4bbd73603c599bc8096ac800e1184 (diff)
downloadlua-github-07a2dcacbfb8f9a2332da19b5c5a178e87d7af21.tar.gz
flag CIST_REENTRY changed to CIST_FRESH (its negation); fresh invocations
seem to be less frequent than reentries. (So, avoid setting flag on the frequent case.)
Diffstat (limited to 'lvm.c')
-rw-r--r--lvm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lvm.c b/lvm.c
index 2dcd6143..051b948c 100644
--- a/lvm.c
+++ b/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.256 2015/10/22 14:40:47 roberto Exp roberto $
+** $Id: lvm.c,v 2.257 2015/10/28 14:50:09 roberto Exp roberto $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -764,6 +764,7 @@ void luaV_execute (lua_State *L) {
LClosure *cl;
TValue *k;
StkId base;
+ ci->callstatus |= CIST_FRESH; /* fresh invocation of 'luaV_execute" */
newframe: /* reentry point when frame changes (call/return) */
lua_assert(ci == L->ci);
cl = clLvalue(ci->func); /* local reference to function's closure */
@@ -1118,7 +1119,6 @@ void luaV_execute (lua_State *L) {
}
else { /* Lua function */
ci = L->ci;
- ci->callstatus |= CIST_REENTRY;
goto newframe; /* restart luaV_execute over new Lua function */
}
vmbreak;
@@ -1158,7 +1158,7 @@ void luaV_execute (lua_State *L) {
int b = GETARG_B(i);
if (cl->p->sizep > 0) luaF_close(L, base);
b = luaD_poscall(L, ra, (b != 0 ? b - 1 : cast_int(L->top - ra)));
- if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */
+ if (ci->callstatus & CIST_FRESH) /* local 'ci' still from callee */
return; /* external invocation: return */
else { /* invocation via reentry: continue execution */
ci = L->ci;