Lines Matching refs:top
86 ci->func = L->top - 1; /* protect stack below results */ in traceexec()
97 setobj2s(L, L->top++, f); /* push function */ in callTM()
98 setobj2s(L, L->top++, p1); /* 1st argument */ in callTM()
99 setobj2s(L, L->top++, p2); /* 2nd argument */ in callTM()
101 setobj2s(L, L->top++, p3); /* 3rd argument */ in callTM()
103 luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci)); in callTM()
106 setobjs2s(L, p3, --L->top); in callTM()
203 if (!call_binTM(L, p1, p2, L->top, event)) in call_orderTM()
206 return !l_isfalse(L->top); in call_orderTM()
289 callTM(L, tm, t1, t2, L->top, 1); /* call TM */ in luaV_equalobj_()
290 return !l_isfalse(L->top); in luaV_equalobj_()
297 StkId top = L->top; in luaV_concat() local
299 if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { in luaV_concat()
300 if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) in luaV_concat()
301 luaG_concaterror(L, top-2, top-1); in luaV_concat()
303 else if (tsvalue(top-1)->len == 0) /* second operand is empty? */ in luaV_concat()
304 (void)tostring(L, top - 2); /* result is first operand */ in luaV_concat()
305 else if (ttisstring(top-2) && tsvalue(top-2)->len == 0) { in luaV_concat()
306 setobjs2s(L, top - 2, top - 1); /* result is second op. */ in luaV_concat()
310 size_t tl = tsvalue(top-1)->len; in luaV_concat()
314 for (i = 1; i < total && tostring(L, top-i-1); i++) { in luaV_concat()
315 size_t l = tsvalue(top-i-1)->len; in luaV_concat()
324 size_t l = tsvalue(top-i)->len; in luaV_concat()
325 memcpy(buffer+tl, svalue(top-i), l * sizeof(char)); in luaV_concat()
328 setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); in luaV_concat()
331 L->top -= n-1; /* popped 'n' strings and pushed one */ in luaV_concat()
493 setobjs2s(L, base + GETARG_A(inst), --L->top); in luaV_finishOp()
497 int res = !l_isfalse(L->top - 1); in luaV_finishOp()
498 L->top--; in luaV_finishOp()
510 StkId top = L->top - 1; /* top when 'call_binTM' was called */ in luaV_finishOp() local
512 int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ in luaV_finishOp()
513 setobj2s(L, top - 2, top); /* put TM result in proper position */ in luaV_finishOp()
515 L->top = top - 1; /* top is one after last element (at top-2) */ in luaV_finishOp()
519 setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1); in luaV_finishOp()
520 L->top = ci->top; /* restore top */ in luaV_finishOp()
525 L->top = ci->top; /* correct top */ in luaV_finishOp()
530 L->top = ci->top; /* adjust results */ in luaV_finishOp()
575 Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \
577 L->top = ci->top;}) /* restore top */ \
616 lua_assert(base <= L->top && L->top < L->stack + L->stacksize); in luaV_execute()
721 L->top = base + c + 1; /* mark the end of concat operands */ in luaV_execute()
727 L->top = ci->top; /* restore top */ in luaV_execute()
776 if (b != 0) L->top = ra+b; /* else previous instruction set top */ in luaV_execute()
778 if (nresults >= 0) L->top = ci->top; /* adjust results */ in luaV_execute()
789 if (b != 0) L->top = ra+b; /* else previous instruction set top */ in luaV_execute()
808 oci->top = L->top = ofunc + (L->top - nfunc); /* correct top */ in luaV_execute()
812 lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize); in luaV_execute()
818 if (b != 0) L->top = ra+b-1; in luaV_execute()
825 if (b) L->top = ci->top; in luaV_execute()
860 L->top = cb + 3; /* func. + 2 args (state and index) */ in luaV_execute()
862 L->top = ci->top; in luaV_execute()
880 if (n == 0) n = cast_int(L->top - ra) - 1; in luaV_execute()
895 L->top = ci->top; /* correct top (in case of previous open call) */ in luaV_execute()
914 L->top = ra + n; in luaV_execute()