develooper Front page | perl.cvs.parrot | Postings from December 2008

[svn:parrot] r33931 - in trunk: src/pmc t/pmc

From:
chromatic
Date:
December 15, 2008 11:41
Subject:
[svn:parrot] r33931 - in trunk: src/pmc t/pmc
Message ID:
20081215194117.4BC3CCBA12@x12.develooper.com
Author: chromatic
Date: Mon Dec 15 11:41:16 2008
New Revision: 33931

Modified:
   trunk/src/pmc/namespace.pmc
   trunk/t/pmc/key.t

Log:
[PMC] Worked around TT #10 temporarily by skipping deep Sub-like introspection
when using a PIR-level subclass of Sub.  The right solution is making Sub's
attributes into PMC ATTRs, but that's too big to do before tomorrow's release.

Reclaimed a related test for the Key PMC.

Modified: trunk/src/pmc/namespace.pmc
==============================================================================
--- trunk/src/pmc/namespace.pmc	(original)
+++ trunk/src/pmc/namespace.pmc	Mon Dec 15 11:41:16 2008
@@ -246,9 +246,11 @@
 
         /* If it's a sub... */
         if (!PMC_IS_NULL(value) && VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "Sub"))) {
-            int all_done = ns_insert_sub_keyed_str(interp, SELF, key, value);
-            if (all_done)
-                return;
+            /* TT #10; work around that Sub doesn't use PMC ATTRs */
+            if (value->vtable->base_type != enum_class_Object) {
+                if (ns_insert_sub_keyed_str(interp, SELF, key, value))
+                    return;
+            }
         }
 
         /* If it's an NCI method */
@@ -264,7 +266,9 @@
         if (!PMC_IS_NULL(value)
         &&   VTABLE_isa(INTERP, value, CONST_STRING(INTERP, "MultiSub"))) {
 
-            if (VTABLE_elements(interp, value) > 0) {
+            /* TT #10; work around that Sub doesn't use PMC ATTRs */
+            if (value->vtable->base_type != enum_class_Object
+            && VTABLE_elements(interp, value) > 0) {
                 Parrot_NameSpace_attributes * const nsinfo = PARROT_NAMESPACE(SELF);
                 PMC * const classobj = VTABLE_get_class(interp, SELF);
 

Modified: trunk/t/pmc/key.t
==============================================================================
--- trunk/t/pmc/key.t	(original)
+++ trunk/t/pmc/key.t	Mon Dec 15 11:41:16 2008
@@ -19,12 +19,12 @@
 .sub main :main
     .include 'include/test_more.pir'
 
-    plan(7)
+    plan(8)
 
     traverse_key_chain()
     extract_int_from_string_keys()
     extract_string_from_int_keys()
-    #do_not_collect_string_keys_early_rt_60128()
+    do_not_collect_string_keys_early_rt_60128()
     todo(0, 'register and non-register string keys should be COW (RT #60128)' )
 .end
 



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