Lines Matching refs:top

41 #define api_checknelems(L, n)	api_check(L, (n) <= (L->top - L->base))
45 #define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;}
52 api_check(L, idx <= L->ci->top - L->base); in index2adr()
53 if (o >= L->top) return cast(TValue *, luaO_nilobject); in index2adr()
57 api_check(L, idx != 0 && -idx <= L->top - L->base); in index2adr()
58 return L->top + idx; in index2adr()
90 setobj2s(L, L->top, o); in luaA_pushobject()
98 if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) in lua_checkstack()
102 if (L->ci->top < L->top + size) in lua_checkstack()
103 L->ci->top = L->top + size; in lua_checkstack()
116 api_check(from, to->ci->top - to->top >= n); in lua_xmove()
117 from->top -= n; in lua_xmove()
119 setobj2s(to, to->top++, from->top + i); in lua_xmove()
145 setthvalue(L, L->top, L1); in lua_newthread()
160 return cast_int(L->top - L->base); in lua_gettop()
168 while (L->top < L->base + idx) in lua_settop()
169 setnilvalue(L->top++); in lua_settop()
170 L->top = L->base + idx; in lua_settop()
173 api_check(L, -(idx+1) <= (L->top - L->base)); in lua_settop()
174 L->top += idx+1; /* `subtract' index (index is negative) */ in lua_settop()
185 while (++p < L->top) setobjs2s(L, p-1, p); in lua_remove()
186 L->top--; in lua_remove()
197 for (q = L->top; q>p; q--) setobjs2s(L, q, q-1); in lua_insert()
198 setobjs2s(L, p, L->top); in lua_insert()
214 api_check(L, ttistable(L->top - 1)); in lua_replace()
215 func->c.env = hvalue(L->top - 1); in lua_replace()
216 luaC_barrier(L, func, L->top - 1); in lua_replace()
219 setobj(L, o, L->top - 1); in lua_replace()
221 luaC_barrier(L, curr_func(L), L->top - 1); in lua_replace()
223 L->top--; in lua_replace()
230 setobj2s(L, L->top, index2adr(L, idx)); in lua_pushvalue()
423 setnilvalue(L->top); in lua_pushnil()
431 setnvalue(L->top, n); in lua_pushnumber()
439 setnvalue(L->top, cast_num(n)); in lua_pushinteger()
448 setsvalue2s(L, L->top, luaS_newlstr(L, s, len)); in lua_pushlstring()
493 L->top -= n; in lua_pushcclosure()
495 setobj2n(L, &cl->c.upvalue[n], L->top+n); in lua_pushcclosure()
496 setclvalue(L, L->top, cl); in lua_pushcclosure()
505 setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ in lua_pushboolean()
513 setpvalue(L->top, p); in lua_pushlightuserdata()
521 setthvalue(L, L->top, L); in lua_pushthread()
539 luaV_gettable(L, t, L->top - 1, L->top - 1); in lua_gettable()
551 luaV_gettable(L, t, &key, L->top); in lua_getfield()
562 setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); in lua_rawget()
572 setobj2s(L, L->top, luaH_getnum(hvalue(o), n)); in lua_rawgeti()
581 sethvalue(L, L->top, luaH_new(L, narray, nrec)); in lua_createtable()
607 sethvalue(L, L->top, mt); in lua_getmetatable()
623 sethvalue(L, L->top, clvalue(o)->c.env); in lua_getfenv()
626 sethvalue(L, L->top, uvalue(o)->env); in lua_getfenv()
629 setobj2s(L, L->top, gt(thvalue(o))); in lua_getfenv()
632 setnilvalue(L->top); in lua_getfenv()
651 luaV_settable(L, t, L->top - 2, L->top - 1); in lua_settable()
652 L->top -= 2; /* pop index and value */ in lua_settable()
665 luaV_settable(L, t, &key, L->top - 1); in lua_setfield()
666 L->top--; /* pop value */ in lua_setfield()
677 setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); in lua_rawset()
678 luaC_barriert(L, hvalue(t), L->top-1); in lua_rawset()
679 L->top -= 2; in lua_rawset()
690 setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1); in lua_rawseti()
691 luaC_barriert(L, hvalue(o), L->top-1); in lua_rawseti()
692 L->top--; in lua_rawseti()
704 if (ttisnil(L->top - 1)) in lua_setmetatable()
707 api_check(L, ttistable(L->top - 1)); in lua_setmetatable()
708 mt = hvalue(L->top - 1); in lua_setmetatable()
728 L->top--; in lua_setmetatable()
741 api_check(L, ttistable(L->top - 1)); in lua_setfenv()
744 clvalue(o)->c.env = hvalue(L->top - 1); in lua_setfenv()
747 uvalue(o)->env = hvalue(L->top - 1); in lua_setfenv()
750 sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1)); in lua_setfenv()
756 if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); in lua_setfenv()
757 L->top--; in lua_setfenv()
769 { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; }
773 api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)))
781 func = L->top - (nargs+1); in lua_call()
819 c.func = L->top - (nargs+1); /* function to be called */ in lua_pcall()
842 setclvalue(L, L->top, cl); /* push function */ in f_Ccall()
844 setpvalue(L->top, c->ud); /* push only argument */ in f_Ccall()
846 luaD_call(L, L->top - 2, 0); in f_Ccall()
856 status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0); in lua_cpcall()
880 o = L->top - 1; in lua_dump()
979 more = luaH_next(L, hvalue(t), L->top - 1); in lua_next()
984 L->top -= 1; /* remove key */ in lua_next()
995 luaV_concat(L, n, cast_int(L->top - L->base) - 1); in lua_concat()
996 L->top -= (n-1); in lua_concat()
999 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); in lua_concat()
1030 setuvalue(L, L->top, u); in lua_newuserdata()
1063 setobj2s(L, L->top, val); in lua_getupvalue()
1080 L->top--; in lua_setupvalue()
1081 setobj(L, val, L->top); in lua_setupvalue()
1082 luaC_barrier(L, clvalue(fi), L->top); in lua_setupvalue()