Lines Matching full:top
64 api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index"); in index2addr()
65 if (o >= L->top) return NONVALIDVALUE; in index2addr()
69 api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); in index2addr()
70 return L->top + idx; in index2addr()
102 if (L->stack_last - L->top > n) /* stack large enough? */ in lua_checkstack()
105 int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; in lua_checkstack()
111 if (res && ci->top < L->top + n) in lua_checkstack()
112 ci->top = L->top + n; /* adjust frame top */ in lua_checkstack()
124 api_check(from, to->ci->top - to->top >= n, "stack overflow"); in lua_xmove()
125 from->top -= n; in lua_xmove()
127 setobj2s(to, to->top, from->top + i); in lua_xmove()
128 to->top++; /* stack already checked by previous 'api_check' */ in lua_xmove()
163 : cast_int(L->top - L->ci->func) + idx; in lua_absindex()
168 return cast_int(L->top - (L->ci->func + 1)); in lua_gettop()
176 api_check(L, idx <= L->stack_last - (func + 1), "new top too large"); in lua_settop()
177 while (L->top < (func + 1) + idx) in lua_settop()
178 setnilvalue(L->top++); in lua_settop()
179 L->top = (func + 1) + idx; in lua_settop()
182 api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); in lua_settop()
183 L->top += idx+1; /* 'subtract' index (index is negative) */ in lua_settop()
210 t = L->top - 1; /* end of stack segment being rotated */ in lua_rotate()
239 setobj2s(L, L->top, index2addr(L, idx)); in lua_pushvalue()
308 setobjs2s(L, L->top, L->top - 1); in lua_arith()
311 /* first operand at top - 2, second at top - 1; result go to top - 2 */ in lua_arith()
312 luaO_arith(L, op, L->top - 2, L->top - 1, L->top - 2); in lua_arith()
313 L->top--; /* remove second operand */ in lua_arith()
338 size_t sz = luaO_str2num(s, L->top); in lua_stringtonumber()
452 setnilvalue(L->top); in lua_pushnil()
460 setfltvalue(L->top, n); in lua_pushnumber()
468 setivalue(L->top, n); in lua_pushinteger()
483 setsvalue2s(L, L->top, ts); in lua_pushlstring()
494 setnilvalue(L->top); in lua_pushstring()
498 setsvalue2s(L, L->top, ts); in lua_pushstring()
535 setfvalue(L->top, fn); in lua_pushcclosure()
544 L->top -= n; in lua_pushcclosure()
546 setobj2n(L, &cl->upvalue[n], L->top + n); in lua_pushcclosure()
549 setclCvalue(L, L->top, cl); in lua_pushcclosure()
559 setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ in lua_pushboolean()
567 setpvalue(L->top, p); in lua_pushlightuserdata()
575 setthvalue(L, L->top, L); in lua_pushthread()
592 setobj2s(L, L->top, slot); in auxgetstr()
596 setsvalue2s(L, L->top, str); in auxgetstr()
598 luaV_finishget(L, t, L->top - 1, L->top - 1, slot); in auxgetstr()
601 return ttnov(L->top - 1); in auxgetstr()
616 luaV_gettable(L, t, L->top - 1, L->top - 1); in lua_gettable()
618 return ttnov(L->top - 1); in lua_gettable()
634 setobj2s(L, L->top, slot); in lua_geti()
638 setivalue(L->top, n); in lua_geti()
640 luaV_finishget(L, t, L->top - 1, L->top - 1, slot); in lua_geti()
643 return ttnov(L->top - 1); in lua_geti()
652 setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); in lua_rawget()
654 return ttnov(L->top - 1); in lua_rawget()
663 setobj2s(L, L->top, luaH_getint(hvalue(t), n)); in lua_rawgeti()
666 return ttnov(L->top - 1); in lua_rawgeti()
677 setobj2s(L, L->top, luaH_get(hvalue(t), &k)); in lua_rawgetp()
680 return ttnov(L->top - 1); in lua_rawgetp()
688 sethvalue(L, L->top, t); in lua_createtable()
715 sethvalue(L, L->top, mt); in lua_getmetatable()
729 getuservalue(L, uvalue(o), L->top); in lua_getuservalue()
732 return ttnov(L->top - 1); in lua_getuservalue()
741 ** t[k] = value at the top of the stack (where 'k' is a string)
747 if (luaV_fastset(L, t, str, slot, luaH_getstr, L->top - 1)) in auxsetstr()
748 L->top--; /* pop value */ in auxsetstr()
750 setsvalue2s(L, L->top, str); /* push 'str' (to make it a TValue) */ in auxsetstr()
752 luaV_finishset(L, t, L->top - 1, L->top - 2, slot); in auxsetstr()
753 L->top -= 2; /* pop value and key */ in auxsetstr()
771 luaV_settable(L, t, L->top - 2, L->top - 1); in lua_settable()
772 L->top -= 2; /* pop index and value */ in lua_settable()
789 if (luaV_fastset(L, t, n, slot, luaH_getint, L->top - 1)) in lua_seti()
790 L->top--; /* pop value */ in lua_seti()
792 setivalue(L->top, n); in lua_seti()
794 luaV_finishset(L, t, L->top - 1, L->top - 2, slot); in lua_seti()
795 L->top -= 2; /* pop value and key */ in lua_seti()
808 slot = luaH_set(L, hvalue(o), L->top - 2); in lua_rawset()
809 setobj2t(L, slot, L->top - 1); in lua_rawset()
811 luaC_barrierback(L, hvalue(o), L->top-1); in lua_rawset()
812 L->top -= 2; in lua_rawset()
823 luaH_setint(L, hvalue(o), n, L->top - 1); in lua_rawseti()
824 luaC_barrierback(L, hvalue(o), L->top-1); in lua_rawseti()
825 L->top--; in lua_rawseti()
839 setobj2t(L, slot, L->top - 1); in lua_rawsetp()
840 luaC_barrierback(L, hvalue(o), L->top - 1); in lua_rawsetp()
841 L->top--; in lua_rawsetp()
852 if (ttisnil(L->top - 1)) in lua_setmetatable()
855 api_check(L, ttistable(L->top - 1), "table expected"); in lua_setmetatable()
856 mt = hvalue(L->top - 1); in lua_setmetatable()
880 L->top--; in lua_setmetatable()
892 setuservalue(L, uvalue(o), L->top - 1); in lua_setuservalue()
893 luaC_barrier(L, gcvalue(o), L->top - 1); in lua_setuservalue()
894 L->top--; in lua_setuservalue()
905 api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \
918 func = L->top - (nargs+1); in lua_callk()
966 c.func = L->top - (nargs+1); /* function to be called */ in lua_pcallk()
1001 LClosure *f = clLvalue(L->top - 1); /* get newly created function */ in lua_load()
1021 o = L->top - 1; in lua_dump()
1129 more = luaH_next(L, hvalue(t), L->top - 1); in lua_next()
1134 L->top -= 1; /* remove key */ in lua_next()
1147 setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); in lua_concat()
1160 luaV_objlen(L, L->top, t); in lua_len()
1188 setuvalue(L, L->top, u); in lua_newuserdata()
1228 setobj2s(L, L->top, val); in lua_getupvalue()
1247 L->top--; in lua_setupvalue()
1248 setobj(L, val, L->top); in lua_setupvalue()
1249 if (owner) { luaC_barrier(L, owner, L->top); } in lua_setupvalue()