Author: chromatic
Date: Tue Aug 12 15:45:02 2008
New Revision: 30191

Modified:
   trunk/lib/Parrot/Pmc2c/PMC/Object.pm

Log:
[lib] Made Object PMC look up its proxy attribute (if it has a proxy) by
string, not key.  This surprisingly makes it go much faster.  We may have to
undo this optimization, but for now it works around the PMC's very slow
get_attr_index_keyed().

Modified: trunk/lib/Parrot/Pmc2c/PMC/Object.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMC/Object.pm        (original)
+++ trunk/lib/Parrot/Pmc2c/PMC/Object.pm        Tue Aug 12 15:45:02 2008
@@ -59,8 +59,8 @@
 
         if (cur_class->vtable->base_type == enum_class_PMCProxy) {
             /* Get the PMC instance and call the vtable method on that. */
-            PMC * const del_object =
-                VTABLE_get_attr_keyed(interp, SELF, cur_class, 
CONST_STRING_GEN(interp, "proxy"));
+            STRING * const proxy      = CONST_STRING_GEN(interp, "proxy");
+            PMC    * const del_object = VTABLE_get_attr_str(interp, SELF, 
proxy);
 
             if (!PMC_IS_NULL(del_object)) {
                 ${return}VTABLE_$vt_method_name(interp, del_object$args);

Reply via email to