Lines Matching full:ci
170 CallInfo *ci; in relstack() local
176 for (ci = L->ci; ci != NULL; ci = ci->previous) { in relstack()
177 ci->top.offset = savestack(L, ci->top.p); in relstack()
178 ci->func.offset = savestack(L, ci->func.p); in relstack()
187 CallInfo *ci; in correctstack() local
193 for (ci = L->ci; ci != NULL; ci = ci->previous) { in correctstack()
194 ci->top.p = restorestack(L, ci->top.offset); in correctstack()
195 ci->func.p = restorestack(L, ci->func.offset); in correctstack()
196 if (isLua(ci)) in correctstack()
197 ci->u.l.trap = 1; /* signal to update 'trap' in 'luaV_execute' */ in correctstack()
281 CallInfo *ci; in stackinuse() local
284 for (ci = L->ci; ci != NULL; ci = ci->previous) { in stackinuse()
285 if (lim < ci->top.p) lim = ci->top.p; in stackinuse()
315 luaE_shrinkCI(L); /* shrink CI list */ in luaD_shrinkstack()
337 CallInfo *ci = L->ci; in luaD_hook() local
339 ptrdiff_t ci_top = savestack(L, ci->top.p); /* idem for 'ci->top' */ in luaD_hook()
343 ar.i_ci = ci; in luaD_hook()
345 mask |= CIST_TRAN; /* 'ci' has transfer information */ in luaD_hook()
346 ci->u2.transferinfo.ftransfer = ftransfer; in luaD_hook()
347 ci->u2.transferinfo.ntransfer = ntransfer; in luaD_hook()
349 if (isLua(ci) && L->top.p < ci->top.p) in luaD_hook()
350 L->top.p = ci->top.p; /* protect entire activation register */ in luaD_hook()
352 if (ci->top.p < L->top.p + LUA_MINSTACK) in luaD_hook()
353 ci->top.p = L->top.p + LUA_MINSTACK; in luaD_hook()
355 ci->callstatus |= mask; in luaD_hook()
361 ci->top.p = restorestack(L, ci_top); in luaD_hook()
363 ci->callstatus &= ~mask; in luaD_hook()
373 void luaD_hookcall (lua_State *L, CallInfo *ci) { in luaD_hookcall() argument
376 int event = (ci->callstatus & CIST_TAIL) ? LUA_HOOKTAILCALL in luaD_hookcall()
378 Proto *p = ci_func(ci)->p; in luaD_hookcall()
379 ci->u.l.savedpc++; /* hooks assume 'pc' is already incremented */ in luaD_hookcall()
381 ci->u.l.savedpc--; /* correct 'pc' */ in luaD_hookcall()
391 static void rethook (lua_State *L, CallInfo *ci, int nres) { in rethook() argument
396 if (isLua(ci)) { in rethook()
397 Proto *p = ci_func(ci)->p; in rethook()
399 delta = ci->u.l.nextraargs + p->numparams + 1; in rethook()
401 ci->func.p += delta; /* if vararg, back to virtual 'func' */ in rethook()
402 ftransfer = cast(unsigned short, firstres - ci->func.p); in rethook()
404 ci->func.p -= delta; in rethook()
406 if (isLua(ci = ci->previous)) in rethook()
407 L->oldpc = pcRel(ci->u.l.savedpc, ci_func(ci)->p); /* set 'oldpc' */ in rethook()
456 L->ci->callstatus |= CIST_CLSRET; /* in case of yields */ in moveresults()
457 L->ci->u2.nres = nres; in moveresults()
459 L->ci->callstatus &= ~CIST_CLSRET; in moveresults()
462 rethook(L, L->ci, nres); in moveresults()
489 void luaD_poscall (lua_State *L, CallInfo *ci, int nres) { in luaD_poscall() argument
490 int wanted = ci->nresults; in luaD_poscall()
492 rethook(L, ci, nres); in luaD_poscall()
494 moveresults(L, ci->func.p, nres, wanted); in luaD_poscall()
496 lua_assert(!(ci->callstatus & in luaD_poscall()
498 L->ci = ci->previous; /* back to caller (after closing variables) */ in luaD_poscall()
503 #define next_ci(L) (L->ci->next ? L->ci->next : luaE_extendCI(L))
508 CallInfo *ci = L->ci = next_ci(L); /* new frame */ in prepCallInfo() local
509 ci->func.p = func; in prepCallInfo()
510 ci->nresults = nret; in prepCallInfo()
511 ci->callstatus = mask; in prepCallInfo()
512 ci->top.p = top; in prepCallInfo()
513 return ci; in prepCallInfo()
523 CallInfo *ci; in precallC() local
525 L->ci = ci = prepCallInfo(L, func, nresults, CIST_C, in precallC()
527 lua_assert(ci->top.p <= L->stack_last.p); in precallC()
536 luaD_poscall(L, ci, n); in precallC()
547 int luaD_pretailcall (lua_State *L, CallInfo *ci, StkId func, in luaD_pretailcall() argument
561 ci->func.p -= delta; /* restore 'func' (if vararg) */ in luaD_pretailcall()
563 setobjs2s(L, ci->func.p + i, func + i); in luaD_pretailcall()
564 func = ci->func.p; /* moved-down function */ in luaD_pretailcall()
567 ci->top.p = func + 1 + fsize; /* top for new function */ in luaD_pretailcall()
568 lua_assert(ci->top.p <= L->stack_last.p); in luaD_pretailcall()
569 ci->u.l.savedpc = p->code; /* starting point */ in luaD_pretailcall()
570 ci->callstatus |= CIST_TAIL; in luaD_pretailcall()
576 /* return luaD_pretailcall(L, ci, func, narg1 + 1, delta); */ in luaD_pretailcall()
602 CallInfo *ci; in luaD_precall() local
608 L->ci = ci = prepCallInfo(L, func, nresults, 0, func + 1 + fsize); in luaD_precall()
609 ci->u.l.savedpc = p->code; /* starting point */ in luaD_precall()
612 lua_assert(ci->top.p <= L->stack_last.p); in luaD_precall()
613 return ci; in luaD_precall()
633 CallInfo *ci; in ccall() local
639 if ((ci = luaD_precall(L, func, nResults)) != NULL) { /* Lua function? */ in ccall()
640 ci->callstatus = CIST_FRESH; /* mark that it is a "fresh" execute */ in ccall()
641 luaV_execute(L, ci); /* call it */ in ccall()
679 static int finishpcallk (lua_State *L, CallInfo *ci) { in finishpcallk() argument
680 int status = getcistrecst(ci); /* get original status */ in finishpcallk()
684 StkId func = restorestack(L, ci->u2.funcidx); in finishpcallk()
685 L->allowhook = getoah(ci->callstatus); /* restore 'allowhook' */ in finishpcallk()
689 setcistrecst(ci, LUA_OK); /* clear original status */ in finishpcallk()
691 ci->callstatus &= ~CIST_YPCALL; in finishpcallk()
692 L->errfunc = ci->u.c.old_errfunc; in finishpcallk()
712 static void finishCcall (lua_State *L, CallInfo *ci) { in finishCcall() argument
714 if (ci->callstatus & CIST_CLSRET) { /* was returning? */ in finishCcall()
715 lua_assert(hastocloseCfunc(ci->nresults)); in finishCcall()
716 n = ci->u2.nres; /* just redo 'luaD_poscall' */ in finishCcall()
722 lua_assert(ci->u.c.k != NULL && yieldable(L)); in finishCcall()
723 if (ci->callstatus & CIST_YPCALL) /* was inside a 'lua_pcallk'? */ in finishCcall()
724 status = finishpcallk(L, ci); /* finish it */ in finishCcall()
727 n = (*ci->u.c.k)(L, status, ci->u.c.ctx); /* call continuation */ in finishCcall()
731 luaD_poscall(L, ci, n); /* finish 'luaD_call' */ in finishCcall()
741 CallInfo *ci; in unroll() local
743 while ((ci = L->ci) != &L->base_ci) { /* something in the stack */ in unroll()
744 if (!isLua(ci)) /* C function? */ in unroll()
745 finishCcall(L, ci); /* complete its execution */ in unroll()
748 luaV_execute(L, ci); /* execute down to higher C 'boundary' */ in unroll()
759 CallInfo *ci; in findpcall() local
760 for (ci = L->ci; ci != NULL; ci = ci->previous) { /* search for a pcall */ in findpcall()
761 if (ci->callstatus & CIST_YPCALL) in findpcall()
762 return ci; in findpcall()
792 CallInfo *ci = L->ci; in resume() local
798 if (isLua(ci)) { /* yielded inside a hook? */ in resume()
800 luaV_execute(L, ci); /* just continue running Lua code */ in resume()
803 if (ci->u.c.k != NULL) { /* does it have a continuation function? */ in resume()
805 n = (*ci->u.c.k)(L, LUA_YIELD, ci->u.c.ctx); /* call continuation */ in resume()
809 luaD_poscall(L, ci, n); /* finish 'luaD_call' */ in resume()
825 CallInfo *ci; in precover() local
826 while (errorstatus(status) && (ci = findpcall(L)) != NULL) { in precover()
827 L->ci = ci; /* go down to recovery functions */ in precover()
828 setcistrecst(ci, status); /* status to finish 'pcall' */ in precover()
840 if (L->ci != &L->base_ci) /* not in base level? */ in lua_resume()
842 else if (L->top.p - (L->ci->func.p + 1) == nargs) /* no function? */ in lua_resume()
861 L->ci->top.p = L->top.p; in lua_resume()
863 *nresults = (status == LUA_YIELD) ? L->ci->u2.nyield in lua_resume()
864 : cast_int(L->top.p - (L->ci->func.p + 1)); in lua_resume()
877 CallInfo *ci; in lua_yieldk() local
880 ci = L->ci; in lua_yieldk()
889 ci->u2.nyield = nresults; /* save number of results */ in lua_yieldk()
890 if (isLua(ci)) { /* inside a hook? */ in lua_yieldk()
891 lua_assert(!isLuacode(ci)); in lua_yieldk()
896 if ((ci->u.c.k = k) != NULL) /* is there a continuation? */ in lua_yieldk()
897 ci->u.c.ctx = ctx; /* save context */ in lua_yieldk()
900 lua_assert(ci->callstatus & CIST_HOOKED); /* must be inside a hook */ in lua_yieldk()
929 CallInfo *old_ci = L->ci; in luaD_closeprotected()
938 L->ci = old_ci; in luaD_closeprotected()
953 CallInfo *old_ci = L->ci; in luaD_pcall()
959 L->ci = old_ci; in luaD_pcall()