[svn:parrot] r45079 - branches/pcc_hackathon_6Mar10/lib/Parrot/Pmc2c

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Mar 21 09:07:34 UTC 2010


Author: bacek
Date: Sun Mar 21 09:07:33 2010
New Revision: 45079
URL: https://trac.parrot.org/parrot/changeset/45079

Log:
Low-hanging fruite for 3% performance improvements: reorder GETATTR macros to favour non-objects.

Modified:
   branches/pcc_hackathon_6Mar10/lib/Parrot/Pmc2c/Attribute.pm

Modified: branches/pcc_hackathon_6Mar10/lib/Parrot/Pmc2c/Attribute.pm
==============================================================================
--- branches/pcc_hackathon_6Mar10/lib/Parrot/Pmc2c/Attribute.pm	Sun Mar 21 07:24:00 2010	(r45078)
+++ branches/pcc_hackathon_6Mar10/lib/Parrot/Pmc2c/Attribute.pm	Sun Mar 21 09:07:33 2010	(r45079)
@@ -140,7 +140,10 @@
 /* Generated macro accessors for '$attrname' attribute of $pmcname PMC. */
 #define GETATTR_${pmcname}_${attrname}(interp, pmc, dest) \\
     do { \\
-        if (PObj_is_object_TEST(pmc)) { \\
+        if (!PObj_is_object_TEST(pmc)) { \\
+            (dest) = ((Parrot_${pmcname}_attributes *)PMC_data(pmc))->$attrname; \\
+        } \\
+        else { \\
 EOA
 
     if ($isfuncptr == 1) {
@@ -189,8 +192,6 @@
 
     $decl .= <<"EOA";
         } \\
-        else \\
-            (dest) = ((Parrot_${pmcname}_attributes *)PMC_data(pmc))->$attrname; \\
     } while (0)
 
 #define SETATTR_${pmcname}_${attrname}(interp, pmc, value) \\


More information about the parrot-commits mailing list