Ticket #6: patch.patch

File patch.patch, 2.6 KB (added by jimmy, 13 years ago)
  • src/pmc/class.pmc

     
    8080A cache of visible attribute names to attribute indexes. 
    8181A Null PMC is allocated during initialization. 
    8282 
    83 =item C<vtable_cache> 
    84  
    85 Cache of the vtable used for objects (only STM). 
    86  
    8783=item C<resolve_method> 
    8884 
    8985A list of method names the class provides used for name conflict resolution. 
     
    429425    ATTR PMC *attrib_metadata;  /* Hash of attributes in this class to hashes of metadata. */ 
    430426    ATTR PMC *attrib_index;     /* Lookup table for attributes in this and parents. */ 
    431427    ATTR PMC *attrib_cache;     /* Cache of visible attrib names to indexes. */ 
    432     ATTR PMC *vtable_cache;     /* Cache of the vtable used for objects (only STM). */ 
    433428    ATTR PMC *resolve_method;   /* List of method names the class provides to resolve 
    434429                                 * conflicts with methods from roles. */ 
    435430    ATTR PMC *parent_overrides; 
     
    468463        _class->attrib_metadata = pmc_new(interp, enum_class_Hash); 
    469464        _class->attrib_index    = PMCNULL; 
    470465        _class->attrib_cache    = PMCNULL; 
    471         _class->vtable_cache    = PMCNULL; /* only used for STM */ 
    472466        _class->resolve_method  = pmc_new(interp, enum_class_ResizablePMCArray); 
    473467 
    474468        _class->vtable_overrides = pmc_new(interp, enum_class_Hash); 
  • src/pmc/object.pmc

     
    791791        PMC *classobj; 
    792792        Parrot_Interp  master; 
    793793        INTVAL         type_num; 
    794         PMC           *vtable_cache = PMCNULL; 
    795794 
    796795        if (PObj_is_PMC_shared_TEST(SELF)) 
    797796            return SELF; 
     
    800799        classobj = VTABLE_get_class(INTERP, SELF); 
    801800        type_num = SELF->vtable->base_type; 
    802801 
    803         /* keep the original vtable from going away... */ 
    804         vtable_cache = PARROT_CLASS(classobj)->vtable_cache; 
    805         if (PMC_IS_NULL(vtable_cache)) { 
    806             vtable_cache = pmc_new(INTERP, enum_class_VtableCache); 
    807             PMC_struct_val(vtable_cache) = INTERP->vtables[type_num]; 
    808             PARROT_CLASS(classobj)->vtable_cache = vtable_cache; 
    809         } 
    810  
    811         add_pmc_sync(INTERP, vtable_cache); 
    812         PObj_is_PMC_shared_SET(vtable_cache); 
    813  
    814802        /* make sure metadata doesn't go away unexpectedly */ 
    815803        if (PMC_metadata(pmc)) 
    816804            PMC_metadata(pmc) = pt_shared_fixup(interp, PMC_metadata(pmc));