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

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Oct 25 21:18:27 UTC 2009


Author: bacek
Date: Sun Oct 25 21:18:26 2009
New Revision: 42094
URL: https://trac.parrot.org/parrot/changeset/42094

Log:
Return early in fill_params error check if there is no named arguments. Improve fib.pir by another 1.2%.

Modified:
   trunk/src/call/args.c

Modified: trunk/src/call/args.c
==============================================================================
--- trunk/src/call/args.c	Sun Oct 25 20:56:45 2009	(r42093)
+++ trunk/src/call/args.c	Sun Oct 25 21:18:26 2009	(r42094)
@@ -1288,7 +1288,14 @@
 
     /* Double check that all named arguments were assigned to parameters. */
     if (err_check) {
-        PMC *named_arg_list = VTABLE_get_attr_str(interp, call_object, CONST_STRING(interp, "named"));
+        PMC  *named_arg_list;
+        Hash *h;
+        /* Early exit to avoid vtable call */
+        GETATTR_CallSignature_hash(interp, call_object, h);
+        if (!h || !h->entries)
+            return;
+
+        named_arg_list = VTABLE_get_attr_str(interp, call_object, CONST_STRING(interp, "named"));
         if (!PMC_IS_NULL(named_arg_list)) {
             INTVAL named_arg_count = VTABLE_elements(interp, named_arg_list);
             if (PMC_IS_NULL(named_used_list))


More information about the parrot-commits mailing list