Ticket #6: patch.patch
File patch.patch, 2.6 KB (added by jimmy, 13 years ago) |
---|
-
src/pmc/class.pmc
80 80 A cache of visible attribute names to attribute indexes. 81 81 A Null PMC is allocated during initialization. 82 82 83 =item C<vtable_cache>84 85 Cache of the vtable used for objects (only STM).86 87 83 =item C<resolve_method> 88 84 89 85 A list of method names the class provides used for name conflict resolution. … … 429 425 ATTR PMC *attrib_metadata; /* Hash of attributes in this class to hashes of metadata. */ 430 426 ATTR PMC *attrib_index; /* Lookup table for attributes in this and parents. */ 431 427 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). */433 428 ATTR PMC *resolve_method; /* List of method names the class provides to resolve 434 429 * conflicts with methods from roles. */ 435 430 ATTR PMC *parent_overrides; … … 468 463 _class->attrib_metadata = pmc_new(interp, enum_class_Hash); 469 464 _class->attrib_index = PMCNULL; 470 465 _class->attrib_cache = PMCNULL; 471 _class->vtable_cache = PMCNULL; /* only used for STM */472 466 _class->resolve_method = pmc_new(interp, enum_class_ResizablePMCArray); 473 467 474 468 _class->vtable_overrides = pmc_new(interp, enum_class_Hash); -
src/pmc/object.pmc
791 791 PMC *classobj; 792 792 Parrot_Interp master; 793 793 INTVAL type_num; 794 PMC *vtable_cache = PMCNULL;795 794 796 795 if (PObj_is_PMC_shared_TEST(SELF)) 797 796 return SELF; … … 800 799 classobj = VTABLE_get_class(INTERP, SELF); 801 800 type_num = SELF->vtable->base_type; 802 801 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 814 802 /* make sure metadata doesn't go away unexpectedly */ 815 803 if (PMC_metadata(pmc)) 816 804 PMC_metadata(pmc) = pt_shared_fixup(interp, PMC_metadata(pmc));