Lines Matching refs:ci
143 CallInfo *ci;
148 for (ci = L->ci; ci != NULL; ci = ci->previous) {
149 ci->top = (ci->top - oldstack) + L->stack;
150 ci->func = (ci->func - oldstack) + L->stack;
151 if (isLua(ci))
152 ci->u.l.base = (ci->u.l.base - oldstack) + L->stack;
195 CallInfo *ci;
197 for (ci = L->ci; ci != NULL; ci = ci->previous) {
198 lua_assert(ci->top <= L->stack_last);
199 if (lim < ci->top) lim = ci->top;
220 CallInfo *ci = L->ci;
222 ptrdiff_t ci_top = savestack(L, ci->top);
226 ar.i_ci = ci;
228 ci->top = L->top + LUA_MINSTACK;
229 lua_assert(ci->top <= L->stack_last);
231 ci->callstatus |= CIST_HOOKED;
237 ci->top = restorestack(L, ci_top);
239 ci->callstatus &= ~CIST_HOOKED;
244 static void callhook (lua_State *L, CallInfo *ci) {
246 ci->u.l.savedpc++; /* hooks assume 'pc' is already incremented */
247 if (isLua(ci->previous) &&
248 GET_OPCODE(*(ci->previous->u.l.savedpc - 1)) == OP_TAILCALL) {
249 ci->callstatus |= CIST_TAIL;
253 ci->u.l.savedpc--; /* correct 'pc' */
289 #define next_ci(L) (L->ci = (L->ci->next ? L->ci->next : luaE_extendCI(L)))
297 CallInfo *ci;
308 ci = next_ci(L); /* now 'enter' new function */
309 ci->nresults = nresults;
310 ci->func = restorestack(L, funcr);
311 ci->top = L->top + LUA_MINSTACK;
312 lua_assert(ci->top <= L->stack_last);
313 ci->callstatus = 0;
333 ci = next_ci(L); /* now 'enter' new function */
334 ci->nresults = nresults;
335 ci->func = func;
336 ci->u.l.base = base;
337 ci->top = base + p->maxstacksize;
338 lua_assert(ci->top <= L->stack_last);
339 ci->u.l.savedpc = p->code; /* starting point */
340 ci->callstatus = CIST_LUA;
341 L->top = ci->top;
344 callhook(L, ci);
358 CallInfo *ci = L->ci;
365 L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */
367 res = ci->func; /* res == final position of 1st result */
368 wanted = ci->nresults;
369 L->ci = ci = ci->previous; /* back to caller */
402 CallInfo *ci = L->ci;
404 lua_assert(ci->u.c.k != NULL); /* must have a continuation */
406 if (ci->callstatus & CIST_YPCALL) { /* was inside a pcall? */
407 ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */
408 L->errfunc = ci->u.c.old_errfunc;
411 adjustresults(L, ci->nresults);
413 if (!(ci->callstatus & CIST_STAT)) /* no call status? */
414 ci->u.c.status = LUA_YIELD; /* 'default' status */
415 lua_assert(ci->u.c.status != LUA_OK);
416 ci->callstatus = (ci->callstatus & ~(CIST_YPCALL | CIST_STAT)) | CIST_YIELDED;
418 n = (*ci->u.c.k)(L);
429 if (L->ci == &L->base_ci) /* stack is empty? */
431 if (!isLua(L->ci)) /* C function? */
445 CallInfo *ci;
446 for (ci = L->ci; ci != NULL; ci = ci->previous) { /* search for a pcall */
447 if (ci->callstatus & CIST_YPCALL)
448 return ci;
456 CallInfo *ci = findpcall(L);
457 if (ci == NULL) return 0; /* no recovery point */
459 oldtop = restorestack(L, ci->extra);
462 L->ci = ci;
463 L->allowhook = ci->u.c.old_allowhook;
466 L->errfunc = ci->u.c.old_errfunc;
467 ci->callstatus |= CIST_STAT; /* call has error status */
468 ci->u.c.status = status; /* (here it is) */
492 CallInfo *ci = L->ci;
496 if (ci != &L->base_ci) /* not in base level? */
506 ci->func = restorestack(L, ci->extra);
507 if (isLua(ci)) /* yielded inside a hook? */
510 if (ci->u.c.k != NULL) { /* does it have a continuation? */
512 ci->u.c.status = LUA_YIELD; /* 'default' status */
513 ci->callstatus |= CIST_YIELDED;
515 n = (*ci->u.c.k)(L); /* call continuation */
545 L->ci->top = L->top;
560 CallInfo *ci = L->ci;
571 ci->extra = savestack(L, ci->func); /* save current 'func' */
572 if (isLua(ci)) { /* inside a hook? */
576 if ((ci->u.c.k = k) != NULL) /* is there a continuation? */
577 ci->u.c.ctx = ctx; /* save context */
578 ci->func = L->top - nresults - 1; /* protect stack below results */
581 lua_assert(ci->callstatus & CIST_HOOKED); /* must be inside a hook */
590 CallInfo *old_ci = L->ci;
600 L->ci = old_ci;