Skip to content

Commit

Permalink
[pcc] Improved :call_sig branch prediction.
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/trunk@47878 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
chromatic committed Jun 26, 2010
1 parent 485e9b7 commit 96155e0
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/call/args.c
Expand Up @@ -777,19 +777,16 @@ fill_params(PARROT_INTERP, ARGMOD_NULLOK(PMC *call_object),
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);
Expand Down

0 comments on commit 96155e0

Please sign in to comment.