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

jonathan at svn.parrot.org jonathan at svn.parrot.org
Wed May 6 23:31:21 UTC 2009


Author: jonathan
Date: Wed May  6 23:31:19 2009
New Revision: 38517
URL: https://trac.parrot.org/parrot/changeset/38517

Log:
Try to avoid exceptions when copying methods out to Parrot classes in P6object, which gives a performance win. chromatic++ for identifying this bottleneck.

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

Modified: trunk/runtime/parrot/library/P6object.pir
==============================================================================
--- trunk/runtime/parrot/library/P6object.pir	Wed May  6 23:00:33 2009	(r38516)
+++ trunk/runtime/parrot/library/P6object.pir	Wed May  6 23:31:19 2009	(r38517)
@@ -236,11 +236,18 @@
   method_loop:
     unless methoditer goto mro_loop
     $S0 = shift methoditer
-    push_eh method_next
+    $P0 = parrotclassns[$S0]
+    if null $P0 goto add_method
+    $I0 = isa $P0, 'MultiSub'
+    unless $I0 goto method_loop
+  add_method:
     $P0 = methods[$S0]
+    $I0 = isa $P0, 'NCI'
+    if $I0 goto method_loop
+    push_eh err
     parrotclassns.'add_sub'($S0, $P0)
-  method_next:
     pop_eh
+  err:
     goto method_loop
   mro_end:
 


More information about the parrot-commits mailing list