Lines Matching refs:level

69 static UpVal *newupval (lua_State *L, StkId level, UpVal **prev) {  in newupval()  argument
73 uv->v.p = s2v(level); /* current value lives in the stack */ in newupval()
91 UpVal *luaF_findupval (lua_State *L, StkId level) { in luaF_findupval() argument
95 while ((p = *pp) != NULL && uplevel(p) >= level) { /* search for it */ in luaF_findupval()
97 if (uplevel(p) == level) /* corresponding upvalue? */ in luaF_findupval()
102 return newupval(L, level, pp); in luaF_findupval()
129 static void checkclosemth (lua_State *L, StkId level) { in checkclosemth() argument
130 const TValue *tm = luaT_gettmbyobj(L, s2v(level), TM_CLOSE); in checkclosemth()
132 int idx = cast_int(level - L->ci->func.p); /* variable index */ in checkclosemth()
147 static void prepcallclosemth (lua_State *L, StkId level, int status, int yy) { in prepcallclosemth() argument
148 TValue *uv = s2v(level); /* value being closed */ in prepcallclosemth()
153 errobj = s2v(level + 1); /* error object goes after 'uv' */ in prepcallclosemth()
154 luaD_seterrorobj(L, status, level + 1); /* set error object */ in prepcallclosemth()
172 void luaF_newtbcupval (lua_State *L, StkId level) { in luaF_newtbcupval() argument
173 lua_assert(level > L->tbclist.p); in luaF_newtbcupval()
174 if (l_isfalse(s2v(level))) in luaF_newtbcupval()
176 checkclosemth(L, level); /* value must have a close method */ in luaF_newtbcupval()
177 while (cast_uint(level - L->tbclist.p) > MAXDELTA) { in luaF_newtbcupval()
181 level->tbclist.delta = cast(unsigned short, level - L->tbclist.p); in luaF_newtbcupval()
182 L->tbclist.p = level; in luaF_newtbcupval()
197 void luaF_closeupval (lua_State *L, StkId level) { in luaF_closeupval() argument
200 while ((uv = L->openupval) != NULL && (upl = uplevel(uv)) >= level) { in luaF_closeupval()
231 StkId luaF_close (lua_State *L, StkId level, int status, int yy) { in luaF_close() argument
232 ptrdiff_t levelrel = savestack(L, level); in luaF_close()
233 luaF_closeupval(L, level); /* first, close the upvalues */ in luaF_close()
234 while (L->tbclist.p >= level) { /* traverse tbc's down to that level */ in luaF_close()
238 level = restorestack(L, levelrel); in luaF_close()
240 return level; in luaF_close()