static _rs_inline obj unswizzle( obj item ) { if (OBJ_ISA_PTR(item)) { obj swz = PTR_TO_HDRPTR(replace_ptr(item))->pob_class; assert( OBJ_ISA_PTR(swz) && ((VAL(swz)>>PRIMARY_TAG_SIZE) < known_num_objects) ); return swz; } else { return item;
static _rs_inline void spot_object( obj thing ) { POBHeader *p; if (OBJ_ISA_PTR(thing)) { thing = replace_ptr(thing); assert( OBJ_ISA_PTR(thing) ); p = (POBHeader *)PTR_TO_HDRPTR(thing); if (!EQ(p->pob_class,ZERO)) spot_new_object(thing); } }
static void spot_new_object( obj thing ) { POBHeader *p =(POBHeader *)PTR_TO_HDRPTR(thing); obj the_class; SaveQueue *q; the_class = p->pob_class; if (EQ(the_class,int2fx(1))) { q = &used_refs; /*printf( "spot REF %08x\n", VAL(thing) );*/ } else { /* a normal heap object that hasn't been spotted yet */ obj rplc; int imode; assert( OBJ_ISA_PTR(the_class) ); rplc = replace_ptr(the_class); imode = class_image_mode( rplc ); /*printf( "spot NORMAL[%d] %08x\n", imode, VAL(thing) );*/ if (imode < 0 || imode >= NUM_CLASS_MODES) { fprintf( stderr, "Warning: Class %s has illegal image-mode = %d\n", symbol_text( class_name( rplc ) ), imode ); imode = 0; } q = &image_modes[imode].queue; } /* insert us in the appropriate queue */ hi_enqueue_item( q, thing ); p->pob_class = ZERO; }