[svn:parrot] r41826 - in branches/pcc_reapply: src src/call src/pmc t/src
chromatic at svn.parrot.org
chromatic at svn.parrot.org
Sun Oct 11 20:17:15 UTC 2009
Author: chromatic
Date: Sun Oct 11 20:17:13 2009
New Revision: 41826
URL: https://trac.parrot.org/parrot/changeset/41826
Log:
[PCC] Made MultiSub invocation from C slightly less buggy. This doesn't
completely fix t/src/extend.t #16 (RT #41511), but it crashes in a beter way
now.
Modified:
branches/pcc_reapply/src/call/pcc.c
branches/pcc_reapply/src/extend.c
branches/pcc_reapply/src/pmc/multisub.pmc
branches/pcc_reapply/src/pmc/sub.pmc
branches/pcc_reapply/t/src/extend.t
Modified: branches/pcc_reapply/src/call/pcc.c
==============================================================================
--- branches/pcc_reapply/src/call/pcc.c Sun Oct 11 18:12:43 2009 (r41825)
+++ branches/pcc_reapply/src/call/pcc.c Sun Oct 11 20:17:13 2009 (r41826)
@@ -233,6 +233,7 @@
/* PIR Subs need runops to run their opcodes. Methods and NCI subs
* don't. */
if ((sub_obj->vtable->base_type == enum_class_Sub
+ || sub_obj->vtable->base_type == enum_class_MultiSub
|| (sub_obj->vtable->base_type == enum_class_Eval))
&& PMC_IS_NULL(interp->current_object)) {
Parrot_runcore_t *old_core = interp->run_core;
Modified: branches/pcc_reapply/src/extend.c
==============================================================================
--- branches/pcc_reapply/src/extend.c Sun Oct 11 18:12:43 2009 (r41825)
+++ branches/pcc_reapply/src/extend.c Sun Oct 11 20:17:13 2009 (r41826)
@@ -1153,8 +1153,6 @@
* hackish, added for backward compatibility in deprecated API function,
* see TT #XXX). */
append_result(interp, sig_object, Parrot_str_new_constant(interp, "I"), &result);
- PMC_get_sub(interp, sub_pmc, sub);
- Parrot_pcc_set_constants(interp, CURRENT_CONTEXT(interp), sub->seg->const_table->constants);
Parrot_pcc_invoke_from_sig_object(interp, sub_pmc, sig_object);
return result;
Modified: branches/pcc_reapply/src/pmc/multisub.pmc
==============================================================================
--- branches/pcc_reapply/src/pmc/multisub.pmc Sun Oct 11 18:12:43 2009 (r41825)
+++ branches/pcc_reapply/src/pmc/multisub.pmc Sun Oct 11 20:17:13 2009 (r41826)
@@ -58,11 +58,12 @@
VTABLE opcode_t *invoke(void *next) {
PMC * const sig_obj = CONTEXT(interp)->current_sig;
- PMC * const func = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
+ PMC * const func = Parrot_mmd_sort_manhattan_by_sig_pmc(interp,
SELF, sig_obj);
if (PMC_IS_NULL(func))
- Parrot_ex_throw_from_c_args(INTERP, NULL, 1, "No applicable methods.\n");
+ Parrot_ex_throw_from_c_args(INTERP, NULL, 1,
+ "No applicable methods.\n");
return VTABLE_invoke(INTERP, func, next);
}
Modified: branches/pcc_reapply/src/pmc/sub.pmc
==============================================================================
--- branches/pcc_reapply/src/pmc/sub.pmc Sun Oct 11 18:12:43 2009 (r41825)
+++ branches/pcc_reapply/src/pmc/sub.pmc Sun Oct 11 20:17:13 2009 (r41826)
@@ -387,6 +387,7 @@
context = Parrot_set_new_context(INTERP, sub->n_regs_used);
Parrot_pcc_set_sub(interp, context, SELF);
Parrot_pcc_set_continuation(interp, context, ccont);
+ Parrot_pcc_set_constants(interp, context, sub->seg->const_table->constants);
/* check recursion/call depth */
if (Parrot_pcc_inc_recursion_depth(INTERP, context) > INTERP->recursion_limit)
Modified: branches/pcc_reapply/t/src/extend.t
==============================================================================
--- branches/pcc_reapply/t/src/extend.t Sun Oct 11 18:12:43 2009 (r41825)
+++ branches/pcc_reapply/t/src/extend.t Sun Oct 11 20:17:13 2009 (r41826)
@@ -688,7 +688,7 @@
Parrot_pbc_load( interp, pf );
sub = Parrot_find_global_cur( interp, Parrot_str_new_constant( interp, "add" ) );
- result = Parrot_call_sub( interp, sub, "III", 100, 200 );
+ result = Parrot_call_sub_ret_int( interp, sub, "III", 100, 200 );
printf( "Result is %d.\\n", result );
Parrot_exit(interp, 0);
More information about the parrot-commits
mailing list