[svn:parrot] r36735 - in branches/rename_pccinvoke/src: call io
whiteknight at svn.parrot.org
whiteknight at svn.parrot.org
Sat Feb 14 21:03:41 UTC 2009
Author: whiteknight
Date: Sat Feb 14 21:03:39 2009
New Revision: 36735
URL: https://trac.parrot.org/parrot/changeset/36735
Log:
[rename_pccinvoke] finally make the conversion in src/api/io.c. temporary pmcs in Parrot_invoke_from_sig_obj were getting clobbered when we mixed recurssive PCC invokes and a GC run. Turning them into regular PMCs resolves this issue and everything goes smoothly
Modified:
branches/rename_pccinvoke/src/call/pcc.c
branches/rename_pccinvoke/src/io/api.c
Modified: branches/rename_pccinvoke/src/call/pcc.c
==============================================================================
--- branches/rename_pccinvoke/src/call/pcc.c Sat Feb 14 19:20:41 2009 (r36734)
+++ branches/rename_pccinvoke/src/call/pcc.c Sat Feb 14 21:03:39 2009 (r36735)
@@ -2926,8 +2926,8 @@
/* create the signature string, and the various PMCs that are needed to
store all the parameters and parameter counts. */
char * const signature = Parrot_str_to_cstring(interp, VTABLE_get_string(interp, sig_obj));
- PMC * const args_sig = temporary_pmc_new(interp, enum_class_FixedIntegerArray);
- PMC * const results_sig = temporary_pmc_new(interp, enum_class_FixedIntegerArray);
+ PMC * const args_sig = pmc_new(interp, enum_class_FixedIntegerArray);
+ PMC * const results_sig = pmc_new(interp, enum_class_FixedIntegerArray);
PMC * const ret_cont = new_ret_continuation_pmc(interp, NULL);
PMC * const result_list = VTABLE_get_attr_str(interp, sig_obj, CONST_STRING(interp, "returns"));
@@ -2997,9 +2997,6 @@
caller's context */
set_context_sig_returns(interp, ctx, indexes, ret_x, result_list);
- temporary_pmc_free(interp, args_sig);
- temporary_pmc_free(interp, results_sig);
-
interp->current_args = save_current_args;
interp->args_signature = save_args_signature;
interp->current_object = save_current_object;
Modified: branches/rename_pccinvoke/src/io/api.c
==============================================================================
--- branches/rename_pccinvoke/src/io/api.c Sat Feb 14 19:20:41 2009 (r36734)
+++ branches/rename_pccinvoke/src/io/api.c Sat Feb 14 21:03:39 2009 (r36735)
@@ -118,7 +118,7 @@
if (!mode)
mode = CONST_STRING(interp, "r");
- Parrot_PCCINVOKE(interp, new_filehandle, CONST_STRING(interp, "open"), "SS->P",
+ Parrot_pcc_invoke_method_from_c_args(interp, new_filehandle, CONST_STRING(interp, "open"), "SS->P",
path, mode, &new_filehandle);
return new_filehandle;
@@ -187,7 +187,7 @@
if (PMC_IS_NULL(pmc))
return -1;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
+ Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "close"), "->I", &result);
return result;
}
@@ -212,7 +212,7 @@
if (PMC_IS_NULL(pmc))
return 1;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
+ Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "is_closed"), "->I", &result);
return result;
}
@@ -234,7 +234,7 @@
if (PMC_IS_NULL(pmc))
return;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "flush"), "->");
+ Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "flush"), "->");
}
/*
@@ -256,7 +256,7 @@
{
ASSERT_ARGS(Parrot_io_reads)
STRING *result = NULL;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "read"), "I->S",
+ Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "read"), "I->S",
length, &result);
return result;
}
@@ -280,7 +280,7 @@
{
ASSERT_ARGS(Parrot_io_readline)
STRING *result = NULL;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "readline"), "->S",
+ Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "readline"), "->S",
&result);
return result;
}
@@ -411,7 +411,7 @@
if (PMC_IS_NULL(pmc))
return 1;
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "eof"), "->I",
+ Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "eof"), "->I",
&result);
return result;
@@ -457,7 +457,7 @@
Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_PIO_ERROR,
"Cannot write to null PMC");
- Parrot_PCCINVOKE(interp, pmc, CONST_STRING(interp, "puts"), "S->I",
+ Parrot_pcc_invoke_method_from_c_args(interp, pmc, CONST_STRING(interp, "puts"), "S->I",
s, &result);
return result;
More information about the parrot-commits
mailing list