From 196c87c9cecfacf978f37de4ec69eba0a5971256 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 23 Nov 2017 14:41:16 -0200 Subject: no more 'stackless' implementation; 'luaV_execute' calls itself recursively to execute function calls. 'unroll' continues all executions suspended by an yield (through a long jump) --- lstate.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'lstate.h') diff --git a/lstate.h b/lstate.h index 02715dfb..fad54634 100644 --- a/lstate.h +++ b/lstate.h @@ -1,5 +1,5 @@ /* -** $Id: lstate.h,v 2.150 2017/11/07 13:25:26 roberto Exp roberto $ +** $Id: lstate.h,v 2.151 2017/11/13 15:36:52 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -104,7 +104,7 @@ typedef struct CallInfo { int nyield; /* number of values yielded */ } u2; short nresults; /* expected number of results from this function */ - unsigned short callstatus; + lu_byte callstatus; } CallInfo; @@ -114,13 +114,11 @@ typedef struct CallInfo { #define CIST_OAH (1<<0) /* original value of 'allowhook' */ #define CIST_LUA (1<<1) /* call is running a Lua function */ #define CIST_HOOKED (1<<2) /* call is running a debug hook */ -#define CIST_FRESH (1<<3) /* call is running on a fresh invocation - of luaV_execute */ -#define CIST_YPCALL (1<<4) /* call is a yieldable protected call */ -#define CIST_TAIL (1<<5) /* call was tail called */ -#define CIST_HOOKYIELD (1<<6) /* last hook called yielded */ -#define CIST_LEQ (1<<7) /* using __lt for __le */ -#define CIST_FIN (1<<8) /* call is running a finalizer */ +#define CIST_YPCALL (1<<3) /* call is a yieldable protected call */ +#define CIST_TAIL (1<<4) /* call was tail called */ +#define CIST_HOOKYIELD (1<<5) /* last hook called yielded */ +#define CIST_LEQ (1<<6) /* using __lt for __le */ +#define CIST_FIN (1<<7) /* call is running a finalizer */ #define isLua(ci) ((ci)->callstatus & CIST_LUA) @@ -256,6 +254,7 @@ LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); LUAI_FUNC CallInfo *luaE_extendCI (lua_State *L); LUAI_FUNC void luaE_freeCI (lua_State *L); LUAI_FUNC void luaE_shrinkCI (lua_State *L); +LUAI_FUNC void luaE_incCcalls (lua_State *L); #endif -- cgit v1.2.3-55-g6feb