Ticket #1280: cage.patch
| File cage.patch, 1.3 KB (added by jimmy, 4 years ago) |
|---|
-
src/oo.c
939 939 Parrot_find_method_with_cache(PARROT_INTERP, ARGIN(PMC *_class), ARGIN(STRING *method_name)) 940 940 { 941 941 ASSERT_ARGS(Parrot_find_method_with_cache) 942 UINTVAL type, bits;943 942 943 UINTVAL type, bits; 944 944 Caches *mc; 945 Meth_cache_entry *e , *old;945 Meth_cache_entry *e; 946 946 947 947 PARROT_ASSERT(method_name != 0); 948 948 949 949 #if DISABLE_METH_CACHE 950 950 return Parrot_find_method_direct(interp, _class, method_name); 951 #e ndif951 #else 952 952 953 953 if (! PObj_constant_TEST(method_name)) 954 954 return Parrot_find_method_direct(interp, _class, method_name); … … 975 975 } 976 976 977 977 e = mc->idx[type][bits]; 978 old = NULL;979 978 980 979 while (e && e->strstart != method_name->strstart) { 981 old = e;982 980 e = e->next; 983 981 } 984 982 … … 986 984 /* when here no or no correct entry was at [bits] */ 987 985 e = mem_allocate_typed(Meth_cache_entry); 988 986 989 if (old) 990 old->next = e; 991 else 992 mc->idx[type][bits] = e; 987 mc->idx[type][bits] = e; 993 988 994 989 e->pmc = Parrot_find_method_direct(interp, _class, method_name); 995 990 e->next = NULL; … … 997 992 } 998 993 999 994 return e->pmc; 995 996 #endif 1000 997 } 1001 998 1002 999
