Home | History | Annotate | Download | only in src

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' */
290 #define next_ci(L) (L->ci = (L->ci->next ? L->ci->next : luaE_extendCI(L)))
298 CallInfo *ci;
309 ci = next_ci(L); /* now 'enter' new function */
310 ci->nresults = (short)nresults;
311 ci->func = restorestack(L, funcr);
312 ci->top = L->top + LUA_MINSTACK;
313 lua_assert(ci->top <= L->stack_last);
314 ci->callstatus = 0;
340 ci = next_ci(L); /* now 'enter' new function */
341 ci->nresults = (short)nresults;
342 ci->func = func;
343 ci->u.l.base = base;
344 ci->top = base + p->maxstacksize;
345 lua_assert(ci->top <= L->stack_last);
346 ci->u.l.savedpc = p->code; /* starting point */
347 ci->callstatus = CIST_LUA;
348 L->top = ci->top;
351 callhook(L, ci);
365 CallInfo *ci = L->ci;
372 L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */
374 res = ci->func; /* res == final position of 1st result */
375 wanted = ci->nresults;
376 L->ci = ci = ci->previous; /* back to caller */
409 CallInfo *ci = L->ci;
411 lua_assert(ci->u.c.k != NULL); /* must have a continuation */
413 if (ci->callstatus & CIST_YPCALL) { /* was inside a pcall? */
414 ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */
415 L->errfunc = ci->u.c.old_errfunc;
418 adjustresults(L, ci->nresults);
420 if (!(ci->callstatus & CIST_STAT)) /* no call status? */
421 ci->u.c.status = LUA_YIELD; /* 'default' status */
422 lua_assert(ci->u.c.status != LUA_OK);
423 ci->callstatus = (ci->callstatus & ~(CIST_YPCALL | CIST_STAT)) | CIST_YIELDED;
425 n = (*ci->u.c.k)(L);
436 if (L->ci == &L->base_ci) /* stack is empty? */
438 if (!isLua(L->ci)) /* C function? */
452 CallInfo *ci;
453 for (ci = L->ci; ci != NULL; ci = ci->previous) { /* search for a pcall */
454 if (ci->callstatus & CIST_YPCALL)
455 return ci;
463 CallInfo *ci = findpcall(L);
464 if (ci == NULL) return 0; /* no recovery point */
466 oldtop = restorestack(L, ci->extra);
469 L->ci = ci;
470 L->allowhook = ci->u.c.old_allowhook;
473 L->errfunc = ci->u.c.old_errfunc;
474 ci->callstatus |= CIST_STAT; /* call has error status */
475 ci->u.c.status = (lu_byte)status; /* (here it is) */
499 CallInfo *ci = L->ci;
503 if (ci != &L->base_ci) /* not in base level? */
513 ci->func = restorestack(L, ci->extra);
514 if (isLua(ci)) /* yielded inside a hook? */
517 if (ci->u.c.k != NULL) { /* does it have a continuation? */
519 ci->u.c.status = LUA_YIELD; /* 'default' status */
520 ci->callstatus |= CIST_YIELDED;
522 n = (*ci->u.c.k)(L); /* call continuation */
553 L->ci->top = L->top;
568 CallInfo *ci = L->ci;
579 ci->extra = savestack(L, ci->func); /* save current 'func' */
580 if (isLua(ci)) { /* inside a hook? */
584 if ((ci->u.c.k = k) != NULL) /* is there a continuation? */
585 ci->u.c.ctx = ctx; /* save context */
586 ci->func = L->top - nresults - 1; /* protect stack below results */
589 lua_assert(ci->callstatus & CIST_HOOKED); /* must be inside a hook */
598 CallInfo *old_ci = L->ci;
608 L->ci = old_ci;