diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-03-04 10:32:29 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2009-03-04 10:32:29 -0300 |
commit | 1817dfc3016efc09cfa2c7aee06b22fe1d130652 (patch) | |
tree | 3de048bf2b14c6547f9ba15134b6b7fd0455f844 /ldo.c | |
parent | 7837e34e567e174e21c7971439e6a4a093addb06 (diff) | |
download | lua-1817dfc3016efc09cfa2c7aee06b22fe1d130652.tar.gz lua-1817dfc3016efc09cfa2c7aee06b22fe1d130652.tar.bz2 lua-1817dfc3016efc09cfa2c7aee06b22fe1d130652.zip |
initial separation, in CallInfo, of what is relevant only to Lua
functions or only to C functions
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 2.52 2009/02/18 14:52:03 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 2.53 2009/03/03 18:51:24 roberto Exp roberto $ |
3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -289,7 +289,7 @@ int luaD_precall (lua_State *L, StkId func, int nresults) { | |||
289 | ci->top = L->base + p->maxstacksize; | 289 | ci->top = L->base + p->maxstacksize; |
290 | lua_assert(ci->top <= L->stack_last); | 290 | lua_assert(ci->top <= L->stack_last); |
291 | L->savedpc = p->code; /* starting point */ | 291 | L->savedpc = p->code; /* starting point */ |
292 | ci->tailcalls = 0; | 292 | ci->u.l.tailcalls = 0; |
293 | ci->callstatus = CIST_LUA; | 293 | ci->callstatus = CIST_LUA; |
294 | ci->nresults = nresults; | 294 | ci->nresults = nresults; |
295 | for (st = L->top; st < ci->top; st++) | 295 | for (st = L->top; st < ci->top; st++) |
@@ -328,8 +328,8 @@ static StkId callrethooks (lua_State *L, StkId firstResult) { | |||
328 | ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ | 328 | ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ |
329 | luaD_callhook(L, LUA_HOOKRET, -1); | 329 | luaD_callhook(L, LUA_HOOKRET, -1); |
330 | if (isLua(L->ci)) { /* Lua function? */ | 330 | if (isLua(L->ci)) { /* Lua function? */ |
331 | while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */ | 331 | while ((L->hookmask & LUA_MASKRET) && L->ci->u.l.tailcalls--) |
332 | luaD_callhook(L, LUA_HOOKTAILRET, -1); | 332 | luaD_callhook(L, LUA_HOOKTAILRET, -1); /* ret. hooks for tail calls */ |
333 | } | 333 | } |
334 | return restorestack(L, fr); | 334 | return restorestack(L, fr); |
335 | } | 335 | } |