[svn:parrot] r40751 - trunk/src

NotFound at svn.parrot.org NotFound at svn.parrot.org
Mon Aug 24 08:54:34 UTC 2009


Author: NotFound
Date: Mon Aug 24 08:54:33 2009
New Revision: 40751
URL: https://trac.parrot.org/parrot/changeset/40751

Log:
[core] better caching of class parent_overrides negative results

Modified:
   trunk/src/oo.c

Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c	Mon Aug 24 08:38:16 2009	(r40750)
+++ trunk/src/oo.c	Mon Aug 24 08:54:33 2009	(r40751)
@@ -521,12 +521,7 @@
     PMC                            *result =
         VTABLE_get_pmc_keyed_str(interp, _class->parent_overrides, name);
 
-    if (!PMC_IS_NULL(result)) {
-        return result;
-    }
-    else if (VTABLE_exists_keyed_str(interp, _class->parent_overrides, name))
-        return PMCNULL;
-    else {
+    if (PMC_IS_NULL(result)) {
         /* Walk and search for the vtable method. */
         const INTVAL num_classes = VTABLE_elements(interp, _class->all_parents);
         INTVAL       i;
@@ -542,11 +537,13 @@
             if (!PMC_IS_NULL(result))
                 break;
         }
-
+        if (PMC_IS_NULL(result))
+            result = pmc_new(interp, enum_class_Undef);
         VTABLE_set_pmc_keyed_str(interp, _class->parent_overrides, name, result);
-
-        return result;
     }
+    if (result->vtable->base_type == enum_class_Undef)
+        result = PMCNULL;
+    return result;
 }
 
 


More information about the parrot-commits mailing list