Skip to content

Commit

Permalink
Switch Perl6MultiSub to use Parrot_ext_call instead of Parrot_call_me…
Browse files Browse the repository at this point in the history
…thod, which has gotten broken. This plus an earlier fix to Parrot (we'll need to bump PARROT_REVISION again) means we make it through the build.
  • Loading branch information
jnthn committed Oct 26, 2009
1 parent 19e91f5 commit 6c39fac
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/pmc/perl6multisub.pmc
Expand Up @@ -178,21 +178,19 @@ static INTVAL is_narrower(PARROT_INTERP, candidate_info *a, candidate_info *b) {
}
else {
PMC * const accepts_meth_a = VTABLE_find_method(interp, type_obj_b, ACCEPTS);
PMC * const result_n = (PMC *) Parrot_call_method(interp, accepts_meth_a,
type_obj_b, ACCEPTS, "PP", type_obj_a);
PMC * result_n = PMCNULL;
Parrot_ext_call(interp, accepts_meth_a, "PiP->P", type_obj_b, type_obj_a, &result_n);
if (VTABLE_get_integer(interp, result_n)) {
/* Narrower - note it and we're done. */
narrower++;
}
else {
/* Make sure it's tied, rather than the other way around. */
PMC * const accepts_meth_b = VTABLE_find_method(interp, type_obj_a, ACCEPTS);
PMC * const result_w = (PMC *) Parrot_call_method(interp,
accepts_meth_b, type_obj_a,
ACCEPTS, "PP", type_obj_b);
if (!VTABLE_get_integer(interp, result_w)) {
PMC * result_w = PMCNULL;
Parrot_ext_call(interp, accepts_meth_b, "PiP->P", type_obj_a, type_obj_b, &result_w);
if (!VTABLE_get_integer(interp, result_w))
tied++;
}
}
}
}
Expand Down Expand Up @@ -559,10 +557,8 @@ static PMC* do_dispatch(PARROT_INTERP, PMC *self, candidate_info **candidates, P
PMC * const param = VTABLE_get_pmc_keyed_int(interp, pos_args, i);
PMC * const type_obj = (*cur_candidate)->types[i];
PMC * const accepts_meth = VTABLE_find_method(interp, type_obj, ACCEPTS);
PMC * const result = (PMC *)Parrot_call_method(interp,
accepts_meth, type_obj, ACCEPTS,
"PP", param);

PMC * result = PMCNULL;
Parrot_ext_call(interp, accepts_meth, "PiP->P", type_obj, param, &result);
if (!VTABLE_get_integer(interp, result)) {
type_mismatch = 1;
break;
Expand Down Expand Up @@ -661,12 +657,12 @@ static PMC* do_dispatch(PARROT_INTERP, PMC *self, candidate_info **candidates, P
INTVAL i;

for (i = 0; i < possibles_count; i++) {
PMC * const sig_meth = VTABLE_find_method(interp, possibles[i]->sub, sig_name);
PMC * const sig_obj = (PMC *)Parrot_call_method(interp, sig_meth,
possibles[i]->sub, sig_name, "P");
PMC * const perl_meth = VTABLE_find_method(interp, sig_obj, perl_name);
STRING * const sig_perl = (STRING *)Parrot_call_method(interp, perl_meth,
sig_obj, perl_name, "S");
PMC *sig_meth, *sig_obj, *perl_meth;
STRING *sig_perl;
sig_meth = VTABLE_find_method(interp, possibles[i]->sub, sig_name);
Parrot_ext_call(interp, sig_meth, "Pi->P", possibles[i]->sub, &sig_obj);
perl_meth = VTABLE_find_method(interp, sig_obj, perl_name);
Parrot_ext_call(interp, perl_meth, "Pi->S", sig_obj, &sig_perl);
signatures = Parrot_str_append(interp, signatures, sig_perl);
signatures = Parrot_str_append(interp, signatures, newline);
}
Expand Down

0 comments on commit 6c39fac

Please sign in to comment.