aboutsummaryrefslogtreecommitdiff
path: root/ldo.h
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-08-18 11:21:33 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2021-08-18 11:21:33 -0300
commit41871f1803770305f182f56cbd22a336c5236a19 (patch)
tree4f15a23a06999d63dd605896c537f98861c605c2 /ldo.h
parenta393ac255493276b1ad9d7be057fe58ea824dd00 (diff)
downloadlua-41871f1803770305f182f56cbd22a336c5236a19.tar.gz
lua-41871f1803770305f182f56cbd22a336c5236a19.tar.bz2
lua-41871f1803770305f182f56cbd22a336c5236a19.zip
Undo simplification of tail calls (commit 901d760)
Not that simpler and slower.
Diffstat (limited to 'ldo.h')
-rw-r--r--ldo.h15
1 files changed, 2 insertions, 13 deletions
diff --git a/ldo.h b/ldo.h
index 49fbb492..6bf0ed86 100644
--- a/ldo.h
+++ b/ldo.h
@@ -49,18 +49,6 @@
49 luaD_checkstackaux(L, (fsize), luaC_checkGC(L), (void)0) 49 luaD_checkstackaux(L, (fsize), luaC_checkGC(L), (void)0)
50 50
51 51
52/*
53** 'luaD_precall' is used for regular calls, when it needs the
54** number of results, and in tail calls, when it needs the 'delta'
55** (correction of base for vararg functions). The argument 'retdel'
56** codes these two options. A number of results is represented by
57** itself, while a delta is represented by 'delta2retdel(delta)'
58*/
59#define delta2retdel(d) (-(d) + LUA_MULTRET - 1)
60#define retdel2delta(d) (-(d) + LUA_MULTRET - 1)
61#define isdelta(rd) ((rd) < LUA_MULTRET)
62
63
64/* type of protected functions, to be ran by 'runprotected' */ 52/* type of protected functions, to be ran by 'runprotected' */
65typedef void (*Pfunc) (lua_State *L, void *ud); 53typedef void (*Pfunc) (lua_State *L, void *ud);
66 54
@@ -70,7 +58,8 @@ LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name,
70LUAI_FUNC void luaD_hook (lua_State *L, int event, int line, 58LUAI_FUNC void luaD_hook (lua_State *L, int event, int line,
71 int fTransfer, int nTransfer); 59 int fTransfer, int nTransfer);
72LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci); 60LUAI_FUNC void luaD_hookcall (lua_State *L, CallInfo *ci);
73LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int retdel); 61LUAI_FUNC void luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, int n);
62LUAI_FUNC CallInfo *luaD_precall (lua_State *L, StkId func, int nResults);
74LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); 63LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults);
75LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults); 64LUAI_FUNC void luaD_callnoyield (lua_State *L, StkId func, int nResults);
76LUAI_FUNC void luaD_tryfuncTM (lua_State *L, StkId func); 65LUAI_FUNC void luaD_tryfuncTM (lua_State *L, StkId func);