Lines Matching refs:top

87     ci->func = L->top - 1;  /* protect stack below results */  in traceexec()
96 setobj2s(L, L->top++, f); /* push function */ in callTM()
97 setobj2s(L, L->top++, p1); /* 1st argument */ in callTM()
98 setobj2s(L, L->top++, p2); /* 2nd argument */ in callTM()
100 setobj2s(L, L->top++, p3); /* 3rd argument */ in callTM()
102 luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci)); in callTM()
105 setobjs2s(L, p3, --L->top); in callTM()
202 if (!call_binTM(L, p1, p2, L->top, event)) in call_orderTM()
205 return !l_isfalse(L->top); in call_orderTM()
288 callTM(L, tm, t1, t2, L->top, 1); /* call TM */ in luaV_equalobj_()
289 return !l_isfalse(L->top); in luaV_equalobj_()
296 StkId top = L->top; in luaV_concat() local
298 if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { in luaV_concat()
299 if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) in luaV_concat()
300 luaG_concaterror(L, top-2, top-1); in luaV_concat()
302 else if (tsvalue(top-1)->len == 0) /* second operand is empty? */ in luaV_concat()
303 (void)tostring(L, top - 2); /* result is first operand */ in luaV_concat()
304 else if (ttisstring(top-2) && tsvalue(top-2)->len == 0) { in luaV_concat()
305 setobjs2s(L, top - 2, top - 1); /* result is second op. */ in luaV_concat()
309 size_t tl = tsvalue(top-1)->len; in luaV_concat()
313 for (i = 1; i < total && tostring(L, top-i-1); i++) { in luaV_concat()
314 size_t l = tsvalue(top-i-1)->len; in luaV_concat()
323 size_t l = tsvalue(top-i)->len; in luaV_concat()
324 memcpy(buffer+tl, svalue(top-i), l * sizeof(char)); in luaV_concat()
327 setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); in luaV_concat()
330 L->top -= n-1; /* popped 'n' strings and pushed one */ in luaV_concat()
492 setobjs2s(L, base + GETARG_A(inst), --L->top); in luaV_finishOp()
496 int res = !l_isfalse(L->top - 1); in luaV_finishOp()
497 L->top--; in luaV_finishOp()
509 StkId top = L->top - 1; /* top when 'call_binTM' was called */ in luaV_finishOp() local
511 int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ in luaV_finishOp()
512 setobj2s(L, top - 2, top); /* put TM result in proper position */ in luaV_finishOp()
514 L->top = top - 1; /* top is one after last element (at top-2) */ in luaV_finishOp()
518 setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1); in luaV_finishOp()
519 L->top = ci->top; /* restore top */ in luaV_finishOp()
524 L->top = ci->top; /* correct top */ in luaV_finishOp()
529 L->top = ci->top; /* adjust results */ in luaV_finishOp()
574 Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \
576 L->top = ci->top;}) /* restore top */ \
615 lua_assert(base <= L->top && L->top < L->stack + L->stacksize); in luaV_execute()
720 L->top = base + c + 1; /* mark the end of concat operands */ in luaV_execute()
726 L->top = ci->top; /* restore top */ in luaV_execute()
775 if (b != 0) L->top = ra+b; /* else previous instruction set top */ in luaV_execute()
777 if (nresults >= 0) L->top = ci->top; /* adjust results */ in luaV_execute()
788 if (b != 0) L->top = ra+b; /* else previous instruction set top */ in luaV_execute()
807 oci->top = L->top = ofunc + (L->top - nfunc); /* correct top */ in luaV_execute()
811 lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize); in luaV_execute()
817 if (b != 0) L->top = ra+b-1; in luaV_execute()
824 if (b) L->top = ci->top; in luaV_execute()
859 L->top = cb + 3; /* func. + 2 args (state and index) */ in luaV_execute()
861 L->top = ci->top; in luaV_execute()
879 if (n == 0) n = cast_int(L->top - ra) - 1; in luaV_execute()
894 L->top = ci->top; /* correct top (in case of previous open call) */ in luaV_execute()
913 L->top = ra + n; in luaV_execute()