[svn:parrot] r40609 - in branches/pcc_arg_unify/src: call ops
allison at svn.parrot.org
allison at svn.parrot.org
Mon Aug 17 23:31:14 UTC 2009
Author: allison
Date: Mon Aug 17 23:31:14 2009
New Revision: 40609
URL: https://trac.parrot.org/parrot/changeset/40609
Log:
[pcc] Fix test failures due to call signature being collected when it's
still needed, and lingering on to interfere with later calls after it's
not needed anymore. (The gc_register_pmc should be unnecessary after
contexts properly mark their current_sig struct member. That may have to
wait until contexts become GC-able.)
Modified:
branches/pcc_arg_unify/src/call/pcc.c
branches/pcc_arg_unify/src/ops/core.ops
Modified: branches/pcc_arg_unify/src/call/pcc.c
==============================================================================
--- branches/pcc_arg_unify/src/call/pcc.c Mon Aug 17 23:21:11 2009 (r40608)
+++ branches/pcc_arg_unify/src/call/pcc.c Mon Aug 17 23:31:14 2009 (r40609)
@@ -418,8 +418,10 @@
INTVAL arg_count = VTABLE_elements(interp, raw_sig);
Parrot_Context *ctx = CONTEXT(interp);
- if (PMC_IS_NULL(signature))
+ if (PMC_IS_NULL(signature)) {
call_object = pmc_new(interp, enum_class_CallSignature);
+ gc_register_pmc(interp, call_object);
+ }
else
call_object = signature;
@@ -631,8 +633,10 @@
Parrot_Context *ctx = CONTEXT(interp);
PMC *returns = pmc_new(interp, enum_class_ResizablePMCArray);
- if (PMC_IS_NULL(signature))
+ if (PMC_IS_NULL(signature)) {
call_object = pmc_new(interp, enum_class_CallSignature);
+ gc_register_pmc(interp, call_object);
+ }
else
call_object = signature;
@@ -3754,8 +3758,9 @@
runops(interp, offset);
interp->run_core = old_core;
}
+ gc_unregister_pmc(interp, call_object);
+ ctx->current_sig = NULL;
Parrot_pop_context(interp);
-
}
Modified: branches/pcc_arg_unify/src/ops/core.ops
==============================================================================
--- branches/pcc_arg_unify/src/ops/core.ops Mon Aug 17 23:21:11 2009 (r40608)
+++ branches/pcc_arg_unify/src/ops/core.ops Mon Aug 17 23:31:14 2009 (r40609)
@@ -579,6 +579,9 @@
Parrot_pcc_fill_returns_from_op(interp, call_object, signature, raw_returns);
+ gc_unregister_pmc(interp, call_object);
+ CONTEXT(interp)->current_sig = NULL;
+
argc = VTABLE_elements(interp, signature);
goto OFFSET(argc + 2);
}
More information about the parrot-commits
mailing list