Correct handling of 'luaV_execute' invocations

The previous stackless implementations marked all 'luaV_execute'
invocations as fresh. However, re-entering 'luaV_execute' when
resuming a coroutine should not be a fresh invocation. (It works
because 'unroll' called 'luaV_execute' for each call entry, but
it was slower than letting 'luaV_execute' finish all non-fresh
invocations.)
This commit is contained in:
Roberto Ierusalimschy
2020-09-24 13:26:51 -03:00
parent 287b302acb
commit 490d42b5f8
5 changed files with 37 additions and 32 deletions

View File

@@ -172,7 +172,7 @@ void luaE_checkcstack (lua_State *L) {
LUAI_FUNC void luaE_incCstack (lua_State *L) {
L->nCcalls++;
if (getCcalls(L) >= LUAI_MAXCCALLS)
if (unlikely(getCcalls(L) >= LUAI_MAXCCALLS))
luaE_checkcstack(L);
}