diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-02 09:43:17 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-11-02 09:43:17 -0200 |
commit | 07a2dcacbfb8f9a2332da19b5c5a178e87d7af21 (patch) | |
tree | 4703c1757e623f52b3fc800ce7ba08342520d655 /lvm.c | |
parent | c874abac98b4bbd73603c599bc8096ac800e1184 (diff) | |
download | lua-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.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; |