Lines Matching refs:o

144 #define luai_apicheck(L,o){(void)L;}  argument
234 #define ttisnil(o)(ttype(o)==0) argument
235 #define ttisnumber(o)(ttype(o)==3) argument
236 #define ttisstring(o)(ttype(o)==4) argument
237 #define ttistable(o)(ttype(o)==5) argument
238 #define ttisfunction(o)(ttype(o)==6) argument
239 #define ttisboolean(o)(ttype(o)==1) argument
240 #define ttisuserdata(o)(ttype(o)==7) argument
241 #define ttisthread(o)(ttype(o)==8) argument
242 #define ttislightuserdata(o)(ttype(o)==2) argument
243 #define ttype(o)((o)->tt) argument
244 #define gcvalue(o)check_exp(iscollectable(o),(o)->value.gc) argument
245 #define pvalue(o)check_exp(ttislightuserdata(o),(o)->value.p) argument
246 #define nvalue(o)check_exp(ttisnumber(o),(o)->value.n) argument
247 #define rawtsvalue(o)check_exp(ttisstring(o),&(o)->value.gc->ts) argument
248 #define tsvalue(o)(&rawtsvalue(o)->tsv) argument
249 #define rawuvalue(o)check_exp(ttisuserdata(o),&(o)->value.gc->u) argument
250 #define uvalue(o)(&rawuvalue(o)->uv) argument
251 #define clvalue(o)check_exp(ttisfunction(o),&(o)->value.gc->cl) argument
252 #define hvalue(o)check_exp(ttistable(o),&(o)->value.gc->h) argument
253 #define bvalue(o)check_exp(ttisboolean(o),(o)->value.b) argument
254 #define thvalue(o)check_exp(ttisthread(o),&(o)->value.gc->th) argument
255 #define l_isfalse(o)(ttisnil(o)||(ttisboolean(o)&&bvalue(o)==0)) argument
269 #define iscollectable(o)(ttype(o)>=4) argument
281 #define svalue(o)getstr(rawtsvalue(o)) argument
344 #define iscfunction(o)(ttype(o)==6&&clvalue(o)->c.isC) argument
500 #define rawgco2ts(o)check_exp((o)->gch.tt==4,&((o)->ts)) argument
501 #define gco2ts(o)(&rawgco2ts(o)->tsv) argument
502 #define rawgco2u(o)check_exp((o)->gch.tt==7,&((o)->u)) argument
503 #define gco2u(o)(&rawgco2u(o)->uv) argument
504 #define gco2cl(o)check_exp((o)->gch.tt==6,&((o)->cl)) argument
505 #define gco2h(o)check_exp((o)->gch.tt==5,&((o)->h)) argument
506 #define gco2p(o)check_exp((o)->gch.tt==(8+1),&((o)->p)) argument
507 #define gco2uv(o)check_exp((o)->gch.tt==(8+2),&((o)->uv)) argument
508 #define ngcotouv(o)check_exp((o)==NULL||(o)->gch.tt==(8+2),&((o)->uv)) argument
509 #define gco2th(o)check_exp((o)->gch.tt==8,&((o)->th)) argument
515 static void luaG_typeerror(lua_State*L,const TValue*o,
583 #define luaC_objbarrier(L,p,o){if(iswhite(obj2gco(o))&&isblack(obj2gco(p)))luaC_barrierf(L,obj2gco(… argument
584 #define luaC_objbarriert(L,t,o){if(iswhite(obj2gco(o))&&isblack(obj2gco(t)))luaC_barrierback(L,t);} argument
586 static void luaC_link(lua_State*L,GCObject*o,lu_byte tt);
588 static void luaC_barrierf(lua_State*L,GCObject*o,GCObject*v);
596 #define tostring(L,o)((ttype(o)==4)||(luaV_tostring(L,o))) argument
597 #define tonumber(o,n)(ttype(o)==3||(((o)=luaV_tonumber(o,n))!=NULL)) argument
799 static const TValue*luaT_gettmbyobj(lua_State*L,const TValue*o,TMS event){
801 switch(ttype(o)){
803 mt=hvalue(o)->metatable;
806 mt=uvalue(o)->metatable;
809 mt=G(L)->mt[ttype(o)];
877 GCObject*o=obj2gco(uv);
879 if(isdead(g,o))
930 #define SET_OPCODE(i,o)((i)=(((i)&MASK0(6,0))|((cast(Instruction,o)<<0)&MASK1(6,0))))
941 #define CREATE_ABC(o,a,b,c)((cast(Instruction,o)<<0)|(cast(Instruction,a)<<(0+6))|(cast(Instruction…
942 #define CREATE_ABx(o,a,bc)((cast(Instruction,o)<<0)|(cast(Instruction,a)<<(0+6))|(cast(Instruction,…
1307 GCObject*o;
1313 for(o=G(L)->strt.hash[lmod(h,G(L)->strt.size)];
1314 o!=NULL;
1315 o=o->gch.next){
1316 TString*ts=rawgco2ts(o);
1318 if(isdead(G(L),o))changewhite(o);
1726 #define markvalue(g,o){checkconsistency(o);if(iscollectable(o)&&iswhite(gcvalue(o)))reallymarkobjec…
1733 static void reallymarkobject(global_State*g,GCObject*o){
1734 white2gray(o);
1735 switch(o->gch.tt){
1740 Table*mt=gco2u(o)->metatable;
1741 gray2black(o);
1743 markobject(g,gco2u(o)->env);
1747 UpVal*uv=gco2uv(o);
1750 gray2black(o);
1754 gco2cl(o)->c.gclist=g->gray;
1755 g->gray=o;
1759 gco2h(o)->gclist=g->gray;
1760 g->gray=o;
1764 gco2th(o)->gclist=g->gray;
1765 g->gray=o;
1769 gco2p(o)->gclist=g->gray;
1770 g->gray=o;
1896 StkId o,lim;
1903 for(o=l->stack;o<l->top;o++)
1904 markvalue(g,o);
1905 for(;o<=lim;o++)
1906 setnilvalue(o);
1910 GCObject*o=g->gray;
1911 gray2black(o);
1912 switch(o->gch.tt){
1914 Table*h=gco2h(o);
1917 black2gray(o);
1922 Closure*cl=gco2cl(o);
1929 lua_State*th=gco2th(o);
1932 g->grayagain=o;
1933 black2gray(o);
1939 Proto*p=gco2p(o);
1957 static int iscleared(const TValue*o,int iskey){
1958 if(!iscollectable(o))return 0;
1959 if(ttisstring(o)){
1960 stringmark(rawtsvalue(o));
1963 return iswhite(gcvalue(o))||
1964 (ttisuserdata(o)&&(!iskey&&isfinalized(uvalue(o))));
1972 TValue*o=&h->array[i];
1973 if(iscleared(o,0))
1974 setnilvalue(o);
1989 static void freeobj(lua_State*L,GCObject*o){
1990 switch(o->gch.tt){
1991 case(8+1):luaF_freeproto(L,gco2p(o));break;
1992 case 6:luaF_freeclosure(L,gco2cl(o));break;
1993 case(8+2):luaF_freeupval(L,gco2uv(o));break;
1994 case 5:luaH_free(L,gco2h(o));break;
1996 luaE_freethread(L,gco2th(o));
2001 luaM_freemem(L,o,sizestring(gco2ts(o)));
2005 luaM_freemem(L,o,sizeudata(gco2u(o)));
2044 GCObject*o=g->tmudata->gch.next;
2045 Udata*udata=rawgco2u(o);
2047 if(o==g->tmudata)
2052 g->mainthread->next=o;
2053 makewhite(g,o);
2198 static void luaC_barrierf(lua_State*L,GCObject*o,GCObject*v){
2203 makewhite(g,o);
2207 GCObject*o=obj2gco(t);
2208 black2gray(o);
2210 g->grayagain=o;
2212 static void luaC_link(lua_State*L,GCObject*o,lu_byte tt){
2214 o->gch.next=g->rootgc;
2215 g->rootgc=o;
2216 o->gch.marked=luaC_white(g);
2217 o->gch.tt=tt;
2221 GCObject*o=obj2gco(uv);
2222 o->gch.next=g->rootgc;
2223 g->rootgc=o;
2224 if(isgray(o)){
2226 gray2black(o);
2230 makewhite(g,o);
2391 #define luaK_codeAsBx(fs,o,A,sBx)luaK_codeABx(fs,o,A,(sBx)+(((1<<(9+9))-1)>>1))
2393 static int luaK_codeABx(FuncState*fs,OpCode o,int A,unsigned int Bx);
2394 static int luaK_codeABC(FuncState*fs,OpCode o,int A,int B,int C);
2532 static int isinstack(CallInfo*ci,const TValue*o){
2535 if(o==p)return 1;
2538 static void luaG_typeerror(lua_State*L,const TValue*o,const char*op){
2540 const char*t=luaT_typenames[ttype(o)];
2541 const char*kind=(isinstack(L->ci,o))?
2725 TValue*o=luaH_setstr(L,ls->fs->h,ts);
2726 if(ttisnil(o)){
2727 setbvalue(o,1);
3162 TValue o;
3163 setsvalue(fs->L,&o,s);
3164 return addk(fs,&o,&o);
3167 TValue o;
3168 setnvalue(&o,r);
3169 return addk(fs,&o,&o);
3172 TValue o;
3173 setbvalue(&o,b);
3174 return addk(fs,&o,&o);
3639 static int luaK_codeABC(FuncState*fs,OpCode o,int a,int b,int c){
3640 return luaK_code(fs,CREATE_ABC(o,a,b,c),fs->ls->lastline);
3642 static int luaK_codeABx(FuncState*fs,OpCode o,int a,unsigned int bc){
3643 return luaK_code(fs,CREATE_ABx(o,a,bc),fs->ls->lastline);
3871 OpCode o=(func->upvalues[i].k==VLOCAL)?OP_MOVE:OP_GETUPVAL;
3872 luaK_codeABC(fs,o,0,func->upvalues[i].info,0);
5316 TValue*o=L->base+(idx-1);
5318 if(o>=L->top)return cast(TValue*,(&luaO_nilobject_));
5319 else return o;
5398 StkId o;
5402 o=index2adr(L,idx);
5403 api_checkvalidindex(L,o);
5411 setobj(L,o,L->top-1);
5422 StkId o=index2adr(L,idx);
5423 return(o==(&luaO_nilobject_))?(-1):ttype(o);
5430 StkId o=index2adr(L,idx);
5431 return iscfunction(o);
5435 const TValue*o=index2adr(L,idx);
5436 return tonumber(o,&n);
5459 const TValue*o=index2adr(L,idx);
5460 if(tonumber(o,&n))
5461 return nvalue(o);
5467 const TValue*o=index2adr(L,idx);
5468 if(tonumber(o,&n)){
5470 lua_Number num=nvalue(o);
5478 const TValue*o=index2adr(L,idx);
5479 return!l_isfalse(o);
5482 StkId o=index2adr(L,idx);
5483 if(!ttisstring(o)){
5484 if(!luaV_tostring(L,o)){
5489 o=index2adr(L,idx);
5491 if(len!=NULL)*len=tsvalue(o)->len;
5492 return svalue(o);
5495 StkId o=index2adr(L,idx);
5496 switch(ttype(o)){
5497 case 4:return tsvalue(o)->len;
5498 case 7:return uvalue(o)->len;
5499 case 5:return luaH_getn(hvalue(o));
5502 l=(luaV_tostring(L,o)?tsvalue(o)->len:0);
5509 StkId o=index2adr(L,idx);
5510 return(!iscfunction(o))?NULL:clvalue(o)->c.f;
5513 StkId o=index2adr(L,idx);
5514 switch(ttype(o)){
5515 case 7:return(rawuvalue(o)+1);
5516 case 2:return pvalue(o);
5602 StkId o;
5603 o=index2adr(L,idx);
5604 luai_apicheck(L,ttistable(o));
5605 setobj(L,L->top,luaH_getnum(hvalue(o),n));
5639 StkId o;
5640 o=index2adr(L,idx);
5641 api_checkvalidindex(L,o);
5642 switch(ttype(o)){
5644 sethvalue(L,L->top,clvalue(o)->c.env);
5647 sethvalue(L,L->top,uvalue(o)->env);
5650 setobj(L,L->top,gt(thvalue(o)));
5686 StkId o;
5688 o=index2adr(L,idx);
5689 luai_apicheck(L,ttistable(o));
5690 setobj(L,luaH_setnum(L,hvalue(o),n),L->top-1);
5691 luaC_barriert(L,hvalue(o),L->top-1);
5728 StkId o;
5731 o=index2adr(L,idx);
5732 api_checkvalidindex(L,o);
5734 switch(ttype(o)){
5736 clvalue(o)->c.env=hvalue(L->top-1);
5739 uvalue(o)->env=hvalue(L->top-1);
5742 sethvalue(L,gt(thvalue(o)),hvalue(L->top-1));
5748 if(res)luaC_objbarrier(L,gcvalue(o),hvalue(L->top-1));
5779 StkId o=index2adr(L,errfunc);
5780 api_checkvalidindex(L,o);
5781 func=savestack(L,o);