Lines Matching full:top
64 api_check(L, idx <= ci->top.p - (ci->func.p + 1), "unacceptable index"); in index2value()
65 if (o >= L->top.p) return &G(L)->nilvalue; in index2value()
69 api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1), in index2value()
71 return s2v(L->top.p + idx); in index2value()
99 api_check(L, o < L->top.p, "invalid index"); in index2stack()
103 api_check(L, idx != 0 && -idx <= L->top.p - (ci->func.p + 1), in index2stack()
106 return L->top.p + idx; in index2stack()
117 if (L->stack_last.p - L->top.p > n) /* stack large enough? */ in lua_checkstack()
121 if (res && ci->top.p < L->top.p + n) in lua_checkstack()
122 ci->top.p = L->top.p + n; /* adjust frame top */ in lua_checkstack()
134 api_check(from, to->ci->top.p - to->top.p >= n, "stack overflow"); in lua_xmove()
135 from->top.p -= n; in lua_xmove()
137 setobjs2s(to, to->top.p, from->top.p + i); in lua_xmove()
138 to->top.p++; /* stack already checked by previous 'api_check' */ in lua_xmove()
172 : cast_int(L->top.p - L->ci->func.p) + idx; in lua_absindex()
177 return cast_int(L->top.p - (L->ci->func.p + 1)); in lua_gettop()
184 ptrdiff_t diff; /* difference for new top */ in lua_settop()
189 api_check(L, idx <= ci->top.p - (func + 1), "new top too large"); in lua_settop()
190 diff = ((func + 1) + idx) - L->top.p; in lua_settop()
192 setnilvalue(s2v(L->top.p++)); /* clear new slots */ in lua_settop()
195 api_check(L, -(idx+1) <= (L->top.p - (func + 1)), "invalid new top"); in lua_settop()
198 api_check(L, L->tbclist.p < L->top.p, "previous pop of an unclosed slot"); in lua_settop()
199 newtop = L->top.p + diff; in lua_settop()
204 L->top.p = newtop; /* correct top only after closing any upvalue */ in lua_settop()
244 t = L->top.p - 1; /* end of stack segment being rotated */ in lua_rotate()
272 setobj2s(L, L->top.p, index2value(L, idx)); in lua_pushvalue()
341 setobjs2s(L, L->top.p, L->top.p - 1); in lua_arith()
344 /* first operand at top - 2, second at top - 1; result go to top - 2 */ in lua_arith()
345 luaO_arith(L, op, s2v(L->top.p - 2), s2v(L->top.p - 1), L->top.p - 2); in lua_arith()
346 L->top.p--; /* remove second operand */ in lua_arith()
372 size_t sz = luaO_str2num(s, s2v(L->top.p)); in lua_stringtonumber()
499 setnilvalue(s2v(L->top.p)); in lua_pushnil()
507 setfltvalue(s2v(L->top.p), n); in lua_pushnumber()
515 setivalue(s2v(L->top.p), n); in lua_pushinteger()
530 setsvalue2s(L, L->top.p, ts); in lua_pushlstring()
541 setnilvalue(s2v(L->top.p)); in lua_pushstring()
545 setsvalue2s(L, L->top.p, ts); in lua_pushstring()
582 setfvalue(s2v(L->top.p), fn); in lua_pushcclosure()
591 L->top.p -= n; in lua_pushcclosure()
593 setobj2n(L, &cl->upvalue[n], s2v(L->top.p + n)); in lua_pushcclosure()
597 setclCvalue(L, s2v(L->top.p), cl); in lua_pushcclosure()
608 setbtvalue(s2v(L->top.p)); in lua_pushboolean()
610 setbfvalue(s2v(L->top.p)); in lua_pushboolean()
618 setpvalue(s2v(L->top.p), p); in lua_pushlightuserdata()
626 setthvalue(L, s2v(L->top.p), L); in lua_pushthread()
643 setobj2s(L, L->top.p, slot); in auxgetstr()
647 setsvalue2s(L, L->top.p, str); in auxgetstr()
649 luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot); in auxgetstr()
652 return ttype(s2v(L->top.p - 1)); in auxgetstr()
679 if (luaV_fastget(L, t, s2v(L->top.p - 1), slot, luaH_get)) { in lua_gettable()
680 setobj2s(L, L->top.p - 1, slot); in lua_gettable()
683 luaV_finishget(L, t, s2v(L->top.p - 1), L->top.p - 1, slot); in lua_gettable()
685 return ttype(s2v(L->top.p - 1)); in lua_gettable()
701 setobj2s(L, L->top.p, slot); in lua_geti()
706 luaV_finishget(L, t, &aux, L->top.p, slot); in lua_geti()
710 return ttype(s2v(L->top.p - 1)); in lua_geti()
716 setnilvalue(s2v(L->top.p)); in finishrawget()
718 setobj2s(L, L->top.p, val); in finishrawget()
721 return ttype(s2v(L->top.p - 1)); in finishrawget()
738 val = luaH_get(t, s2v(L->top.p - 1)); in lua_rawget()
739 L->top.p--; /* remove key */ in lua_rawget()
766 sethvalue2s(L, L->top.p, t); in lua_createtable()
793 sethvalue2s(L, L->top.p, mt); in lua_getmetatable()
809 setnilvalue(s2v(L->top.p)); in lua_getiuservalue()
813 setobj2s(L, L->top.p, &uvalue(o)->uv[n - 1].uv); in lua_getiuservalue()
814 t = ttype(s2v(L->top.p)); in lua_getiuservalue()
827 ** t[k] = value at the top of the stack (where 'k' is a string)
834 luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); in auxsetstr()
835 L->top.p--; /* pop value */ in auxsetstr()
838 setsvalue2s(L, L->top.p, str); /* push 'str' (to make it a TValue) */ in auxsetstr()
840 luaV_finishset(L, t, s2v(L->top.p - 1), s2v(L->top.p - 2), slot); in auxsetstr()
841 L->top.p -= 2; /* pop value and key */ in auxsetstr()
861 if (luaV_fastget(L, t, s2v(L->top.p - 2), slot, luaH_get)) { in lua_settable()
862 luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); in lua_settable()
865 luaV_finishset(L, t, s2v(L->top.p - 2), s2v(L->top.p - 1), slot); in lua_settable()
866 L->top.p -= 2; /* pop index and value */ in lua_settable()
884 luaV_finishfastset(L, t, slot, s2v(L->top.p - 1)); in lua_seti()
889 luaV_finishset(L, t, &aux, s2v(L->top.p - 1), slot); in lua_seti()
891 L->top.p--; /* pop value */ in lua_seti()
901 luaH_set(L, t, key, s2v(L->top.p - 1)); in aux_rawset()
903 luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1)); in aux_rawset()
904 L->top.p -= n; in aux_rawset()
910 aux_rawset(L, idx, s2v(L->top.p - 2), 2); in lua_rawset()
926 luaH_setint(L, t, n, s2v(L->top.p - 1)); in lua_rawseti()
927 luaC_barrierback(L, obj2gco(t), s2v(L->top.p - 1)); in lua_rawseti()
928 L->top.p--; in lua_rawseti()
939 if (ttisnil(s2v(L->top.p - 1))) in lua_setmetatable()
942 api_check(L, ttistable(s2v(L->top.p - 1)), "table expected"); in lua_setmetatable()
943 mt = hvalue(s2v(L->top.p - 1)); in lua_setmetatable()
967 L->top.p--; in lua_setmetatable()
983 setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top.p - 1)); in lua_setiuservalue()
984 luaC_barrierback(L, gcvalue(o), s2v(L->top.p - 1)); in lua_setiuservalue()
987 L->top.p--; in lua_setiuservalue()
1000 || (L->ci->top.p - L->top.p >= (nr) - (na)), \
1013 func = L->top.p - (nargs+1); in lua_callk()
1061 c.func = L->top.p - (nargs+1); /* function to be called */ in lua_pcallk()
1096 LClosure *f = clLvalue(s2v(L->top.p - 1)); /* get new function */ in lua_load()
1115 o = s2v(L->top.p - 1); in lua_dump()
1241 errobj = s2v(L->top.p - 1); in lua_error()
1259 more = luaH_next(L, t, L->top.p - 1); in lua_next()
1264 L->top.p -= 1; /* remove key */ in lua_next()
1291 setsvalue2s(L, L->top.p, luaS_newlstr(L, "", 0)); /* push empty string */ in lua_concat()
1303 luaV_objlen(L, L->top.p, t); in lua_len()
1348 setuvalue(L, s2v(L->top.p), u); in lua_newuserdatauv()
1390 setobj2s(L, L->top.p, val); in lua_getupvalue()
1408 L->top.p--; in lua_setupvalue()
1409 setobj(L, val, s2v(L->top.p)); in lua_setupvalue()