develooper Front page | perl.cvs.parrot | Postings from January 2009

[svn:parrot] r35719 - trunk/src

From:
Whiteknight
Date:
January 18, 2009 07:47
Subject:
[svn:parrot] r35719 - trunk/src
Message ID:
20090118154707.A9B90CB9AE@x12.develooper.com
Author: Whiteknight
Date: Sun Jan 18 07:47:06 2009
New Revision: 35719

Modified:
   trunk/src/oo.c
   trunk/src/pmc.c

Log:
[get_class] roll back a few changes which appear to be breaking Rakudo.

Modified: trunk/src/oo.c
==============================================================================
--- trunk/src/oo.c	(original)
+++ trunk/src/oo.c	Sun Jan 18 07:47:06 2009
@@ -224,12 +224,12 @@
         INTVAL type;
         const INTVAL base_type = key->vtable->base_type;
 
-        /* XXX TT#182: This is a hack! We should be able to treat all
-           PMC types the same through pmc_type_p or some interface to it */
+        /* This is a hack! All PMCs should be able to be handled through
+           a single codepath, and all of them should be able to avoid
+           stringification because it's so imprecise. */
         if (base_type == enum_class_Key
          || base_type == enum_class_ResizableStringArray
-         || base_type == enum_class_String
-         || base_type == enum_class_NameSpace)
+         || base_type == enum_class_String)
             type = pmc_type_p(interp, key);
         else
             type = pmc_type(interp, VTABLE_get_string(interp, key));

Modified: trunk/src/pmc.c
==============================================================================
--- trunk/src/pmc.c	(original)
+++ trunk/src/pmc.c	Sun Jan 18 07:47:06 2009
@@ -619,20 +619,6 @@
     PMC * const classname_hash = interp->class_hash;
     PMC * item;
 
-    if (name->vtable->base_type == enum_class_NameSpace) {
-        /* We need to convert the NameSpace to a ResizableStringArray. The
-           get_name method does this for now, but eventually we should be
-           able to do a morph VTABLE call instead */
-        Parrot_PCCINVOKE(interp, name, CONST_STRING(interp, "get_name"), "->P",  &name);
-
-        /* We need to chop off the HLL namespace. If it is the root
-           namespace, the array will be empty so don't try to do a shift
-           here */
-        if (VTABLE_get_integer(interp, name) > 0)
-            VTABLE_shift_pmc(interp, name);
-        else
-            return 0;
-    }
     item = (PMC *)VTABLE_get_pointer_keyed(interp, classname_hash, name);
 
     if (!PMC_IS_NULL(item))



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About