[svn:parrot] r46148 - trunk/runtime/parrot/library

jonathan at svn.parrot.org jonathan at svn.parrot.org
Thu Apr 29 19:35:50 UTC 2010


Author: jonathan
Date: Thu Apr 29 19:35:50 2010
New Revision: 46148
URL: https://trac.parrot.org/parrot/changeset/46148

Log:
[p6object] Update to make sure we go finding methods through introspection rather than in the namespace, which is an especially bad idea now :method (happily) doesn't put methods there any more.

Modified:
   trunk/runtime/parrot/library/P6object.pir

Modified: trunk/runtime/parrot/library/P6object.pir
==============================================================================
--- trunk/runtime/parrot/library/P6object.pir	Thu Apr 29 19:32:53 2010	(r46147)
+++ trunk/runtime/parrot/library/P6object.pir	Thu Apr 29 19:35:50 2010	(r46148)
@@ -251,8 +251,7 @@
 
   parent_proxy:
     ##  iterate over parent's mro and methods, adding them to parrotclass' namespace
-    .local pmc parrotclassns, mroiter, methods, methoditer
-    parrotclassns = parrotclass.'get_namespace'()
+    .local pmc mroiter, methods, methoditer
     $P0 = parentclass.'inspect'('all_parents')
     mroiter = iter $P0
   mro_loop:
@@ -270,18 +269,20 @@
     $I0 = isa methodpmc, 'NCI'
     if $I0 goto method_loop
     # if there's no existing entry, add method directly
-    $P0 = parrotclassns[methodname]
+    push_eh add_method_failed
+    $P0 = inspect parrotclass, 'methods'
+    $P0 = $P0[methodname]
     if null $P0 goto add_method
     # if existing entry isn't a MultiSub, skip it
     $I0 = isa $P0, ['MultiSub']
     unless $I0 goto method_loop
-    push_eh err
-    parrotclassns.'add_sub'(methodname, methodpmc)
-  err:
+    parrotclass.'add_method'(methodname, methodpmc)
     pop_eh
     goto method_loop
   add_method:
-    parrotclassns[methodname] = methodpmc
+    parrotclass.'add_method'(methodname, methodpmc)
+  add_method_failed:
+    pop_eh
     goto method_loop
   mro_end:
 


More information about the parrot-commits mailing list