Lines Matching full:top

60     api_check(L, idx <= L->ci->top - (ci->func + 1), "unacceptable index");  in index2value()
61 if (o >= L->top) return &G(L)->nilvalue; in index2value()
65 api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); in index2value()
66 return s2v(L->top + idx); in index2value()
87 api_check(L, o < L->top, "unacceptable index"); in index2stack()
91 api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); in index2stack()
93 return L->top + idx; in index2stack()
104 if (L->stack_last - L->top > n) /* stack large enough? */ in lua_checkstack()
107 int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; in lua_checkstack()
113 if (res && ci->top < L->top + n) in lua_checkstack()
114 ci->top = L->top + n; /* adjust frame top */ in lua_checkstack()
126 api_check(from, to->ci->top - to->top >= n, "stack overflow"); in lua_xmove()
127 from->top -= n; in lua_xmove()
129 setobjs2s(to, to->top, from->top + i); in lua_xmove()
130 to->top++; /* stack already checked by previous 'api_check' */ in lua_xmove()
164 : cast_int(L->top - L->ci->func) + idx; in lua_absindex()
169 return cast_int(L->top - (L->ci->func + 1)); in lua_gettop()
176 ptrdiff_t diff; /* difference for new top */ in lua_settop()
181 api_check(L, idx <= ci->top - (func + 1), "new top too large"); in lua_settop()
182 diff = ((func + 1) + idx) - L->top; in lua_settop()
184 setnilvalue(s2v(L->top++)); /* clear new slots */ in lua_settop()
187 api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); in lua_settop()
191 luaF_close(L, L->top + diff, LUA_OK); in lua_settop()
192 L->top += diff; /* correct top only after closing any upvalue */ in lua_settop()
220 t = L->top - 1; /* end of stack segment being rotated */ in lua_rotate()
248 setobj2s(L, L->top, index2value(L, idx)); in lua_pushvalue()
317 setobjs2s(L, L->top, L->top - 1); in lua_arith()
320 /* first operand at top - 2, second at top - 1; result go to top - 2 */ in lua_arith()
321 luaO_arith(L, op, s2v(L->top - 2), s2v(L->top - 1), L->top - 2); in lua_arith()
322 L->top--; /* remove second operand */ in lua_arith()
348 size_t sz = luaO_str2num(s, s2v(L->top)); in lua_stringtonumber()
475 setnilvalue(s2v(L->top)); in lua_pushnil()
483 setfltvalue(s2v(L->top), n); in lua_pushnumber()
491 setivalue(s2v(L->top), n); in lua_pushinteger()
506 setsvalue2s(L, L->top, ts); in lua_pushlstring()
517 setnilvalue(s2v(L->top)); in lua_pushstring()
521 setsvalue2s(L, L->top, ts); in lua_pushstring()
558 setfvalue(s2v(L->top), fn); in lua_pushcclosure()
567 L->top -= n; in lua_pushcclosure()
569 setobj2n(L, &cl->upvalue[n], s2v(L->top + n)); in lua_pushcclosure()
573 setclCvalue(L, s2v(L->top), cl); in lua_pushcclosure()
584 setbtvalue(s2v(L->top)); in lua_pushboolean()
586 setbfvalue(s2v(L->top)); in lua_pushboolean()
594 setpvalue(s2v(L->top), p); in lua_pushlightuserdata()
602 setthvalue(L, s2v(L->top), L); in lua_pushthread()
619 setobj2s(L, L->top, slot); in auxgetstr()
623 setsvalue2s(L, L->top, str); in auxgetstr()
625 luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot); in auxgetstr()
628 return ttype(s2v(L->top - 1)); in auxgetstr()
645 if (luaV_fastget(L, t, s2v(L->top - 1), slot, luaH_get)) { in lua_gettable()
646 setobj2s(L, L->top - 1, slot); in lua_gettable()
649 luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot); in lua_gettable()
651 return ttype(s2v(L->top - 1)); in lua_gettable()
667 setobj2s(L, L->top, slot); in lua_geti()
672 luaV_finishget(L, t, &aux, L->top, slot); in lua_geti()
676 return ttype(s2v(L->top - 1)); in lua_geti()
682 setnilvalue(s2v(L->top)); in finishrawget()
684 setobj2s(L, L->top, val); in finishrawget()
687 return ttype(s2v(L->top - 1)); in finishrawget()
704 val = luaH_get(t, s2v(L->top - 1)); in lua_rawget()
705 L->top--; /* remove key */ in lua_rawget()
732 sethvalue2s(L, L->top, t); in lua_createtable()
759 sethvalue2s(L, L->top, mt); in lua_getmetatable()
775 setnilvalue(s2v(L->top)); in lua_getiuservalue()
779 setobj2s(L, L->top, &uvalue(o)->uv[n - 1].uv); in lua_getiuservalue()
780 t = ttype(s2v(L->top)); in lua_getiuservalue()
793 ** t[k] = value at the top of the stack (where 'k' is a string)
800 luaV_finishfastset(L, t, slot, s2v(L->top - 1)); in auxsetstr()
801 L->top--; /* pop value */ in auxsetstr()
804 setsvalue2s(L, L->top, str); /* push 'str' (to make it a TValue) */ in auxsetstr()
806 luaV_finishset(L, t, s2v(L->top - 1), s2v(L->top - 2), slot); in auxsetstr()
807 L->top -= 2; /* pop value and key */ in auxsetstr()
827 if (luaV_fastget(L, t, s2v(L->top - 2), slot, luaH_get)) { in lua_settable()
828 luaV_finishfastset(L, t, slot, s2v(L->top - 1)); in lua_settable()
831 luaV_finishset(L, t, s2v(L->top - 2), s2v(L->top - 1), slot); in lua_settable()
832 L->top -= 2; /* pop index and value */ in lua_settable()
850 luaV_finishfastset(L, t, slot, s2v(L->top - 1)); in lua_seti()
855 luaV_finishset(L, t, &aux, s2v(L->top - 1), slot); in lua_seti()
857 L->top--; /* pop value */ in lua_seti()
869 setobj2t(L, slot, s2v(L->top - 1)); in aux_rawset()
871 luaC_barrierback(L, obj2gco(t), s2v(L->top - 1)); in aux_rawset()
872 L->top -= n; in aux_rawset()
878 aux_rawset(L, idx, s2v(L->top - 2), 2); in lua_rawset()
894 luaH_setint(L, t, n, s2v(L->top - 1)); in lua_rawseti()
895 luaC_barrierback(L, obj2gco(t), s2v(L->top - 1)); in lua_rawseti()
896 L->top--; in lua_rawseti()
907 if (ttisnil(s2v(L->top - 1))) in lua_setmetatable()
910 api_check(L, ttistable(s2v(L->top - 1)), "table expected"); in lua_setmetatable()
911 mt = hvalue(s2v(L->top - 1)); in lua_setmetatable()
935 L->top--; in lua_setmetatable()
951 setobj(L, &uvalue(o)->uv[n - 1].uv, s2v(L->top - 1)); in lua_setiuservalue()
952 luaC_barrierback(L, gcvalue(o), s2v(L->top - 1)); in lua_setiuservalue()
955 L->top--; in lua_setiuservalue()
967 api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
980 func = L->top - (nargs+1); in lua_callk()
1028 c.func = L->top - (nargs+1); /* function to be called */ in lua_pcallk()
1063 LClosure *f = clLvalue(s2v(L->top - 1)); /* get newly created function */ in lua_load()
1083 o = s2v(L->top - 1); in lua_dump()
1208 errobj = s2v(L->top - 1); in lua_error()
1226 more = luaH_next(L, t, L->top - 1); in lua_next()
1231 L->top -= 1; /* remove key */ in lua_next()
1259 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); /* push empty string */ in lua_concat()
1271 luaV_objlen(L, L->top, t); in lua_len()
1316 setuvalue(L, s2v(L->top), u); in lua_newuserdatauv()
1358 setobj2s(L, L->top, val); in lua_getupvalue()
1376 L->top--; in lua_setupvalue()
1377 setobj(L, val, s2v(L->top)); in lua_setupvalue()