I've seen a very similar issue when calling Parrot_run_method_fromc_args and variants from inside a call to Parrot_PCCINVOKE or Parrot_pcc_invoke_method_from_c_args. As part of the ongoing calling conventions refactors, all calls to Parrot_run_sub_*, Parrot_run_method_*, and probably calls to Parrot_runops_* will all be replaced by calls to Parrot_pcc_invoke_method_from_c_args, Parrot_pcc_invoke_sub_from_c_args, and Parrot_pcc_invoke_from_sig_object, which I've found (see TT #321) to resolve the issues.
We do run into an issue when making these translations, however, when we talk about passing key arguments. Keys can contain, instead of direct values, a reference to a register in the current context. Syntax like this: p[$S0, $I0] in PIR actually takes a reference to $S0 and $I0 instead of resolving those registers to their values immediately. In Parrot_run_method_* and related functions, the values are attempting to be passed before a new context is created for the callee. In Parrot_pcc_invoke_* functions, the parameters are passed after the new context is created, causing he register references to point to the wrong registers. I'm currently working to resolve that issue, and will probably file a separate ticket for it at trac. Will post updates here as they come. _______________________________________________ http://lists.parrot.org/mailman/listinfo/parrot-dev
