References to multis (at PIR level)

Patrick R. Michaud pmichaud at pobox.com
Tue Sep 23 21:21:06 UTC 2008


On Tue, Sep 23, 2008 at 03:55:54PM -0500, Patrick R. Michaud wrote:
> On Tue, Sep 23, 2008 at 03:50:54PM -0500, Patrick R. Michaud wrote:
> > However, for some reason 
> > the change from to a MultiSub PMC is causing the 'sort' method dispatch 
> > to FixedPMCArray to fail with "No applicable methods".  I'm looking into 
> > FixedPMCArray now to see if I can find out why.
> 
> Here's a short PIR program that demonstrates the problem:
> [...]

After running a gdb trace on the sample program in my previous
message, we get as far as doing a call to COMPARE (src/utils.c:853),
which then calls 

    Parrot_runops_fromc_args_reti(interp, cmp, "IPP", a, b)

This eventually calls runops_args (src/inter_run.c:186), which
in turn calls the 'invoke' vtable method on the MultiSub PMC,
which then calls Parrot_mmd_sort_candidate_list to get the
entries of the MultiSub that match the arguments, but ends up
with an empty list and throws the (cryptic in this instance) 
"No applicable methods." exception (src/pmc/multisub.pmc:67).

My guess is that because the MultiSub is being invoked from
C, Parrot_mmd_sort_candidate_list isn't seeing the correct
argument list and therefore isn't finding a matching subroutine
entry in the MultiSub.

That's about the limit of my Parrot-fu here-- someone more with
more knowledge about MultiSub dispatch and argument passing
will likely have to take it from here.

A short term fix to this problem for Rakudo may be to write 
a custom 'sort' method that doesn't rely on the one in FixedPMCArray.

Pm


More information about the parrot-dev mailing list