Lines Matching full:top
55 api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index"); in index2addr()
56 if (o >= L->top) return NONVALIDVALUE; in index2addr()
60 api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); in index2addr()
61 return L->top + idx; in index2addr()
92 if (L->stack_last - L->top > size) /* stack large enough? */ in lua_checkstack()
95 int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; in lua_checkstack()
101 if (res && ci->top < L->top + size) in lua_checkstack()
102 ci->top = L->top + size; /* adjust frame top */ in lua_checkstack()
114 api_check(from, to->ci->top - to->top >= n, "not enough elements to move"); in lua_xmove()
115 from->top -= n; in lua_xmove()
117 setobj2s(to, to->top++, from->top + i); in lua_xmove()
152 : cast_int(L->top - L->ci->func + idx); in lua_absindex()
157 return cast_int(L->top - (L->ci->func + 1)); in lua_gettop()
165 api_check(L, idx <= L->stack_last - (func + 1), "new top too large"); in lua_settop()
166 while (L->top < (func + 1) + idx) in lua_settop()
167 setnilvalue(L->top++); in lua_settop()
168 L->top = (func + 1) + idx; in lua_settop()
171 api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); in lua_settop()
172 L->top += idx+1; /* `subtract' index (index is negative) */ in lua_settop()
183 while (++p < L->top) setobjs2s(L, p-1, p); in lua_remove()
184 L->top--; in lua_remove()
195 for (q = L->top; q > p; q--) /* use L->top as a temporary */ in lua_insert()
197 setobjs2s(L, p, L->top); in lua_insert()
216 moveto(L, L->top - 1, idx); in lua_replace()
217 L->top--; in lua_replace()
233 setobj2s(L, L->top, index2addr(L, idx)); in lua_pushvalue()
299 setobjs2s(L, L->top, L->top - 1); in lua_arith()
300 L->top++; in lua_arith()
302 o1 = L->top - 2; in lua_arith()
303 o2 = L->top - 1; in lua_arith()
309 L->top--; in lua_arith()
465 setnilvalue(L->top); in lua_pushnil()
473 setnvalue(L->top, n); in lua_pushnumber()
474 luai_checknum(L, L->top, in lua_pushnumber()
483 setnvalue(L->top, cast_num(n)); in lua_pushinteger()
493 setnvalue(L->top, n); in lua_pushunsigned()
504 setsvalue2s(L, L->top, ts); in lua_pushlstring()
521 setsvalue2s(L, L->top, ts); in lua_pushstring()
556 setfvalue(L->top, fn); in lua_pushcclosure()
565 L->top -= n; in lua_pushcclosure()
567 setobj2n(L, &cl->c.upvalue[n], L->top + n); in lua_pushcclosure()
568 setclCvalue(L, L->top, cl); in lua_pushcclosure()
577 setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ in lua_pushboolean()
585 setpvalue(L->top, p); in lua_pushlightuserdata()
593 setthvalue(L, L->top, L); in lua_pushthread()
611 setsvalue2s(L, L->top++, luaS_new(L, var)); in lua_getglobal()
612 luaV_gettable(L, gt, L->top - 1, L->top - 1); in lua_getglobal()
621 luaV_gettable(L, t, L->top - 1, L->top - 1); in lua_gettable()
630 setsvalue2s(L, L->top, luaS_new(L, k)); in lua_getfield()
632 luaV_gettable(L, t, L->top - 1, L->top - 1); in lua_getfield()
642 setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); in lua_rawget()
652 setobj2s(L, L->top, luaH_getint(hvalue(t), n)); in lua_rawgeti()
665 setobj2s(L, L->top, luaH_get(hvalue(t), &k)); in lua_rawgetp()
676 sethvalue(L, L->top, t); in lua_createtable()
704 sethvalue(L, L->top, mt); in lua_getmetatable()
719 sethvalue(L, L->top, uvalue(o)->env); in lua_getuservalue()
721 setnilvalue(L->top); in lua_getuservalue()
738 setsvalue2s(L, L->top++, luaS_new(L, var)); in lua_setglobal()
739 luaV_settable(L, gt, L->top - 1, L->top - 2); in lua_setglobal()
740 L->top -= 2; /* pop value and key */ in lua_setglobal()
750 luaV_settable(L, t, L->top - 2, L->top - 1); in lua_settable()
751 L->top -= 2; /* pop index and value */ in lua_settable()
761 setsvalue2s(L, L->top++, luaS_new(L, k)); in lua_setfield()
762 luaV_settable(L, t, L->top - 1, L->top - 2); in lua_setfield()
763 L->top -= 2; /* pop value and key */ in lua_setfield()
774 setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); in lua_rawset()
776 luaC_barrierback(L, gcvalue(t), L->top-1); in lua_rawset()
777 L->top -= 2; in lua_rawset()
788 luaH_setint(L, hvalue(t), n, L->top - 1); in lua_rawseti()
789 luaC_barrierback(L, gcvalue(t), L->top-1); in lua_rawseti()
790 L->top--; in lua_rawseti()
803 setobj2t(L, luaH_set(L, hvalue(t), &k), L->top - 1); in lua_rawsetp()
804 luaC_barrierback(L, gcvalue(t), L->top - 1); in lua_rawsetp()
805 L->top--; in lua_rawsetp()
816 if (ttisnil(L->top - 1)) in lua_setmetatable()
819 api_check(L, ttistable(L->top - 1), "table expected"); in lua_setmetatable()
820 mt = hvalue(L->top - 1); in lua_setmetatable()
844 L->top--; in lua_setmetatable()
856 if (ttisnil(L->top - 1)) in lua_setuservalue()
859 api_check(L, ttistable(L->top - 1), "table expected"); in lua_setuservalue()
860 uvalue(o)->env = hvalue(L->top - 1); in lua_setuservalue()
861 luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); in lua_setuservalue()
863 L->top--; in lua_setuservalue()
874 api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
896 func = L->top - (nargs+1); in lua_callk()
944 c.func = L->top - (nargs+1); /* function to be called */ in lua_pcallk()
980 LClosure *f = clLvalue(L->top - 1); /* get newly created function */ in lua_load()
1000 o = L->top - 1; in lua_dump()
1118 more = luaH_next(L, hvalue(t), L->top - 1); in lua_next()
1123 L->top -= 1; /* remove key */ in lua_next()
1137 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); in lua_concat()
1149 luaV_objlen(L, L->top, t); in lua_len()
1178 setuvalue(L, L->top, u); in lua_newuserdata()
1217 setobj2s(L, L->top, val); in lua_getupvalue()
1235 L->top--; in lua_setupvalue()
1236 setobj(L, val, L->top); in lua_setupvalue()
1237 luaC_barrier(L, owner, L->top); in lua_setupvalue()