chromatic wrote:
On Saturday 23 May 2009 21:02:49 [email protected] wrote:

Log:
Cache created Proxy in Parrot_oo_get_class_str.

This reduces Rakudo's startup time by about 25%.

Ooh, nice, but...

Modified:
   trunk/src/oo.c

Modified: trunk/src/oo.c
--- trunk/src/oo.c      Sun May 24 04:00:25 2009        (r39131)
+++ trunk/src/oo.c      Sun May 24 04:02:48 2009        (r39132)
@@ -387,9 +387,17 @@
         if (type > interp->n_vtable_max || type <= 0)
             return PMCNULL;
         else {
+            PMC * new_class;
+            PMC * new_ns;
             PMC * const type_num = pmc_new(interp, enum_class_Integer);
             VTABLE_set_integer_native(interp, type_num, type);
-            return pmc_new_init(interp, enum_class_PMCProxy, type_num);
+            new_ns = ns;
+            new_class = pmc_new_init(interp, enum_class_PMCProxy,
type_num); +            if (ns->vtable->base_type != enum_class_NameSpace)
{
+                new_ns = Parrot_make_namespace_keyed_str(interp, hll_ns,
name); +            }
Hmmm...caching it in the HLL namespace? Does this not mean that two lookups from two different HLLs will result in two PMC proxies? If so, this is going to cause problems, since we really need one PMCProxy instance per PMC. Otherwise, any code that compares pointers to check class identity (which is the Right Way) is going to fail.

Thanks,

Jonathan

_______________________________________________
http://lists.parrot.org/mailman/listinfo/parrot-dev

Reply via email to