[svn:parrot] r47878 - trunk/src/call

chromatic at svn.parrot.org chromatic at svn.parrot.org
Sat Jun 26 20:54:15 UTC 2010


Author: chromatic
Date: Sat Jun 26 20:54:15 2010
New Revision: 47878
URL: https://trac.parrot.org/parrot/changeset/47878

Log:
[pcc] Improved :call_sig branch prediction.

Modified:
   trunk/src/call/args.c

Modified: trunk/src/call/args.c
==============================================================================
--- trunk/src/call/args.c	Sat Jun 26 20:54:12 2010	(r47877)
+++ trunk/src/call/args.c	Sat Jun 26 20:54:15 2010	(r47878)
@@ -777,19 +777,16 @@
        callee side only. Does not add :call_sig arg support on the caller side.
        This is not the final form of the algorithm, but should provide the
        tools that HLL designers need in the interim. */
-    if (param_count == 1) {
-        const INTVAL first_flag = raw_params[0];
-
-        if (first_flag & PARROT_ARG_CALL_SIG) {
-            *accessor->pmc(interp, arg_info, 0) = call_object;
-            return;
+    if (param_count > 2 || param_count == 0)
+        /* help branch predictors */;
+    else {
+        const INTVAL second_flag = raw_params[param_count - 1];
+        if (second_flag & PARROT_ARG_CALL_SIG) {
+            *accessor->pmc(interp, arg_info, param_count - 1) = call_object;
+            if (param_count == 1)
+                return;
         }
     }
-    else if (param_count == 2) {
-        const INTVAL second_flag = raw_params[1];
-        if (second_flag & PARROT_ARG_CALL_SIG)
-            *accessor->pmc(interp, arg_info, 1) = call_object;
-    }
 
     /* First iterate over positional args and positional parameters. */
     GETATTR_CallContext_num_positionals(interp, call_object, positional_args);


More information about the parrot-commits mailing list