Simpler implementation for tail calls

Tail calls handled by 'luaD_precall', like regular calls, to avoid
code duplication.
This commit is contained in:
Roberto Ierusalimschy
2021-06-11 13:41:07 -03:00
parent c0ed74c1e1
commit 901d760093
3 changed files with 33 additions and 39 deletions

4
ldo.h
View File

@@ -58,8 +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 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 CallInfo *luaD_precall (lua_State *L, StkId func, int nresults,
int delta1);
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);