Skip to content

Commit

Permalink
[PCC] Set arg_flags on CallContext directly.
Browse files Browse the repository at this point in the history
This avoids a vtable call and a STRING comparison in the common case, and
should not harm subclassing at all. This ought to improve performance of
external calls by a modest amount.
  • Loading branch information
chromatic committed Sep 8, 2011
1 parent 35318ef commit ac4409f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/call/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ passing to and from subroutines following the Parrot Calling Conventions.
#include "args.str"
#include "pmc/pmc_key.h"
#include "pmc/pmc_fixedintegerarray.h"
#include "pmc/pmc_callcontext.h"

/* HEADERIZER HFILE: include/parrot/call.h */

Expand Down Expand Up @@ -586,7 +587,7 @@ set_call_from_varargs(PARROT_INTERP,
INTVAL i = 0;

parse_signature_string(interp, sig, &arg_flags);
VTABLE_set_attr_str(interp, signature, CONST_STRING(interp, "arg_flags"), arg_flags);
SETATTR_CallContext_arg_flags(interp, signature, arg_flags);

/* Process the varargs list */
for (; sig[i] != '\0'; ++i) {
Expand Down Expand Up @@ -730,7 +731,7 @@ Parrot_pcc_build_sig_object_from_varargs(PARROT_INTERP, ARGIN_NULLOK(PMC *obj),
return call_object;

parse_signature_string(interp, sig, &arg_flags);
VTABLE_set_attr_str(interp, call_object, CONST_STRING(interp, "arg_flags"), arg_flags);
SETATTR_CallContext_arg_flags(interp, call_object, arg_flags);

/* Process the varargs list */
for (i = 0; sig[i] != '\0'; ++i) {
Expand Down

0 comments on commit ac4409f

Please sign in to comment.