From 41871f1803770305f182f56cbd22a336c5236a19 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 18 Aug 2021 11:21:33 -0300 Subject: Undo simplification of tail calls (commit 901d760) Not that simpler and slower. --- ldo.h | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'ldo.h') diff --git a/ldo.h b/ldo.h index 49fbb492..6bf0ed86 100644 --- a/ldo.h +++ b/ldo.h @@ -49,18 +49,6 @@ luaD_checkstackaux(L, (fsize), luaC_checkGC(L), (void)0) -/* -** 'luaD_precall' is used for regular calls, when it needs the -** number of results, and in tail calls, when it needs the 'delta' -** (correction of base for vararg functions). The argument 'retdel' -** codes these two options. A number of results is represented by -** itself, while a delta is represented by 'delta2retdel(delta)' -*/ -#define delta2retdel(d) (-(d) + LUA_MULTRET - 1) -#define retdel2delta(d) (-(d) + LUA_MULTRET - 1) -#define isdelta(rd) ((rd) < LUA_MULTRET) - - /* type of protected functions, to be ran by 'runprotected' */ typedef void (*Pfunc) (lua_State *L, void *ud); @@ -70,7 +58,8 @@ LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, LUAI_FUNC void luaD_hook (lua_State *L, int event, int line, int fTransfer, int nTransfer); LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci); -LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int retdel); +LUAI_FUNC void luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int n); +LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); LUAI_FUNC void luaD_tryfuncTM (lua_State *L, StkId func); -- cgit v1.2.3-55-g6feb