From 083213a2f0e3e17015d6e0f333aa71228e4b4771 Mon Sep 17 00:00:00 2001 From: Andrew Whitworth Date: Tue, 16 Feb 2010 16:49:56 +0000 Subject: [PATCH] start rename of pmc_new to Parrot_pmc_new git-svn-id: https://svn.parrot.org/parrot/branches/pmc_func_cleanup@44031 d31e2699-5ff4-0310-a27c-f18f2fbe73fe --- compilers/imcc/parser_util.c | 2 +- compilers/imcc/pbc.c | 20 ++--- compilers/pirc/src/bcgen.c | 16 ++-- compilers/pirc/src/pircompunit.c | 6 +- compilers/pirc/src/piremit.c | 6 +- compilers/pirc/src/pirpcc.c | 2 +- src/dynext.c | 10 +-- src/embed.c | 6 +- src/exceptions.c | 4 +- src/extend.c | 6 +- src/frame_builder.c | 4 +- src/global.c | 4 +- src/global_setup.c | 14 ++-- src/hash.c | 6 +- src/hll.c | 14 ++-- src/key.c | 10 +-- src/library.c | 12 +-- src/multidispatch.c | 18 ++--- src/oo.c | 24 +++--- src/packfile.c | 12 +-- src/pmc.c | 62 ++++++++-------- src/pmc/arrayiterator.pmc | 2 +- src/pmc/bigint.pmc | 42 +++++------ src/pmc/bignum.pmc | 40 +++++----- src/pmc/callcontext.pmc | 16 ++-- src/pmc/capture.pmc | 6 +- src/pmc/class.pmc | 50 ++++++------- src/pmc/codestring.pmc | 2 +- src/pmc/complex.pmc | 118 +++++++++++++++--------------- src/pmc/continuation.pmc | 2 +- src/pmc/coroutine.pmc | 6 +- src/pmc/cpointer.pmc | 2 +- src/pmc/default.pmc | 22 +++--- src/pmc/env.pmc | 4 +- src/pmc/exception.pmc | 12 +-- src/pmc/exporter.pmc | 2 +- src/pmc/fixedbooleanarray.pmc | 8 +- src/pmc/fixedfloatarray.pmc | 8 +- src/pmc/fixedintegerarray.pmc | 10 +-- src/pmc/fixedpmcarray.pmc | 20 ++--- src/pmc/fixedstringarray.pmc | 6 +- src/pmc/float.pmc | 42 +++++------ src/pmc/hash.pmc | 12 +-- src/pmc/hashiterator.pmc | 2 +- src/pmc/imageio.pmc | 8 +- src/pmc/integer.pmc | 64 ++++++++-------- src/pmc/key.pmc | 2 +- src/pmc/lexinfo.pmc | 2 +- src/pmc/managedstruct.pmc | 2 +- src/pmc/namespace.pmc | 8 +- src/pmc/nci.pmc | 2 +- src/pmc/object.pmc | 4 +- src/pmc/orderedhash.pmc | 26 +++---- src/pmc/os.pmc | 6 +- src/pmc/packfile.pmc | 2 +- src/pmc/packfileannotations.pmc | 12 +-- src/pmc/packfileconstanttable.pmc | 4 +- src/pmc/packfiledirectory.pmc | 4 +- src/pmc/packfilefixuptable.pmc | 4 +- src/pmc/packfilerawsegment.pmc | 2 +- src/pmc/parrotinterpreter.pmc | 8 +- src/pmc/parrotlibrary.pmc | 2 +- src/pmc/pmcproxy.pmc | 26 +++---- src/pmc/pointer.pmc | 2 +- src/pmc/resizablebooleanarray.pmc | 2 +- src/pmc/resizablepmcarray.pmc | 12 +-- src/pmc/resizablestringarray.pmc | 14 ++-- src/pmc/role.pmc | 16 ++-- src/pmc/scalar.pmc | 56 +++++++------- src/pmc/scheduler.pmc | 10 +-- src/pmc/sockaddr.pmc | 2 +- src/pmc/string.pmc | 8 +- src/pmc/stringhandle.pmc | 2 +- src/pmc/stringiterator.pmc | 6 +- src/pmc/sub.pmc | 14 ++-- src/pmc/task.pmc | 14 ++-- src/pmc/undef.pmc | 4 +- src/pmc/unmanagedstruct.pmc | 4 +- src/pmc_freeze.c | 4 +- src/scheduler.c | 10 +-- src/sub.c | 4 +- src/thread.c | 8 +- src/utils.c | 2 +- 83 files changed, 537 insertions(+), 537 deletions(-) diff --git a/compilers/imcc/parser_util.c b/compilers/imcc/parser_util.c index 6d89e88aae..899f8acecb 100644 --- a/compilers/imcc/parser_util.c +++ b/compilers/imcc/parser_util.c @@ -703,7 +703,7 @@ imcc_compile(PARROT_INTERP, ARGIN(const char *s), int pasm_file, * * TODO if a sub was denoted :main return that instead */ - sub = pmc_new(interp, enum_class_Eval); + sub = Parrot_pmc_new(interp, enum_class_Eval); PMC_get_sub(interp, sub, sub_data); sub_data->seg = new_cs; sub_data->start_offs = 0; diff --git a/compilers/imcc/pbc.c b/compilers/imcc/pbc.c index 397f197def..06b797a918 100644 --- a/compilers/imcc/pbc.c +++ b/compilers/imcc/pbc.c @@ -1044,9 +1044,9 @@ mk_multi_sig(PARROT_INTERP, ARGIN(const SymReg *r)) /* a :multi sub with no arguments */ if (!pcc_sub->multi[0]) - return pmc_new(interp, enum_class_FixedIntegerArray); + return Parrot_pmc_new(interp, enum_class_FixedIntegerArray); - multi_sig = pmc_new(interp, enum_class_FixedPMCArray); + multi_sig = Parrot_pmc_new(interp, enum_class_FixedPMCArray); VTABLE_set_integer_native(interp, multi_sig, n); ct = interp->code->const_table; @@ -1061,11 +1061,11 @@ mk_multi_sig(PARROT_INTERP, ARGIN(const SymReg *r)) const INTVAL type_num = pmc_type(interp, type_name); if (type_num == enum_type_undef) { - sig_pmc = pmc_new(interp, enum_class_String); + sig_pmc = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, sig_pmc, type_name); } else { - sig_pmc = pmc_new(interp, enum_class_Integer); + sig_pmc = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, sig_pmc, type_num); } } @@ -1116,7 +1116,7 @@ create_lexinfo(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(PMC *sub_pmc), if (r->set == 'P' && r->usage & U_LEXICAL) { SymReg *n; if (!lex_info) { - lex_info = pmc_new_noinit(interp, lex_info_id); + lex_info = Parrot_pmc_new_noinit(interp, lex_info_id); VTABLE_init_pmc(interp, lex_info, sub_pmc); } @@ -1149,7 +1149,7 @@ create_lexinfo(PARROT_INTERP, ARGMOD(IMC_Unit *unit), ARGIN(PMC *sub_pmc), } if (!lex_info && (unit->outer || need_lex)) { - lex_info = pmc_new_noinit(interp, lex_info_id); + lex_info = Parrot_pmc_new_noinit(interp, lex_info_id); VTABLE_init_pmc(interp, lex_info, sub_pmc); } @@ -1297,7 +1297,7 @@ add_const_pmc_sub(PARROT_INTERP, ARGMOD(SymReg *r), size_t offs, size_t end) Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_NO_CLASS, "Class '%Ss' specified in :instanceof(...) not found", classname); - sub_pmc = pmc_new(interp, type); + sub_pmc = Parrot_pmc_new(interp, type); } } else { @@ -1305,7 +1305,7 @@ add_const_pmc_sub(PARROT_INTERP, ARGMOD(SymReg *r), size_t offs, size_t end) type = Parrot_get_ctx_HLL_type(interp, type); /* TODO create constant - see also src/packfile.c */ - sub_pmc = pmc_new(interp, type); + sub_pmc = Parrot_pmc_new(interp, type); } /* Set flags and get the sub info. */ @@ -1348,7 +1348,7 @@ add_const_pmc_sub(PARROT_INTERP, ARGMOD(SymReg *r), size_t offs, size_t end) ns_pmc = ct->constants[ns_const]->u.key; break; case PFC_STRING: - ns_pmc = constant_pmc_new(interp, enum_class_String); + ns_pmc = constant_Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, ns_pmc, ct->constants[ns_const]->u.string); break; default: @@ -1805,7 +1805,7 @@ make_pmc_const(PARROT_INTERP, ARGMOD(SymReg *r)) else s = Parrot_str_unescape(interp, r->name, 0, NULL); - p = constant_pmc_new(interp, r->pmc_type); + p = constant_Parrot_pmc_new(interp, r->pmc_type); switch (r->pmc_type) { case enum_class_Integer: diff --git a/compilers/pirc/src/bcgen.c b/compilers/pirc/src/bcgen.c index 9740f177b8..a46d331b18 100644 --- a/compilers/pirc/src/bcgen.c +++ b/compilers/pirc/src/bcgen.c @@ -798,10 +798,10 @@ generate_multi_signature(ARGIN(bytecode * const bc), /* A type_count of 1 means there was a :multi flag, but no :multi types. * therefore, create a special signature and return that. */ if (type_count == 1) - return pmc_new(bc->interp, enum_class_FixedIntegerArray); + return Parrot_pmc_new(bc->interp, enum_class_FixedIntegerArray); /* create a FixedPMCArray to store all multi types */ - multi_signature = pmc_new(bc->interp, enum_class_FixedPMCArray); + multi_signature = Parrot_pmc_new(bc->interp, enum_class_FixedPMCArray); /* set its size as specified in type_count */ VTABLE_set_integer_native(bc->interp, multi_signature, type_count); @@ -818,7 +818,7 @@ generate_multi_signature(ARGIN(bytecode * const bc), /* add the string to the constant table, retrieve a pointer to the STRING */ STRING * typestring = add_string_const_from_cstring(bc, types[i].entry.ident); /* create a new String PMC. */ - sig_pmc = pmc_new(bc->interp, enum_class_String); + sig_pmc = Parrot_pmc_new(bc->interp, enum_class_String); /* set the STRING in the String PMC */ VTABLE_set_string_native(bc->interp, sig_pmc, typestring); break; @@ -977,7 +977,7 @@ create_lexinfo(ARGIN(bytecode * const bc), ARGIN(PMC * sub), STRING * const method = string_from_literal(bc->interp, "declare_lex_preg"); /* create a lexinfo PMC */ - PMC * lex_info = pmc_new_noinit(bc->interp, lex_info_id); + PMC * lex_info = Parrot_pmc_new_noinit(bc->interp, lex_info_id); VTABLE_init_pmc(bc->interp, lex_info, sub); /* walk through the list of lexicals and register them */ @@ -1001,7 +1001,7 @@ create_lexinfo(ARGIN(bytecode * const bc), ARGIN(PMC * sub), * :lex flag, then create the lex_info anyway. */ if (lex_info == NULL && needlex) { - lex_info = pmc_new_noinit(bc->interp, lex_info_id); + lex_info = Parrot_pmc_new_noinit(bc->interp, lex_info_id); VTABLE_init_pmc(bc->interp, lex_info, sub); } @@ -1108,7 +1108,7 @@ get_namespace_pmc(ARGIN(bytecode * const bc), ARGIN_NULLOK(multi_type * const ns switch (ns->entry_type) { case MULTI_TYPE_IDENT: { - PMC *namespace_pmc = constant_pmc_new(bc->interp, enum_class_String); + PMC *namespace_pmc = constant_Parrot_pmc_new(bc->interp, enum_class_String); PARROT_NAMESPACE(namespace_pmc)->name = add_string_const_from_cstring(bc, ns->entry.ident); break; @@ -1161,7 +1161,7 @@ create_sub_pmc(ARGIN(bytecode * const bc), int iscoroutine, Parrot_ex_throw_from_c_args(bc->interp, NULL, EXCEPTION_NO_CLASS, "Requested sub class '%Ss' in :instanceof() not found", classname); - return pmc_new(bc->interp, type); + return Parrot_pmc_new(bc->interp, type); } } @@ -1175,7 +1175,7 @@ create_sub_pmc(ARGIN(bytecode * const bc), int iscoroutine, * TODO create constant - see also src/packfile.c * XXX is this (still) necessary? */ - return pmc_new(bc->interp, type); + return Parrot_pmc_new(bc->interp, type); } /* diff --git a/compilers/pirc/src/pircompunit.c b/compilers/pirc/src/pircompunit.c index 278960c6f0..5e6c83ff1a 100755 --- a/compilers/pirc/src/pircompunit.c +++ b/compilers/pirc/src/pircompunit.c @@ -1508,7 +1508,7 @@ new_pmc_const(lexer_state * const lexer, char const * const type, symbol *constsym = new_symbol(lexer, name, PMC_TYPE); target *consttarg = target_from_symbol(lexer, constsym); - PMC *intconst = pmc_new(lexer->interp, + PMC *intconst = Parrot_pmc_new(lexer->interp, Parrot_get_ctx_HLL_type(lexer->interp, enum_class_Integer)); int index = add_pmc_const(lexer->bc, intconst); VTABLE_set_integer_native(lexer->interp, intconst, value->val.ival); @@ -1543,7 +1543,7 @@ new_pmc_const(lexer_state * const lexer, char const * const type, symbol *constsym = new_symbol(lexer, name, PMC_TYPE); target *consttarg = target_from_symbol(lexer, constsym); - PMC *numconst = pmc_new(lexer->interp, + PMC *numconst = Parrot_pmc_new(lexer->interp, Parrot_get_ctx_HLL_type(lexer->interp, enum_class_Float)); int index = add_pmc_const(lexer->bc, numconst); VTABLE_set_number_native(lexer->interp, numconst, value->val.nval); @@ -1573,7 +1573,7 @@ new_pmc_const(lexer_state * const lexer, char const * const type, symbol *constsym = new_symbol(lexer, name, PMC_TYPE); target *consttarg = target_from_symbol(lexer, constsym); - PMC *strconst = pmc_new(lexer->interp, + PMC *strconst = Parrot_pmc_new(lexer->interp, Parrot_get_ctx_HLL_type(lexer->interp, enum_class_String)); int index = add_pmc_const(lexer->bc, strconst); diff --git a/compilers/pirc/src/piremit.c b/compilers/pirc/src/piremit.c index a4cfc575bb..27bf3797cf 100644 --- a/compilers/pirc/src/piremit.c +++ b/compilers/pirc/src/piremit.c @@ -686,7 +686,7 @@ optimize_instr(lexer_state * const lexer, instruction * const instr) { /* the last operand, which is the second in this case */ expression *second_operand = instr->operands; - PMC *intconst = pmc_new(lexer->interp, + PMC *intconst = Parrot_pmc_new(lexer->interp, Parrot_get_ctx_HLL_type(lexer->interp, enum_class_Integer)); int index = add_pmc_const(lexer->bc, intconst); VTABLE_set_integer_native(lexer->interp, intconst, second_operand->expr.c->val.ival); @@ -703,7 +703,7 @@ optimize_instr(lexer_state * const lexer, instruction * const instr) { /* the last operand, which is the second in this case */ expression *second_operand = instr->operands; - PMC *numconst = pmc_new(lexer->interp, + PMC *numconst = Parrot_pmc_new(lexer->interp, Parrot_get_ctx_HLL_type(lexer->interp, enum_class_Float)); int index = add_pmc_const(lexer->bc, numconst); VTABLE_set_number_native(lexer->interp, numconst, second_operand->expr.c->val.nval); @@ -721,7 +721,7 @@ optimize_instr(lexer_state * const lexer, instruction * const instr) { /* the last operand, which is the second in this case */ expression *second_operand = instr->operands; - PMC *strconst = pmc_new(lexer->interp, + PMC *strconst = Parrot_pmc_new(lexer->interp, Parrot_get_ctx_HLL_type(lexer->interp, enum_class_String)); int index = add_pmc_const(lexer->bc, strconst); diff --git a/compilers/pirc/src/pirpcc.c b/compilers/pirc/src/pirpcc.c index ca0f2cc13b..1f91562940 100644 --- a/compilers/pirc/src/pirpcc.c +++ b/compilers/pirc/src/pirpcc.c @@ -221,7 +221,7 @@ generate_signature_pmc(lexer_state * const lexer, unsigned size) { int array_index; /* flags and types are encoded in a FixedIntegerArray PMC */ - fixed_int_array = pmc_new(lexer->interp, enum_class_FixedIntegerArray); + fixed_int_array = Parrot_pmc_new(lexer->interp, enum_class_FixedIntegerArray); if (size > 0) /* can't resize a fixed integer array to 0 elements, default size is 0. */ VTABLE_set_integer_native(lexer->interp, fixed_int_array, size); diff --git a/src/dynext.c b/src/dynext.c index 8161ab7039..9a35734192 100644 --- a/src/dynext.c +++ b/src/dynext.c @@ -155,7 +155,7 @@ set_cstring_prop(PARROT_INTERP, ARGMOD(PMC *lib_pmc), ARGIN(const char *what), { ASSERT_ARGS(set_cstring_prop) STRING * const key = Parrot_str_new_constant(interp, what); - PMC * const prop = constant_pmc_new(interp, enum_class_String); + PMC * const prop = constant_Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, prop, name); VTABLE_setprop(interp, lib_pmc, key, prop); @@ -396,7 +396,7 @@ Parrot_init_lib(PARROT_INTERP, /* seems to be a native/NCI lib */ if (!load_func || !lib_pmc) - lib_pmc = constant_pmc_new(interp, enum_class_ParrotLibrary); + lib_pmc = constant_Parrot_pmc_new(interp, enum_class_ParrotLibrary); /* Call init, if it exists */ if (init_func) @@ -532,7 +532,7 @@ static PMC * make_string_pmc(PARROT_INTERP, ARGIN(STRING *string)) { ASSERT_ARGS(make_string_pmc) - PMC * const ret = constant_pmc_new(interp, enum_class_String); + PMC * const ret = constant_Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, ret, string); return ret; @@ -576,7 +576,7 @@ Parrot_clone_lib_into(ARGMOD(Interp *d), ARGMOD(Interp *s), ARGIN(PMC *lib_pmc)) * Anyways, if we hope to share bytecode at runtime, we need to have * them have identical opcodes anyways. */ - PMC * const new_lib_pmc = constant_pmc_new(d, enum_class_ParrotLibrary); + PMC * const new_lib_pmc = constant_Parrot_pmc_new(d, enum_class_ParrotLibrary); PMC_data(new_lib_pmc) = handle; VTABLE_setprop(d, new_lib_pmc, CONST_STRING(s, "_filename"), make_string_pmc(d, wo_ext)); @@ -668,7 +668,7 @@ Parrot_load_lib(PARROT_INTERP, ARGIN_NULLOK(STRING *lib), SHIM(PMC *initializer) * XXX Parrot_ex_throw_from_c_args? return PMCNULL? * PMC Undef seems convenient, because it can be queried with get_bool() */ - return pmc_new(interp, enum_class_Undef); + return Parrot_pmc_new(interp, enum_class_Undef); } return run_init_lib(interp, handle, lib_name, wo_ext); diff --git a/src/embed.c b/src/embed.c index 43e8fc1c24..f0e42c665d 100644 --- a/src/embed.c +++ b/src/embed.c @@ -186,7 +186,7 @@ PARROT_EXPORT void Parrot_set_executable_name(PARROT_INTERP, Parrot_String name) { - PMC * const name_pmc = pmc_new(interp, enum_class_String); + PMC * const name_pmc = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, name_pmc, name); VTABLE_set_pmc_keyed_int(interp, interp->iglobals, IGLOBALS_EXECUTABLE, name_pmc); @@ -635,7 +635,7 @@ static PMC* setup_argv(PARROT_INTERP, int argc, ARGIN(char **argv)) { ASSERT_ARGS(setup_argv) - PMC *userargv = pmc_new(interp, enum_class_ResizableStringArray); + PMC *userargv = Parrot_pmc_new(interp, enum_class_ResizableStringArray); INTVAL i; if (Interp_debug_TEST(interp, PARROT_START_DEBUG_FLAG)) { @@ -763,7 +763,7 @@ set_current_sub(PARROT_INTERP) /* If we didn't find anything, put a dummy PMC into current_sub. The default values set by SUb.init are appropiate for the dummy, don't need additional settings. */ - sub_pmc = pmc_new(interp, enum_class_Sub); + sub_pmc = Parrot_pmc_new(interp, enum_class_Sub); Parrot_pcc_set_sub(interp, CURRENT_CONTEXT(interp), sub_pmc); return sub_pmc; diff --git a/src/exceptions.c b/src/exceptions.c index 9d5edeabd9..f3e70f2f94 100644 --- a/src/exceptions.c +++ b/src/exceptions.c @@ -68,7 +68,7 @@ Parrot_ex_build_exception(PARROT_INTERP, INTVAL severity, long error, ARGIN_NULLOK(STRING *msg)) { ASSERT_ARGS(Parrot_ex_build_exception) - PMC *exception = pmc_new(interp, enum_class_Exception); + PMC *exception = Parrot_pmc_new(interp, enum_class_Exception); VTABLE_set_integer_keyed_str(interp, exception, CONST_STRING(interp, "severity"), severity); VTABLE_set_integer_keyed_str(interp, exception, CONST_STRING(interp, "type"), error); @@ -176,7 +176,7 @@ void Parrot_ex_add_c_handler(PARROT_INTERP, ARGIN(Parrot_runloop *jp)) { ASSERT_ARGS(Parrot_ex_add_c_handler) - PMC * const handler = pmc_new(interp, enum_class_ExceptionHandler); + PMC * const handler = Parrot_pmc_new(interp, enum_class_ExceptionHandler); /* Flag to mark a C exception handler */ PObj_get_FLAGS(handler) |= SUB_FLAG_C_HANDLER; VTABLE_set_pointer(interp, handler, jp); diff --git a/src/extend.c b/src/extend.c index e45058ca8c..83db8e3017 100644 --- a/src/extend.c +++ b/src/extend.c @@ -945,7 +945,7 @@ Parrot_PMC_new(PARROT_INTERP, Parrot_Int type) ASSERT_ARGS(Parrot_PMC_new) Parrot_PMC newpmc; PARROT_CALLIN_START(interp); - newpmc = pmc_new_noinit(interp, type); + newpmc = Parrot_pmc_new_noinit(interp, type); VTABLE_init(interp, newpmc); PARROT_CALLIN_END(interp); return newpmc; @@ -1473,7 +1473,7 @@ Parrot_sub_new_from_c_func(PARROT_INTERP, ASSERT_ARGS(Parrot_sub_new_from_c_func) Parrot_String sig = Parrot_new_string(interp, signature, strlen(signature), (char *) NULL, 0); - Parrot_PMC sub = pmc_new(interp, enum_class_NCI); + Parrot_PMC sub = Parrot_pmc_new(interp, enum_class_NCI); VTABLE_set_pointer_keyed_str(interp, sub, sig, F2DPTR(func)); PObj_get_FLAGS(sub) |= PObj_private1_FLAG; return sub; @@ -1497,7 +1497,7 @@ Parrot_PMC_newclass(PARROT_INTERP, Parrot_PMC classtype) Parrot_PMC result; PARROT_CALLIN_START(interp); - result = pmc_new_init(interp, enum_class_Class, classtype); + result = Parrot_pmc_new_init(interp, enum_class_Class, classtype); PARROT_CALLIN_END(interp); return result; diff --git a/src/frame_builder.c b/src/frame_builder.c index 8a969484fb..0e0a9bb8ae 100644 --- a/src/frame_builder.c +++ b/src/frame_builder.c @@ -62,7 +62,7 @@ It is called by the ManagedStruct PMC's clone() function. PMC * Parrot_jit_clone_buffer(PARROT_INTERP, PMC *pmc, void *priv) { - PMC * const rv = pmc_new(interp, pmc->vtable->base_type); + PMC * const rv = Parrot_pmc_new(interp, pmc->vtable->base_type); VTABLE_init(interp, rv); /* copy the attributes */ @@ -550,7 +550,7 @@ Parrot_jit_build_call_func(PARROT_INTERP, PMC *pmc_nci, STRING *signature, int * /* make new pmc */ emitm_movl_i_m(pc, enum_class_UnManagedStruct, emit_EBP, 0, 1, temp_calls_offset + 4); - emitm_call_cfunc(pc, pmc_new); + emitm_call_cfunc(pc, Parrot_pmc_new); /* restore pointer p to EDX */ emitm_movl_m_r(interp, pc, emit_EDX, emit_EBP, 0, 1, temp_calls_offset + 12); diff --git a/src/global.c b/src/global.c index 9b3aa15158..f7ff407f42 100644 --- a/src/global.c +++ b/src/global.c @@ -249,7 +249,7 @@ internal_ns_maybe_create(PARROT_INTERP, ARGIN(PMC *ns), ARGIN(STRING *key), int return PMCNULL; /* TT #1221 - match HLL of enclosing namespace? */ - sub_ns = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, + sub_ns = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_NameSpace)); if (PMC_IS_NULL(sub_ns)) @@ -765,7 +765,7 @@ store_sub_in_multi(PARROT_INTERP, ARGIN(PMC *sub_pmc), ARGIN(PMC *ns)) /* is there an existing MultiSub PMC? or do we need to create one? */ if (PMC_IS_NULL(multisub)) { - multisub = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_MultiSub)); + multisub = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_MultiSub)); /* we have to push the sub onto the MultiSub before we try to store it because storing requires information from the sub */ VTABLE_push_pmc(interp, multisub, sub_pmc); diff --git a/src/global_setup.c b/src/global_setup.c index ea85842675..3ccaa80388 100644 --- a/src/global_setup.c +++ b/src/global_setup.c @@ -104,7 +104,7 @@ parrot_set_config_hash_interpreter(PARROT_INTERP) config_hash = Parrot_thaw(interp, config_string); } else { - config_hash = pmc_new(interp, enum_class_Hash); + config_hash = Parrot_pmc_new(interp, enum_class_Hash); } VTABLE_set_pmc_keyed_int(interp, iglobals, @@ -172,7 +172,7 @@ init_world(PARROT_INTERP) VTABLE_set_pmc_keyed_int(interp, iglobals, (INTVAL)IGLOBALS_CLASSNAME_HASH, interp->class_hash); - self = pmc_new_noinit(interp, enum_class_ParrotInterpreter); + self = Parrot_pmc_new_noinit(interp, enum_class_ParrotInterpreter); VTABLE_set_pointer(interp, self, interp); /* PMC_data(self) = interp; */ @@ -185,10 +185,10 @@ init_world(PARROT_INTERP) parrot_init_library_paths(interp); /* load_bytecode and dynlib loaded hash */ - pmc = pmc_new(interp, enum_class_Hash); + pmc = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pmc_keyed_int(interp, iglobals, IGLOBALS_PBC_LIBS, pmc); - pmc = pmc_new(interp, enum_class_Hash); + pmc = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pmc_keyed_int(interp, iglobals, IGLOBALS_DYN_LIBS, pmc); } @@ -212,18 +212,18 @@ parrot_global_setup_2(PARROT_INTERP) create_initial_context(interp); /* create the namespace root stash */ - interp->root_namespace = pmc_new(interp, enum_class_NameSpace); + interp->root_namespace = Parrot_pmc_new(interp, enum_class_NameSpace); Parrot_init_HLL(interp); Parrot_pcc_set_namespace(interp, CURRENT_CONTEXT(interp), VTABLE_get_pmc_keyed_int(interp, interp->HLL_namespace, 0)); /* We need a class hash */ - interp->class_hash = classname_hash = pmc_new(interp, enum_class_NameSpace); + interp->class_hash = classname_hash = Parrot_pmc_new(interp, enum_class_NameSpace); Parrot_register_core_pmcs(interp, classname_hash); /* init the interpreter globals array */ - iglobals = pmc_new(interp, enum_class_FixedPMCArray); + iglobals = Parrot_pmc_new(interp, enum_class_FixedPMCArray); interp->iglobals = iglobals; VTABLE_set_integer_native(interp, iglobals, (INTVAL)IGLOBALS_SIZE); diff --git a/src/hash.c b/src/hash.c index 412b6c7e9e..046ed268b4 100644 --- a/src/hash.c +++ b/src/hash.c @@ -1446,7 +1446,7 @@ PMC* get_integer_pmc(PARROT_INTERP, INTVAL value) { ASSERT_ARGS(get_integer_pmc) - PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer)); + PMC * const ret = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer)); VTABLE_set_integer_native(interp, ret, value); return ret; } @@ -1467,7 +1467,7 @@ PMC* get_number_pmc(PARROT_INTERP, FLOATVAL value) { ASSERT_ARGS(get_number_pmc) - PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Float)); + PMC * const ret = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Float)); VTABLE_set_number_native(interp, ret, value); return ret; } @@ -1487,7 +1487,7 @@ PMC * get_string_pmc(PARROT_INTERP, ARGIN(STRING *value)) { ASSERT_ARGS(get_string_pmc) - PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String)); + PMC * const ret = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String)); VTABLE_set_string_native(interp, ret, value); return ret; } diff --git a/src/hll.c b/src/hll.c index 203f39d0a6..2b4ce2d322 100644 --- a/src/hll.c +++ b/src/hll.c @@ -88,7 +88,7 @@ new_hll_entry(PARROT_INTERP, ARGIN_NULLOK(STRING *entry_name)) PMC *entry_id; - PMC * const entry = constant_pmc_new(interp, enum_class_FixedPMCArray); + PMC * const entry = constant_Parrot_pmc_new(interp, enum_class_FixedPMCArray); if (entry_name && !STRING_IS_EMPTY(entry_name)) { VTABLE_set_pmc_keyed_str(interp, hll_info, entry_name, entry); @@ -98,7 +98,7 @@ new_hll_entry(PARROT_INTERP, ARGIN_NULLOK(STRING *entry_name)) VTABLE_set_integer_native(interp, entry, e_HLL_MAX); - entry_id = constant_pmc_new(interp, enum_class_Integer); + entry_id = constant_Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, entry_id, id); VTABLE_set_pmc_keyed_int(interp, entry, e_HLL_id, entry_id); @@ -122,9 +122,9 @@ Parrot_init_HLL(PARROT_INTERP) { ASSERT_ARGS(Parrot_init_HLL) interp->HLL_info = - pmc_new(interp, enum_class_OrderedHash); + Parrot_pmc_new(interp, enum_class_OrderedHash); interp->HLL_namespace = - constant_pmc_new(interp, enum_class_ResizablePMCArray); + constant_Parrot_pmc_new(interp, enum_class_ResizablePMCArray); Parrot_register_HLL(interp, CONST_STRING(interp, "parrot")); } @@ -168,7 +168,7 @@ Parrot_register_HLL(PARROT_INTERP, ARGIN(STRING *hll_name)) entry = new_hll_entry(interp, hll_name); /* register HLL name */ - name = constant_pmc_new(interp, enum_class_String); + name = constant_Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, name, hll_name); VTABLE_set_pmc_keyed_int(interp, entry, e_HLL_name, name); @@ -188,7 +188,7 @@ Parrot_register_HLL(PARROT_INTERP, ARGIN(STRING *hll_name)) VTABLE_set_pmc_keyed_int(interp, interp->HLL_namespace, idx, ns_hash); /* create HLL typemap hash */ - type_hash = constant_pmc_new(interp, enum_class_Hash); + type_hash = constant_Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pointer(interp, type_hash, parrot_new_intval_hash(interp)); VTABLE_set_pmc_keyed_int(interp, entry, e_HLL_typemap, type_hash); @@ -243,7 +243,7 @@ Parrot_register_HLL_lib(PARROT_INTERP, ARGIN(STRING *hll_lib)) VTABLE_set_pmc_keyed_int(interp, entry, e_HLL_name, PMCNULL); /* register dynlib */ - name = constant_pmc_new(interp, enum_class_String); + name = constant_Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, name, hll_lib); VTABLE_set_pmc_keyed_int(interp, entry, e_HLL_lib, name); diff --git a/src/key.c b/src/key.c index 97319776f2..6702a76050 100644 --- a/src/key.c +++ b/src/key.c @@ -43,7 +43,7 @@ PMC * key_new(PARROT_INTERP) { ASSERT_ARGS(key_new) - return pmc_new(interp, enum_class_Key); + return Parrot_pmc_new(interp, enum_class_Key); } @@ -64,7 +64,7 @@ PMC * key_new_integer(PARROT_INTERP, INTVAL value) { ASSERT_ARGS(key_new_integer) - PMC * const key = pmc_new(interp, enum_class_Key); + PMC * const key = Parrot_pmc_new(interp, enum_class_Key); PObj_get_FLAGS(key) |= KEY_integer_FLAG; SETATTR_Key_int_key(interp, key, value); @@ -90,7 +90,7 @@ PMC * key_new_number(PARROT_INTERP, FLOATVAL value) { ASSERT_ARGS(key_new_number) - PMC * const key = pmc_new(interp, enum_class_Key); + PMC * const key = Parrot_pmc_new(interp, enum_class_Key); PObj_get_FLAGS(key) |= KEY_number_FLAG; SETATTR_Key_num_key(interp, key, value); @@ -116,7 +116,7 @@ PMC * key_new_string(PARROT_INTERP, ARGIN(STRING *value)) { ASSERT_ARGS(key_new_string) - PMC * const key = pmc_new(interp, enum_class_Key); + PMC * const key = Parrot_pmc_new(interp, enum_class_Key); PObj_get_FLAGS(key) |= KEY_string_FLAG; SETATTR_Key_str_key(interp, key, value); @@ -164,7 +164,7 @@ PMC * key_new_pmc(PARROT_INTERP, ARGIN(PMC *value)) { ASSERT_ARGS(key_new_pmc) - PMC * const key = pmc_new(interp, enum_class_Key); + PMC * const key = Parrot_pmc_new(interp, enum_class_Key); PObj_get_FLAGS(key) |= KEY_pmc_FLAG; Parrot_ex_throw_from_c_args(interp, NULL, 1, "this is broken - see slice.pmc"); diff --git a/src/library.c b/src/library.c index c853026e25..22baf12c48 100644 --- a/src/library.c +++ b/src/library.c @@ -168,7 +168,7 @@ parrot_init_library_paths(PARROT_INTERP) (INTVAL)IGLOBALS_CONFIG_HASH); /* create the lib_paths array */ - PMC * const lib_paths = pmc_new(interp, enum_class_FixedPMCArray); + PMC * const lib_paths = Parrot_pmc_new(interp, enum_class_FixedPMCArray); VTABLE_set_integer_native(interp, lib_paths, PARROT_LIB_PATH_SIZE); VTABLE_set_pmc_keyed_int(interp, iglobals, @@ -191,7 +191,7 @@ parrot_init_library_paths(PARROT_INTERP) /* each is an array of strings */ /* define include paths */ - paths = pmc_new(interp, enum_class_ResizableStringArray); + paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); VTABLE_set_pmc_keyed_int(interp, lib_paths, PARROT_LIB_PATH_INCLUDE, paths); if (!STRING_IS_NULL(builddir)) { @@ -209,7 +209,7 @@ parrot_init_library_paths(PARROT_INTERP) /* define library paths */ - paths = pmc_new(interp, enum_class_ResizableStringArray); + paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); VTABLE_set_pmc_keyed_int(interp, lib_paths, PARROT_LIB_PATH_LIBRARY, paths); if (!STRING_IS_NULL(builddir)) { @@ -224,7 +224,7 @@ parrot_init_library_paths(PARROT_INTERP) } /* define languages paths */ - paths = pmc_new(interp, enum_class_ResizableStringArray); + paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); VTABLE_set_pmc_keyed_int(interp, lib_paths, PARROT_LIB_PATH_LANG, paths); if (!STRING_IS_NULL(builddir)) { @@ -239,7 +239,7 @@ parrot_init_library_paths(PARROT_INTERP) } /* define dynext paths */ - paths = pmc_new(interp, enum_class_ResizableStringArray); + paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); VTABLE_set_pmc_keyed_int(interp, lib_paths, PARROT_LIB_PATH_DYNEXT, paths); if (!STRING_IS_NULL(builddir)) { @@ -254,7 +254,7 @@ parrot_init_library_paths(PARROT_INTERP) } /* shared exts */ - paths = pmc_new(interp, enum_class_ResizableStringArray); + paths = Parrot_pmc_new(interp, enum_class_ResizableStringArray); VTABLE_set_pmc_keyed_int(interp, lib_paths, PARROT_LIB_DYN_EXTS, paths); /* no CONST_STRING here - the c2str.pl preprocessor needs "real strs" */ diff --git a/src/multidispatch.c b/src/multidispatch.c index 9aa531b1ad..22e6601b7e 100644 --- a/src/multidispatch.c +++ b/src/multidispatch.c @@ -255,7 +255,7 @@ PMC* Parrot_mmd_find_multi_from_sig_obj(PARROT_INTERP, ARGIN(STRING *name), ARGIN(PMC *invoke_sig)) { ASSERT_ARGS(Parrot_mmd_find_multi_from_sig_obj) - PMC * const candidate_list = pmc_new(interp, enum_class_ResizablePMCArray); + PMC * const candidate_list = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); mmd_search_by_sig_obj(interp, name, invoke_sig, candidate_list); mmd_search_global(interp, name, candidate_list); @@ -442,7 +442,7 @@ static PMC* mmd_build_type_tuple_from_type_list(PARROT_INTERP, ARGIN(PMC *type_list)) { ASSERT_ARGS(mmd_build_type_tuple_from_type_list) - PMC *multi_sig = constant_pmc_new(interp, enum_class_FixedIntegerArray); + PMC *multi_sig = constant_Parrot_pmc_new(interp, enum_class_FixedIntegerArray); INTVAL param_count = VTABLE_elements(interp, type_list); INTVAL i; @@ -513,7 +513,7 @@ PMC* Parrot_mmd_build_type_tuple_from_sig_obj(PARROT_INTERP, ARGIN(PMC *sig_obj)) { ASSERT_ARGS(Parrot_mmd_build_type_tuple_from_sig_obj) - PMC * const type_tuple = pmc_new(interp, enum_class_ResizableIntegerArray); + PMC * const type_tuple = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray); STRING *string_sig = VTABLE_get_string(interp, sig_obj); INTVAL tuple_size = 0; INTVAL args_ended = 0; @@ -646,7 +646,7 @@ mmd_cvt_to_types(PARROT_INTERP, ARGIN(PMC *multi_sig)) /* create destination PMC only as necessary */ if (PMC_IS_NULL(ar)) { - ar = pmc_new(interp, enum_class_FixedIntegerArray); + ar = Parrot_pmc_new(interp, enum_class_FixedIntegerArray); VTABLE_set_integer_native(interp, ar, n); } @@ -899,7 +899,7 @@ static PMC* Parrot_mmd_search_scopes(PARROT_INTERP, ARGIN(STRING *meth)) { ASSERT_ARGS(Parrot_mmd_search_scopes) - PMC * const candidates = pmc_new(interp, enum_class_ResizablePMCArray); + PMC * const candidates = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); const int stop = mmd_search_local(interp, meth, candidates); if (!stop) @@ -1061,7 +1061,7 @@ mmd_add_multi_global(PARROT_INTERP, ARGIN(STRING *sub_name), ARGIN(PMC *sub_obj) PMC *multi_sub = Parrot_get_global(interp, ns, sub_name); if (PMC_IS_NULL(multi_sub)) { - multi_sub = constant_pmc_new(interp, enum_class_MultiSub); + multi_sub = constant_Parrot_pmc_new(interp, enum_class_MultiSub); Parrot_set_global(interp, ns, sub_name, multi_sub); } @@ -1094,7 +1094,7 @@ mmd_add_multi_to_namespace(PARROT_INTERP, ARGIN(STRING *ns_name), PMC *multi_sub = Parrot_get_global(interp, ns, sub_name); if (PMC_IS_NULL(multi_sub)) { - multi_sub = constant_pmc_new(interp, enum_class_MultiSub); + multi_sub = constant_Parrot_pmc_new(interp, enum_class_MultiSub); Parrot_set_global(interp, ns, sub_name, multi_sub); } @@ -1172,7 +1172,7 @@ Parrot_mmd_add_multi_from_c_args(PARROT_INTERP, STRING *ns_name = VTABLE_get_string_keyed_int(interp, type_list, 0); /* Create an NCI sub for the C function */ - PMC *sub_obj = constant_pmc_new(interp, enum_class_NCI); + PMC *sub_obj = constant_Parrot_pmc_new(interp, enum_class_NCI); PMC *multi_sig = mmd_build_type_tuple_from_long_sig(interp, long_sig_str); @@ -1219,7 +1219,7 @@ Parrot_mmd_add_multi_list_from_c_args(PARROT_INTERP, STRING *ns_name = mmd_info[i].ns_name; /* Create an NCI sub for the C function */ - PMC *sub_obj = constant_pmc_new(interp, enum_class_NCI); + PMC *sub_obj = constant_Parrot_pmc_new(interp, enum_class_NCI); VTABLE_set_pointer_keyed_str(interp, sub_obj, short_sig, F2DPTR(func_ptr)); diff --git a/src/oo.c b/src/oo.c index a97a688799..9298eff786 100644 --- a/src/oo.c +++ b/src/oo.c @@ -280,7 +280,7 @@ Parrot_oo_clone_object(PARROT_INTERP, ARGIN(PMC *pmc), } else { obj = PARROT_OBJECT(pmc); - cloned = pmc_new_noinit(interp, enum_class_Object); + cloned = Parrot_pmc_new_noinit(interp, enum_class_Object); } _class = PARROT_CLASS(obj->_class); @@ -371,9 +371,9 @@ get_pmc_proxy(PARROT_INTERP, INTVAL type) /* Create proxy if not found */ if (PMC_IS_NULL(proxy)) { - PMC * const type_num = pmc_new(interp, enum_class_Integer); + PMC * const type_num = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, type_num, type); - proxy = pmc_new_init(interp, enum_class_PMCProxy, type_num); + proxy = Parrot_pmc_new_init(interp, enum_class_PMCProxy, type_num); Parrot_pcc_invoke_method_from_c_args(interp, pmc_ns, CONST_STRING(interp, "set_class"), "P->", proxy); } return proxy; @@ -434,14 +434,14 @@ PMC * Parrot_oo_newclass_from_str(PARROT_INTERP, ARGIN(STRING *name)) { ASSERT_ARGS(Parrot_oo_newclass_from_str) - PMC * const namearg = pmc_new(interp, enum_class_String); - PMC * const namehash = pmc_new(interp, enum_class_Hash); + PMC * const namearg = Parrot_pmc_new(interp, enum_class_String); + PMC * const namehash = Parrot_pmc_new(interp, enum_class_Hash); PMC *classobj; VTABLE_set_string_native(interp, namearg, name); VTABLE_set_pmc_keyed_str(interp, namehash, CONST_STRING(interp, "name"), namearg); - classobj = pmc_new_init(interp, enum_class_Class, namehash); + classobj = Parrot_pmc_new_init(interp, enum_class_Class, namehash); PARROT_ASSERT(classobj); return classobj; @@ -516,7 +516,7 @@ Parrot_oo_find_vtable_override(PARROT_INTERP, break; } if (PMC_IS_NULL(result)) - result = pmc_new(interp, enum_class_Undef); + result = Parrot_pmc_new(interp, enum_class_Undef); VTABLE_set_pmc_keyed_str(interp, _class->parent_overrides, name, result); } if (result->vtable->base_type == enum_class_Undef) @@ -683,7 +683,7 @@ Parrot_oo_register_type(PARROT_INTERP, ARGIN(PMC *name), ARGIN(PMC *_namespace)) { if (!typeid_exists) { PMC * const classname_hash = interp->class_hash; - PMC * const item = pmc_new(interp, enum_class_Integer); + PMC * const item = Parrot_pmc_new(interp, enum_class_Integer); /* set entry in name->type hash */ VTABLE_set_integer_native(interp, item, type); @@ -1159,7 +1159,7 @@ C3_merge(PARROT_INTERP, ARGIN(PMC *merge_list)) /* If we never found any candidates, return an empty list. */ if (cand_count == 0) - return pmc_new(interp, enum_class_ResizablePMCArray); + return Parrot_pmc_new(interp, enum_class_ResizablePMCArray); /* If we didn't find anything to accept, error. */ if (PMC_IS_NULL(accepted)) @@ -1229,7 +1229,7 @@ Parrot_ComputeMRO_C3(PARROT_INTERP, ARGIN(PMC *_class)) if (parent_count == 0) { /* No parents - MRO just contains this class. */ - result = pmc_new(interp, enum_class_ResizablePMCArray); + result = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); VTABLE_push_pmc(interp, result, _class); return result; } @@ -1246,7 +1246,7 @@ Parrot_ComputeMRO_C3(PARROT_INTERP, ARGIN(PMC *_class)) /* instantiated lazily */ if (PMC_IS_NULL(merge_list)) - merge_list = pmc_new(interp, enum_class_ResizablePMCArray); + merge_list = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); VTABLE_push_pmc(interp, merge_list, lin); } @@ -1318,7 +1318,7 @@ Parrot_ComposeRole(PARROT_INTERP, ARGIN(PMC *role), /* We need to check for conflicts before we do the composition. We * put each method that would be OK to add into a proposal list, and * bail out right away if we find a problem. */ - proposed_add_methods = pmc_new(interp, enum_class_Hash); + proposed_add_methods = Parrot_pmc_new(interp, enum_class_Hash); methods_iter = VTABLE_get_iter(interp, methods); while (VTABLE_get_bool(interp, methods_iter)) { diff --git a/src/packfile.c b/src/packfile.c index b391e5f24c..53d2641f2a 100644 --- a/src/packfile.c +++ b/src/packfile.c @@ -4059,11 +4059,11 @@ PackFile_Constant_unpack_key(PARROT_INTERP, ARGIN(PackFile_ConstTable *constt), opcode_t op; if (tail) { - SETATTR_Key_next_key(interp, tail, constant_pmc_new(interp, pmc_enum)); + SETATTR_Key_next_key(interp, tail, constant_Parrot_pmc_new(interp, pmc_enum)); GETATTR_Key_next_key(interp, tail, tail); } else - head = tail = constant_pmc_new(interp, pmc_enum); + head = tail = constant_Parrot_pmc_new(interp, pmc_enum); op = PF_fetch_opcode(pf, &cursor); @@ -4547,16 +4547,16 @@ make_annotation_value_pmc(PARROT_INTERP, ARGIN(PackFile_Annotations *self), switch (type) { case PF_ANNOTATION_KEY_TYPE_INT: - result = pmc_new(interp, enum_class_Integer); + result = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, result, value); break; case PF_ANNOTATION_KEY_TYPE_NUM: - result = pmc_new(interp, enum_class_Float); + result = Parrot_pmc_new(interp, enum_class_Float); VTABLE_set_number_native(interp, result, PF_CONST(self->code, value)->u.number); break; default: - result = pmc_new(interp, enum_class_String); + result = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, result, PF_CONST(self->code, value)->u.string); } @@ -4628,7 +4628,7 @@ PackFile_Annotations_lookup(PARROT_INTERP, ARGIN(PackFile_Annotations *self), } /* Create hash of values we have. */ - result = pmc_new(interp, enum_class_Hash); + result = Parrot_pmc_new(interp, enum_class_Hash); for (i = 0; i < self->num_keys; i++) { if (have_values[i]) { diff --git a/src/pmc.c b/src/pmc.c index 6cd2f68d9b..32513b9518 100644 --- a/src/pmc.c +++ b/src/pmc.c @@ -135,7 +135,7 @@ Parrot_pmc_destroy(PARROT_INTERP, ARGMOD(PMC *pmc)) /* -=item C +=item C Creates a new PMC of type C (which is an index into the list of PMC types declared in C in F). Once the PMC has been @@ -150,9 +150,9 @@ PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PARROT_WARN_UNUSED_RESULT PMC * -pmc_new(PARROT_INTERP, INTVAL base_type) +Parrot_pmc_new(PARROT_INTERP, INTVAL base_type) { - ASSERT_ARGS(pmc_new) + ASSERT_ARGS(Parrot_pmc_new) PARROT_ASSERT(interp->vtables[base_type]); { PMC *const classobj = interp->vtables[base_type]->pmc_class; @@ -466,11 +466,11 @@ get_new_pmc_header(PARROT_INTERP, INTVAL base_type, UINTVAL flags) /* -=item C +=item C Creates a new PMC of type C (which is an index into the list of PMC -types declared in C in F). Unlike C, -C does not call its C method. This allows separate +types declared in C in F). Unlike C, +C does not call its C method. This allows separate allocation and initialization for continuations. =cut @@ -480,9 +480,9 @@ allocation and initialization for continuations. PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PMC * -pmc_new_noinit(PARROT_INTERP, INTVAL base_type) +Parrot_pmc_new_noinit(PARROT_INTERP, INTVAL base_type) { - ASSERT_ARGS(pmc_new_noinit) + ASSERT_ARGS(Parrot_pmc_new_noinit) PMC *const classobj = interp->vtables[base_type]->pmc_class; if (!PMC_IS_NULL(classobj) && PObj_is_class_TEST(classobj)) @@ -494,7 +494,7 @@ pmc_new_noinit(PARROT_INTERP, INTVAL base_type) /* -=item C +=item C Creates a new constant PMC of type C. @@ -505,16 +505,16 @@ Creates a new constant PMC of type C. PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PMC * -constant_pmc_new_noinit(PARROT_INTERP, INTVAL base_type) +constant_Parrot_pmc_new_noinit(PARROT_INTERP, INTVAL base_type) { - ASSERT_ARGS(constant_pmc_new_noinit) + ASSERT_ARGS(constant_Parrot_pmc_new_noinit) return get_new_pmc_header(interp, base_type, PObj_constant_FLAG); } /* -=item C +=item C Creates a new constant PMC of type C, then calls its C. @@ -525,9 +525,9 @@ Creates a new constant PMC of type C, then calls its C. PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PMC * -constant_pmc_new(PARROT_INTERP, INTVAL base_type) +constant_Parrot_pmc_new(PARROT_INTERP, INTVAL base_type) { - ASSERT_ARGS(constant_pmc_new) + ASSERT_ARGS(constant_Parrot_pmc_new) PMC * const pmc = get_new_pmc_header(interp, base_type, PObj_constant_FLAG); VTABLE_init(interp, pmc); return pmc; @@ -536,9 +536,9 @@ constant_pmc_new(PARROT_INTERP, INTVAL base_type) /* -=item C +=item C -As C, but passes C to the PMC's C vtable entry. +As C, but passes C to the PMC's C vtable entry. =cut @@ -547,9 +547,9 @@ As C, but passes C to the PMC's C vtable entry. PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PMC * -pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGOUT(PMC *init)) +Parrot_pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGOUT(PMC *init)) { - ASSERT_ARGS(pmc_new_init) + ASSERT_ARGS(Parrot_pmc_new_init) PMC *const classobj = interp->vtables[base_type]->pmc_class; if (!PMC_IS_NULL(classobj) && PObj_is_class_TEST(classobj)) @@ -564,9 +564,9 @@ pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGOUT(PMC *init)) /* -=item C +=item C -As C, but passes C to the PMC's C vtable +As C, but passes C to the PMC's C vtable entry. =cut @@ -576,9 +576,9 @@ entry. PARROT_EXPORT PARROT_CANNOT_RETURN_NULL PMC * -constant_pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGIN_NULLOK(PMC *init)) +constant_Parrot_pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGIN_NULLOK(PMC *init)) { - ASSERT_ARGS(constant_pmc_new_init) + ASSERT_ARGS(constant_Parrot_pmc_new_init) PMC * const pmc = get_new_pmc_header(interp, base_type, PObj_constant_FLAG); VTABLE_init_pmc(interp, pmc, init); return pmc; @@ -587,7 +587,7 @@ constant_pmc_new_init(PARROT_INTERP, INTVAL base_type, ARGIN_NULLOK(PMC *init)) /* -=item C +=item C Creates a new temporary PMC of type C, then call C. Cannot be used to create PMC Objects which have been defined from PIR. @@ -602,11 +602,11 @@ garbage-collected will cause bugs. If you don't know what this means means, or you can't tell if either case will happen as the result of any call you make on or with this PMC, B use this function, lest you cause weird crashes and memory errors. -Use C instead. +Use C instead. (Why do these functions even exist? Used judiciously, they can reduce GC pressure in hotspots tremendously. If you haven't audited the code carefully --- including profiling and benchmarking -- then use C instead, and +-- including profiling and benchmarking -- then use C instead, and never B add C to either function.) =cut @@ -615,9 +615,9 @@ never B add C to either function.) PARROT_CANNOT_RETURN_NULL PMC * -temporary_pmc_new(PARROT_INTERP, INTVAL base_type) +temporary_Parrot_pmc_new(PARROT_INTERP, INTVAL base_type) { - ASSERT_ARGS(temporary_pmc_new) + ASSERT_ARGS(temporary_Parrot_pmc_new) PMC * const pmc = get_new_pmc_header(interp, base_type, PObj_constant_FLAG); VTABLE_init(interp, pmc); return pmc; @@ -628,9 +628,9 @@ temporary_pmc_new(PARROT_INTERP, INTVAL base_type) =item C -Frees a new temporary PMC created by C. Do not call +Frees a new temporary PMC created by C. Do not call this with any other type of PMC. Do not forget to call this (or you'll leak -PMCs). Read and I the warnings for C before +PMCs). Read and I the warnings for C before you're tempted to use this. =cut @@ -838,7 +838,7 @@ Parrot_create_mro(PARROT_INTERP, INTVAL type) if (mro_list->vtable->base_type != enum_class_ResizableStringArray) return; - mro = pmc_new(interp, enum_class_ResizablePMCArray); + mro = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); vtable->mro = mro; if (vtable->ro_variant_vtable) @@ -858,7 +858,7 @@ Parrot_create_mro(PARROT_INTERP, INTVAL type) if (!vtable->_namespace) { /* need a namespace Hash, anchor at parent, name it */ - PMC * const ns = pmc_new(interp, + PMC * const ns = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_NameSpace)); vtable->_namespace = ns; diff --git a/src/pmc/arrayiterator.pmc b/src/pmc/arrayiterator.pmc index bcb432a67a..3308fe8b51 100644 --- a/src/pmc/arrayiterator.pmc +++ b/src/pmc/arrayiterator.pmc @@ -128,7 +128,7 @@ Marks the current idx/key and the aggregate as live. GET_ATTR_pos(interp, SELF, pos); GET_ATTR_reverse(interp, SELF, reverse); - clone = pmc_new_init(INTERP, enum_class_ArrayIterator, array); + clone = Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, array); SET_ATTR_pos(interp, clone, pos); SET_ATTR_reverse(interp, clone, reverse); diff --git a/src/pmc/bigint.pmc b/src/pmc/bigint.pmc index cc85bd7530..383d29d46a 100644 --- a/src/pmc/bigint.pmc +++ b/src/pmc/bigint.pmc @@ -540,7 +540,7 @@ Return GMP version string "x.y.z". } VTABLE PMC *clone() { - PMC *res = pmc_new(INTERP, SELF->vtable->base_type); + PMC *res = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bigint_set(INTERP, res, SELF); return res; } @@ -723,14 +723,14 @@ Decrements the integer. } MULTI PMC *add(BigInt value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_add_bigint(INTERP, SELF, value, dest); return dest; } MULTI PMC *add(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_add_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -745,7 +745,7 @@ Decrements the integer. } VTABLE PMC *add_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_add_bigint_int(INTERP, SELF, value, dest); return dest; @@ -779,14 +779,14 @@ Decrements the integer. MULTI PMC *subtract(BigInt value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_sub_bigint(INTERP, SELF, value, dest); return dest; } MULTI PMC *subtract(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_sub_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -801,7 +801,7 @@ Decrements the integer. } VTABLE PMC *subtract_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_sub_bigint_int(INTERP, SELF, value, dest); return dest; @@ -835,14 +835,14 @@ Decrements the integer. MULTI PMC *multiply(BigInt value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_mul_bigint(INTERP, SELF, value, dest); return dest; } MULTI PMC *multiply(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_mul_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -857,7 +857,7 @@ Decrements the integer. } VTABLE PMC *multiply_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_mul_bigint_int(INTERP, SELF, value, dest); return dest; @@ -890,7 +890,7 @@ Decrements the integer. METHOD PMC *pow(PMC *value) { /* XXX only Integer RHS currently */ const INTVAL r = VTABLE_get_integer(INTERP, value); - PMC *dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC *dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_pow_bigint_int(INTERP, SELF, r, dest); RETURN(PMC *dest); @@ -898,7 +898,7 @@ Decrements the integer. MULTI PMC *divide(BigInt value, PMC *dest) { BIGINT *bi; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_div_bigint(INTERP, SELF, value, dest); #if 0 @@ -914,7 +914,7 @@ Decrements the integer. } MULTI PMC *divide(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_div_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -929,7 +929,7 @@ Decrements the integer. } VTABLE PMC *divide_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_div_bigint_int(INTERP, SELF, value, dest); return dest; @@ -953,14 +953,14 @@ Decrements the integer. } MULTI PMC *floor_divide(BigInt value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_fdiv_bigint(INTERP, SELF, value, dest); return dest; } MULTI PMC *floor_divide(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_fdiv_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -975,7 +975,7 @@ Decrements the integer. } VTABLE PMC *floor_divide_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_fdiv_bigint_int(INTERP, SELF, value, dest); return dest; @@ -1001,14 +1001,14 @@ Decrements the integer. } MULTI PMC *modulus(BigInt value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_mod_bigint(INTERP, SELF, value, dest); return dest; } MULTI PMC *modulus(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_mod_bigint_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -1078,7 +1078,7 @@ Sets C to the absolute value of SELF. */ VTABLE PMC *absolute(PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_abs(INTERP, SELF, dest); return dest; @@ -1102,7 +1102,7 @@ Set C to the negated value of C. */ VTABLE PMC *neg(PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bigint_neg(INTERP, SELF, dest); return dest; diff --git a/src/pmc/bignum.pmc b/src/pmc/bignum.pmc index 3d113b647a..624b2dbabf 100644 --- a/src/pmc/bignum.pmc +++ b/src/pmc/bignum.pmc @@ -810,7 +810,7 @@ Return GMP version string "x.y.z". } VTABLE PMC *clone() { - PMC *res = pmc_new(INTERP, SELF->vtable->base_type); + PMC *res = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_set(INTERP, res, SELF); return res; } @@ -1046,14 +1046,14 @@ Decrement the BigNum by 1.0. */ MULTI PMC *add(BigNum value, PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_add_bignum(INTERP, SELF, value, dest); return dest; } MULTI PMC *add(Integer value, PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_add_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -1067,7 +1067,7 @@ Decrement the BigNum by 1.0. } VTABLE PMC *add_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_add_bignum_int(INTERP, SELF, value, dest); return dest; @@ -1109,14 +1109,14 @@ Decrement the BigNum by 1.0. */ MULTI PMC *subtract(BigNum value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_sub_bignum(INTERP, SELF, value, dest); return dest; } MULTI PMC *subtract(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_sub_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -1130,7 +1130,7 @@ Decrement the BigNum by 1.0. } VTABLE PMC *subtract_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_sub_bignum_int(INTERP, SELF, value, dest); return dest; @@ -1172,14 +1172,14 @@ Decrement the BigNum by 1.0. */ MULTI PMC *multiply(BigNum value, PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_mul_bignum(INTERP, SELF, value, dest); return dest; } MULTI PMC *multiply(Integer value, PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_mul_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -1193,7 +1193,7 @@ Decrement the BigNum by 1.0. } VTABLE PMC *multiply_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_mul_bignum_int(INTERP, SELF, value, dest); return dest; @@ -1243,7 +1243,7 @@ TODO: Only supports Integer values for now. METHOD PMC *pow(PMC *value) { /* only Integer RHS currently. TODO: check number and bignum types */ INTVAL r = VTABLE_get_integer(INTERP, value); - PMC *dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC *dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_pow_bignum_int(INTERP, SELF, r, dest); RETURN(PMC *dest); @@ -1259,7 +1259,7 @@ TODO: Only supports Integer values for now. MULTI PMC *divide(BigNum value, PMC *dest) { BIGNUM *bn; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_div_bignum(INTERP, SELF, value, dest); #if 0 @@ -1275,7 +1275,7 @@ TODO: Only supports Integer values for now. } MULTI PMC *divide(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_div_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -1289,14 +1289,14 @@ TODO: Only supports Integer values for now. } VTABLE PMC *divide_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_div_bignum_int(INTERP, SELF, value, dest); return dest; } VTABLE PMC *divide_float(FLOATVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_div_bignum_float(INTERP, SELF, value, dest); return dest; @@ -1331,14 +1331,14 @@ TODO: Only supports Integer values for now. */ MULTI PMC *floor_divide(BigNum value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_fdiv_bignum(INTERP, SELF, value, dest); return dest; } MULTI PMC *floor_divide(Integer value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_fdiv_bignum_int(INTERP, SELF, VTABLE_get_integer(interp, value), dest); return dest; @@ -1352,7 +1352,7 @@ TODO: Only supports Integer values for now. } VTABLE PMC *floor_divide_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); bignum_fdiv_bignum_int(INTERP, SELF, value, dest); return dest; @@ -1436,7 +1436,7 @@ Sets C to the absolute value of SELF. */ VTABLE PMC *absolute(PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_abs(INTERP, SELF, dest); return dest; @@ -1460,7 +1460,7 @@ Set C to the negated value of C. */ VTABLE PMC *neg(PMC *dest) { - dest = pmc_new(INTERP, SELF->vtable->base_type); + dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); bignum_neg(INTERP, SELF, dest); return dest; diff --git a/src/pmc/callcontext.pmc b/src/pmc/callcontext.pmc index 31226d5f79..89ad7d3d0f 100644 --- a/src/pmc/callcontext.pmc +++ b/src/pmc/callcontext.pmc @@ -269,15 +269,15 @@ autobox_pmc(PARROT_INTERP, Pcc_cell *cell) switch (CELL_TYPE_MASK(cell)) { case INTCELL: - result = pmc_new(interp, HLL_TYPE(enum_class_Integer)); + result = Parrot_pmc_new(interp, HLL_TYPE(enum_class_Integer)); VTABLE_set_integer_native(interp, result, CELL_INT(cell)); break; case FLOATCELL: - result = pmc_new(interp, HLL_TYPE(enum_class_Float)); + result = Parrot_pmc_new(interp, HLL_TYPE(enum_class_Float)); VTABLE_set_number_native(interp, result, CELL_FLOAT(cell)); break; case STRINGCELL: - result = pmc_new(interp, HLL_TYPE(enum_class_String)); + result = Parrot_pmc_new(interp, HLL_TYPE(enum_class_String)); VTABLE_set_string_native(interp, result, CELL_STRING(cell)); break; case PMCCELL: @@ -363,7 +363,7 @@ get_named_names(PARROT_INTERP, ARGIN(PMC *SELF)) /* yes, this *looks* risky, but it's a Parrot STRING hash internally */ if (hash && hash->entries) { UINTVAL i, j = 0; - result = pmc_new(interp, enum_class_FixedStringArray); + result = Parrot_pmc_new(interp, enum_class_FixedStringArray); VTABLE_set_integer_native(interp, result, hash->entries); for (i = 0; i <= hash->mask; i++) { @@ -1407,7 +1407,7 @@ Creates and returns a clone of the signature. Pcc_cell *cell; STRING *short_sig; PMC *type_tuple, *arg_flags, *return_flags; - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_positionals(INTERP, SELF, cell); @@ -1489,13 +1489,13 @@ sub, or for the point of the call a level deeper for the rest. */ METHOD backtrace(PMC *resume :optional, INTVAL has_resume :opt_flag) { - PMC *result = pmc_new(interp, enum_class_ResizablePMCArray); + PMC *result = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); PMC *cur_ctx = SELF; Parrot_Continuation_attributes *cont = has_resume ? PMC_cont(resume) : NULL; /* Get starting context, then loop over them. */ while (cur_ctx) { - PMC *frame = pmc_new(interp, enum_class_Hash); + PMC *frame = Parrot_pmc_new(interp, enum_class_Hash); PMC *annotations = NULL; Parrot_Sub_attributes *sub; @@ -1524,7 +1524,7 @@ sub, or for the point of the call a level deeper for the rest. } if (!annotations) - annotations = pmc_new(interp, enum_class_Hash); + annotations = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pmc_keyed_str(interp, frame, CONST_STRING(interp, "annotations"), annotations); diff --git a/src/pmc/capture.pmc b/src/pmc/capture.pmc index 2fe6ba9443..aa1e9f101e 100644 --- a/src/pmc/capture.pmc +++ b/src/pmc/capture.pmc @@ -22,13 +22,13 @@ These are the vtable functions for the Capture PMC. do { \ GETATTR_Capture_array((i), (obj), array); \ if (!array) \ - SETATTR_Capture_array((i), (obj), pmc_new((i), enum_class_ResizablePMCArray)); \ + SETATTR_Capture_array((i), (obj), Parrot_pmc_new((i), enum_class_ResizablePMCArray)); \ } while (0) #define CAPTURE_hash_CREATE(i, obj) \ do { \ GETATTR_Capture_hash((i), (obj), hash); \ if (!hash) \ - SETATTR_Capture_hash((i), (obj), pmc_new((i), enum_class_Hash)); \ + SETATTR_Capture_hash((i), (obj), Parrot_pmc_new((i), enum_class_Hash)); \ } while (0) pmclass Capture auto_attrs { @@ -61,7 +61,7 @@ Creates an identical copy of the Capture. VTABLE PMC *clone() { PMC *array, *hash; - PMC *dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC *dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_array(INTERP, SELF, array); GET_ATTR_hash(INTERP, SELF, hash); if (array) diff --git a/src/pmc/class.pmc b/src/pmc/class.pmc index 05c112bfc8..65f412daac 100644 --- a/src/pmc/class.pmc +++ b/src/pmc/class.pmc @@ -106,7 +106,7 @@ cache_class_attribs(PARROT_INTERP, PMC *cur_class, PMC *attrib_index, /* Build a string representing the fully qualified class name. */ /* Retrieve the fully qualified class name for the class. */ STRING * const fq_class = VTABLE_get_string(interp, cur_class); - PMC * const class_cache = pmc_new(interp, enum_class_Hash); + PMC * const class_cache = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pmc_keyed_str(interp, cache, fq_class, class_cache); /* Iterate over the attributes. */ @@ -138,8 +138,8 @@ build_attrib_index(PARROT_INTERP, PMC *self) { Parrot_Class_attributes * const _class = PARROT_CLASS(self); int cur_index = 0; - PMC * const attrib_index = pmc_new(interp, enum_class_Hash); - PMC * const cache = pmc_new(interp, enum_class_Hash); + PMC * const attrib_index = Parrot_pmc_new(interp, enum_class_Hash); + PMC * const cache = Parrot_pmc_new(interp, enum_class_Hash); const int num_classes = VTABLE_elements(interp, _class->all_parents); int i; @@ -344,7 +344,7 @@ initialize_parents(PARROT_INTERP, PMC *object, PMC *all_parents) if (!PMC_IS_NULL(meth)) { /* build an empty signature; it has an invocant but no args/retvals */ - PMC * const sig_obj = pmc_new(interp, enum_class_CallContext); + PMC * const sig_obj = Parrot_pmc_new(interp, enum_class_CallContext); /* preserve current_object */ PMC * const old_object = interp->current_object; VTABLE_set_string_native(interp, sig_obj, CONST_STRING(interp, "Pi->")); @@ -504,18 +504,18 @@ arguments. The class is attached to the current HLL namespace. /* Set up the object. */ _class->name = CONST_STRING(interp, ""); _class->_namespace = PMCNULL; - _class->parents = pmc_new(interp, enum_class_ResizablePMCArray); - _class->all_parents = pmc_new(interp, enum_class_ResizablePMCArray); - _class->roles = pmc_new(interp, enum_class_ResizablePMCArray); - _class->methods = pmc_new(interp, enum_class_Hash); - _class->attrib_metadata = pmc_new(interp, enum_class_Hash); + _class->parents = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + _class->all_parents = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + _class->roles = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + _class->methods = Parrot_pmc_new(interp, enum_class_Hash); + _class->attrib_metadata = Parrot_pmc_new(interp, enum_class_Hash); _class->attrib_index = PMCNULL; _class->attrib_cache = PMCNULL; _class->meth_cache = PMCNULL; - _class->resolve_method = pmc_new(interp, enum_class_ResizablePMCArray); + _class->resolve_method = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); - _class->vtable_overrides = pmc_new(interp, enum_class_Hash); - _class->parent_overrides = pmc_new(interp, enum_class_Hash); + _class->vtable_overrides = Parrot_pmc_new(interp, enum_class_Hash); + _class->parent_overrides = Parrot_pmc_new(interp, enum_class_Hash); /* We put ourself on the all parents list. */ VTABLE_push_pmc(interp, _class->all_parents, SELF); @@ -542,7 +542,7 @@ arguments. The class is attached to the current HLL namespace. case enum_class_ResizableStringArray: case enum_class_NameSpace: /* set only the name property */ - arg = pmc_new(interp, enum_class_Hash); + arg = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pmc_keyed_str(interp, arg, name_str, init_data); break; @@ -556,7 +556,7 @@ arguments. The class is attached to the current HLL namespace. || VTABLE_isa(interp, init_data, CONST_STRING(interp, "Key")) || VTABLE_isa(interp, init_data, CONST_STRING(interp, "ResizableStringArray"))) { /* set only the name property */ - arg = pmc_new(interp, enum_class_Hash); + arg = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pmc_keyed_str(interp, arg, name_str, init_data); } @@ -631,7 +631,7 @@ Returns an error if an attribute of C already exists. VTABLE void add_attribute(STRING *name, PMC *type) { Parrot_Class_attributes * const _class = PARROT_CLASS(SELF); - PMC * const new_attribute = pmc_new(interp, enum_class_Hash); + PMC * const new_attribute = Parrot_pmc_new(interp, enum_class_Hash); /* If we've been instantiated already, not allowed. */ if (_class->instantiated) @@ -960,11 +960,11 @@ Array of Class PMCs representing the direct parents of this class. found = _class->parents; } else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) { - found = pmc_new(interp, enum_class_String); + found = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, found, _class->name); } else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "id"))) { - found = pmc_new(interp, enum_class_Integer); + found = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, found, _class->id); } else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "namespace"))) { @@ -987,7 +987,7 @@ Array of Class PMCs representing the direct parents of this class. found = _class->roles; } else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "flags"))) { - found = pmc_new(interp, enum_class_Integer); + found = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, found, (INTVAL)PObj_get_FLAGS(SELF)); } @@ -1002,7 +1002,7 @@ Array of Class PMCs representing the direct parents of this class. if (found->vtable->base_type == enum_class_Hash) { /* for Hash return values, create and return a shallow * clone because the VTABLE_clone does a deep clone */ - PMC * const hash = pmc_new(interp, enum_class_Hash); + PMC * const hash = Parrot_pmc_new(interp, enum_class_Hash); PMC * const iter = VTABLE_get_iter(interp, found); while (VTABLE_get_bool(interp, iter)) { STRING * const key = VTABLE_shift_string(interp, iter); @@ -1029,7 +1029,7 @@ inspect_str. VTABLE PMC *inspect() { /* Create a hash, then use inspect_str to get all of the data to * fill it up with. */ - PMC * const metadata = pmc_new(interp, enum_class_Hash); + PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash); STRING * const name_str = CONST_STRING(interp, "name"); STRING * const ns_str = CONST_STRING(interp, "namespace"); STRING * const attrs_str = CONST_STRING(interp, "attributes"); @@ -1191,7 +1191,7 @@ Creates a new PMC object of the type of the class and calls init(). _class->instantiated = 1; /* Create object. */ - object = pmc_new_noinit(interp, enum_class_Object); + object = Parrot_pmc_new_noinit(interp, enum_class_Object); /* Set custom GC mark and destroy on the object. */ PObj_custom_mark_destroy_SETALL(object); @@ -1207,7 +1207,7 @@ Creates a new PMC object of the type of the class and calls init(). Parrot_Object_attributes * const objattr = PMC_data_typed(object, Parrot_Object_attributes *); objattr->_class = SELF; - objattr->attrib_store = pmc_new(interp, enum_class_ResizablePMCArray); + objattr->attrib_store = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); } if (!PMC_IS_NULL(init)) { @@ -1537,7 +1537,7 @@ Used to unarchive the class. This is just a temporary hack. Type ID numbers shouldn't be externally visible to the average PIR user. However, we need this for now to interface -with functions like pmc_new and pmc_reuse, which take type ID numbers still. +with functions like Parrot_pmc_new and pmc_reuse, which take type ID numbers still. =cut @@ -1563,7 +1563,7 @@ Called after the class has been thawed. /* Recalculate full MRO from thawed parents */ _class->all_parents = Parrot_ComputeMRO_C3(interp, SELF); - _class->parent_overrides = pmc_new(interp, enum_class_Hash); + _class->parent_overrides = Parrot_pmc_new(interp, enum_class_Hash); /* Rebuild attribute index from thawed attribute metadata */ build_attrib_index(interp, SELF); @@ -1591,7 +1591,7 @@ Sets the name of the class, and updates the namespace accordingly. if (has_name) { /* We'll build a hash just containing the name, then give this to * init_class_from_hash - saves some code duplication. */ - PMC * const naming_hash = pmc_new(interp, enum_class_Hash); + PMC * const naming_hash = Parrot_pmc_new(interp, enum_class_Hash); STRING * const name_str = CONST_STRING(interp, "name"); VTABLE_set_string_keyed_str(interp, naming_hash, name_str, name); diff --git a/src/pmc/codestring.pmc b/src/pmc/codestring.pmc index cbf4649790..8603fc2bac 100644 --- a/src/pmc/codestring.pmc +++ b/src/pmc/codestring.pmc @@ -189,7 +189,7 @@ the first line is line number zero. INTVAL eos; INTVAL jpos; - linepos = pmc_new(INTERP, enum_class_ResizableIntegerArray); + linepos = Parrot_pmc_new(INTERP, enum_class_ResizableIntegerArray); /* get the string itself */ GET_ATTR_str_val(INTERP, SELF, str); eos = Parrot_str_byte_length(INTERP, str); diff --git a/src/pmc/complex.pmc b/src/pmc/complex.pmc index 25a5d6757a..5b2ed46a97 100644 --- a/src/pmc/complex.pmc +++ b/src/pmc/complex.pmc @@ -234,7 +234,7 @@ C object according to 2.1. Built-in Functions. */ VTABLE opcode_t *invoke(void *next) { const int argcP = REG_INT(interp, 3); - PMC * const res = pmc_new(INTERP, enum_class_Complex); + PMC * const res = Parrot_pmc_new(INTERP, enum_class_Complex); if (argcP == 1) { PMC * const arg = REG_PMC(interp, 5); @@ -316,7 +316,7 @@ Creates an identical copy of the complex number. } VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); @@ -436,7 +436,7 @@ Returns the requested number (real part for C and imaginary for C). } VTABLE PMC *get_pmc_keyed_str(STRING *key) { - PMC * const ret = pmc_new(INTERP, enum_class_Float); + PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Float); const FLOATVAL val = SELF.get_number_keyed_str(key); VTABLE_set_number_native(INTERP, ret, val); return ret; @@ -453,7 +453,7 @@ Returns the requested number (real part for C<0> and imaginary for C<1>). */ VTABLE PMC *get_pmc_keyed_int(INTVAL key) { - PMC * const ret = pmc_new(INTERP, enum_class_Float); + PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Float); const FLOATVAL val = SELF.get_number_keyed_int(key); VTABLE_set_number_native(INTERP, ret, val); return ret; @@ -635,7 +635,7 @@ Adds C to the complex number, placing the result in C. MULTI PMC *add(Complex value, PMC *dest) { FLOATVAL self_re, self_im, val_re, val_im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, self_re); GET_ATTR_im(INTERP, SELF, self_im); @@ -651,7 +651,7 @@ Adds C to the complex number, placing the result in C. MULTI PMC *add(DEFAULT value, PMC *dest) { FLOATVAL re, im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -667,7 +667,7 @@ Adds C to the complex number, placing the result in C. VTABLE PMC *add_float(FLOATVAL value, PMC *dest) { FLOATVAL re, im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -724,7 +724,7 @@ Subtracts C from the complex number, placing the result in C. MULTI PMC *subtract(Complex value, PMC *dest) { FLOATVAL self_re, self_im, val_re, val_im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, self_re); GET_ATTR_im(INTERP, SELF, self_im); @@ -740,7 +740,7 @@ Subtracts C from the complex number, placing the result in C. MULTI PMC *subtract(DEFAULT value, PMC *dest) { FLOATVAL re, im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -756,7 +756,7 @@ Subtracts C from the complex number, placing the result in C. VTABLE PMC *subtract_float(FLOATVAL value, PMC *dest) { FLOATVAL re, im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -827,7 +827,7 @@ Multiplies the complex number SELF inplace with C. MULTI PMC *multiply(Complex value, PMC *dest) { FLOATVAL a, b, c, d; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, a); GET_ATTR_im(INTERP, SELF, b); @@ -841,7 +841,7 @@ Multiplies the complex number SELF inplace with C. MULTI PMC *multiply(DEFAULT value, PMC *dest) { FLOATVAL re, im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -857,7 +857,7 @@ Multiplies the complex number SELF inplace with C. VTABLE PMC *multiply_float(FLOATVAL value, PMC *dest) { FLOATVAL re, im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -940,7 +940,7 @@ http://docs.sun.com/source/806-3568/ncg_goldberg.html FLOATVAL self_re, self_im, val_re, val_im; complex_check_divide_zero(INTERP, value); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, self_re); GET_ATTR_im(INTERP, SELF, self_im); @@ -970,7 +970,7 @@ http://docs.sun.com/source/806-3568/ncg_goldberg.html FLOATVAL re, im; const FLOATVAL d = VTABLE_get_number(INTERP, value); float_check_divide_zero(INTERP, d); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -984,7 +984,7 @@ http://docs.sun.com/source/806-3568/ncg_goldberg.html VTABLE PMC *divide_int(INTVAL value, PMC *dest) { FLOATVAL re, im; int_check_divide_zero(INTERP, value); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -998,7 +998,7 @@ http://docs.sun.com/source/806-3568/ncg_goldberg.html VTABLE PMC *divide_float(FLOATVAL value, PMC *dest) { FLOATVAL re, im; float_check_divide_zero(INTERP, value); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1085,7 +1085,7 @@ Set C to the negated value of C. VTABLE PMC *neg(PMC *dest) { FLOATVAL re, im; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1164,7 +1164,7 @@ Sets C to the absolute value of SELF that is the distance from (0.0). GET_ATTR_im(INTERP, SELF, im); d = sqrt(re*re + im*im); - dest = pmc_new(INTERP, + dest = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_Float)); VTABLE_set_number_native(INTERP, dest, d); @@ -1202,7 +1202,7 @@ ln(+-i) = +- (pi i)/2 */ METHOD ln() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im, result_re, result_im; GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1236,7 +1236,7 @@ exp(a + bi) = exp(a) * (cos(b) + i * sin(b)) */ METHOD exp() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im, f; GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1290,7 +1290,7 @@ Returns C(SELF). */ METHOD sin() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im, result_re, result_im; GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1320,7 +1320,7 @@ Returns C(SELF). } METHOD cos() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im, result_re, result_im; GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1345,8 +1345,8 @@ Returns C(SELF). } METHOD tan() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); (PMC *d) = PCCINVOKE(INTERP, SELF, "sin"); (PMC *e) = PCCINVOKE(INTERP, SELF, "cos"); @@ -1357,8 +1357,8 @@ Returns C(SELF). } METHOD cot() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); (PMC *d) = PCCINVOKE(INTERP, SELF, "cos"); (PMC *e) = PCCINVOKE(INTERP, SELF, "sin"); @@ -1368,8 +1368,8 @@ Returns C(SELF). } METHOD sec() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_re(INTERP, d, 1.0); SET_ATTR_im(INTERP, d, 0.0); (PMC *e) = PCCINVOKE(INTERP, SELF, "cos"); @@ -1380,8 +1380,8 @@ Returns C(SELF). } METHOD csc() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_re(INTERP, d, 1.0); SET_ATTR_im(INTERP, d, 0.0); @@ -1428,8 +1428,8 @@ Returns the inverse function of SELF. METHOD asin() { FLOATVAL d_re, d_im, e_re, e_im, self_re, self_im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, self_re); GET_ATTR_im(INTERP, SELF, self_im); @@ -1456,8 +1456,8 @@ Returns the inverse function of SELF. METHOD acos() { FLOATVAL d_re, d_im, e_re, e_im, self_re, self_im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, self_re); GET_ATTR_im(INTERP, SELF, self_im); @@ -1483,8 +1483,8 @@ Returns the inverse function of SELF. } METHOD atan() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im, d_re, d_im; GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1507,7 +1507,7 @@ Returns the inverse function of SELF. } METHOD acot() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); PMC *e; FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); @@ -1521,7 +1521,7 @@ Returns the inverse function of SELF. } METHOD acsc() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); PMC *e; FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); @@ -1535,7 +1535,7 @@ Returns the inverse function of SELF. } METHOD asec() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); PMC *e; FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); @@ -1569,7 +1569,7 @@ tanh(z) = sinh(z) / cosh(z) */ METHOD sinh() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1581,7 +1581,7 @@ tanh(z) = sinh(z) / cosh(z) } METHOD cosh() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1598,8 +1598,8 @@ tanh(z) = sinh(z) / cosh(z) } METHOD tanh() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); (PMC *d) = PCCINVOKE(INTERP, SELF, "sinh"); (PMC *e) = PCCINVOKE(INTERP, SELF, "cosh"); @@ -1611,7 +1611,7 @@ tanh(z) = sinh(z) / cosh(z) METHOD coth() { FLOATVAL re, im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); (PMC *d) = PCCINVOKE(INTERP, SELF, "tanh"); GET_ATTR_re(INTERP, d, re); @@ -1625,7 +1625,7 @@ tanh(z) = sinh(z) / cosh(z) METHOD csch() { FLOATVAL re, im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); (PMC *d) = PCCINVOKE(INTERP, SELF, "sinh"); GET_ATTR_re(INTERP, d, re); @@ -1639,7 +1639,7 @@ tanh(z) = sinh(z) / cosh(z) METHOD sech() { FLOATVAL re, im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); (PMC *d) = PCCINVOKE(INTERP, SELF, "cosh"); GET_ATTR_re(INTERP, d, re); @@ -1681,8 +1681,8 @@ atanh = i atan(-ix) METHOD asinh() { FLOATVAL re, im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1700,8 +1700,8 @@ atanh = i atan(-ix) METHOD acosh() { FLOATVAL re, im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); (PMC *d) = PCCINVOKE(INTERP, SELF, "acos"); GET_ATTR_re(INTERP, d, re); @@ -1714,8 +1714,8 @@ atanh = i atan(-ix) METHOD atanh() { FLOATVAL re, im; - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); - PMC * const e = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const e = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); GET_ATTR_re(INTERP, SELF, re); GET_ATTR_im(INTERP, SELF, im); @@ -1732,7 +1732,7 @@ atanh = i atan(-ix) } METHOD acoth() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); PMC *e; FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); @@ -1746,7 +1746,7 @@ atanh = i atan(-ix) } METHOD acsch() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); PMC *e; FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); @@ -1760,7 +1760,7 @@ atanh = i atan(-ix) } METHOD asech() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); PMC *e; FLOATVAL re, im; GET_ATTR_re(INTERP, SELF, re); @@ -1796,9 +1796,9 @@ x ^ y = exp(y * ln x)) */ METHOD pow(PMC * value) { - PMC *l = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC *l = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); PMC *log; - PMC *dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC *dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); Parrot_pcc_invoke_method_from_c_args(interp, SELF, CONST_STRING(interp, "ln"), "->P", &log); @@ -1811,7 +1811,7 @@ x ^ y = exp(y * ln x)) } METHOD sqrt() { - PMC * const result = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const result = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); const FLOATVAL absval = SELF.get_number(); FLOATVAL sx, sy, rx, ry; GET_ATTR_re(INTERP, SELF, sx); diff --git a/src/pmc/continuation.pmc b/src/pmc/continuation.pmc index 67bd44e8ff..ea4ef793d3 100644 --- a/src/pmc/continuation.pmc +++ b/src/pmc/continuation.pmc @@ -157,7 +157,7 @@ Creates and returns a clone of the continuation. VTABLE PMC *clone() { /* Start to prepare for subclassable continuations */ - return pmc_new_init(INTERP, SELF->vtable->base_type, SELF); + return Parrot_pmc_new_init(INTERP, SELF->vtable->base_type, SELF); } /* diff --git a/src/pmc/coroutine.pmc b/src/pmc/coroutine.pmc index feb0cdac82..03028b4772 100644 --- a/src/pmc/coroutine.pmc +++ b/src/pmc/coroutine.pmc @@ -97,7 +97,7 @@ Clones the coroutine. VTABLE PMC *clone() { STRING *name; - PMC * const ret = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const ret = Parrot_pmc_new(INTERP, SELF->vtable->base_type); PObj_custom_mark_destroy_SETALL(ret); @@ -164,7 +164,7 @@ Swaps the "context". /* first time set current sub, cont, object */ if (PMC_IS_NULL(ctx)) - ctx = pmc_new(INTERP, enum_class_CallContext); + ctx = Parrot_pmc_new(INTERP, enum_class_CallContext); CURRENT_CONTEXT(INTERP) = ctx; @@ -189,7 +189,7 @@ Swaps the "context". /* create pad if needed */ if (!PMC_IS_NULL(lex_info)) { const INTVAL hlltype = Parrot_get_ctx_HLL_type(INTERP, enum_class_LexPad); - PMC * const lexpad = pmc_new_init(INTERP, hlltype, lex_info); + PMC * const lexpad = Parrot_pmc_new_init(INTERP, hlltype, lex_info); Parrot_pcc_set_lex_pad(INTERP, ctx, lexpad); VTABLE_set_pointer(INTERP, lexpad, ctx); } diff --git a/src/pmc/cpointer.pmc b/src/pmc/cpointer.pmc index 06b85cfc8e..6608d551f4 100644 --- a/src/pmc/cpointer.pmc +++ b/src/pmc/cpointer.pmc @@ -99,7 +99,7 @@ Creates and returns a clone of the pointer. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new_noinit(INTERP, SELF->vtable->base_type); void *ptr; STRING *sig; diff --git a/src/pmc/default.pmc b/src/pmc/default.pmc index e3483a9933..d33372350c 100644 --- a/src/pmc/default.pmc +++ b/src/pmc/default.pmc @@ -148,7 +148,7 @@ Set pending standard properties in C. static void propagate_std_props(PARROT_INTERP, PMC *self, PMC *prop_hash) { if (self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)){ - PMC * const pmc_true = pmc_new(interp, enum_class_Integer); + PMC * const pmc_true = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, pmc_true, 1); VTABLE_set_pmc_keyed_str(interp, prop_hash, CONST_STRING(interp, "_ro"), pmc_true); } @@ -189,7 +189,7 @@ static PMC* check_get_std_props(PARROT_INTERP, PMC *self, STRING *key) { if ((self->vtable->flags & (VTABLE_IS_CONST_FLAG | VTABLE_IS_READONLY_FLAG)) && Parrot_str_equal(interp, key, CONST_STRING(interp, "_ro"))) { - PMC * const ret_val = pmc_new(interp, enum_class_Integer); + PMC * const ret_val = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, ret_val, 1); return ret_val; } @@ -214,7 +214,7 @@ static PMC* make_prop_hash(PARROT_INTERP, PMC *self) { PMC *prop; - PMC_metadata(self) = prop = pmc_new(interp, enum_class_Hash); + PMC_metadata(self) = prop = Parrot_pmc_new(interp, enum_class_Hash); propagate_std_props(interp, self, prop); return prop; } @@ -332,16 +332,16 @@ calls init(). VTABLE PMC *instantiate(PMC *init) { const INTVAL type = VTABLE_type(INTERP, SELF); - /* Ensure no looping, as pmc_new calls the instantiate vtable entry for + /* Ensure no looping, as Parrot_pmc_new calls the instantiate vtable entry for * classes. */ if (PObj_is_class_TEST(SELF)) Parrot_ex_throw_from_c_args(interp, NULL, 1, "All high-level classes should override instantiate"); if (!PMC_IS_NULL(init)) - return pmc_new_init(INTERP, type, init); + return Parrot_pmc_new_init(INTERP, type, init); - return pmc_new(INTERP, type); + return Parrot_pmc_new(INTERP, type); } /* @@ -936,7 +936,7 @@ Provides introspection of a specific piece of information about the PMC. VTABLE PMC *inspect_str(STRING *name) { if (Parrot_str_equal(interp, name, CONST_STRING(interp, "flags"))) { - PMC *found = pmc_new(interp, enum_class_Integer); + PMC *found = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, found, (INTVAL)PObj_get_FLAGS(SELF)); return found; @@ -960,7 +960,7 @@ inspect_str. */ VTABLE PMC *inspect() { - PMC *metadata = pmc_new(interp, enum_class_Hash); + PMC *metadata = Parrot_pmc_new(interp, enum_class_Hash); STRING * const flags_str = CONST_STRING(interp, "flags"); VTABLE_set_pmc_keyed_str(interp, metadata, flags_str, @@ -987,9 +987,9 @@ Returns SELF. A PMC is its own class. if (PMC_IS_NULL(_class)) { INTVAL type = VTABLE_type(interp, SELF); - PMC *type_num = pmc_new(interp, enum_class_Integer); + PMC *type_num = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, type_num, type); - return pmc_new_init(interp, enum_class_PMCProxy, type_num); + return Parrot_pmc_new_init(interp, enum_class_PMCProxy, type_num); } return _class; @@ -1158,7 +1158,7 @@ Default fallback. Performs a multiple dispatch call for 'add_float'. */ VTABLE PMC *add_float(FLOATVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() + value); diff --git a/src/pmc/env.pmc b/src/pmc/env.pmc index 791396499f..5f49c9a8fb 100644 --- a/src/pmc/env.pmc +++ b/src/pmc/env.pmc @@ -74,7 +74,7 @@ This method is questionable, as environ is not in ISO-C. */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); } /* @@ -215,7 +215,7 @@ Returns a String PMC for the environment variable C<*key>. if (!retval) retval = string_from_literal(INTERP, ""); - return_pmc = pmc_new(INTERP, enum_class_String); + return_pmc = Parrot_pmc_new(INTERP, enum_class_String); VTABLE_set_string_native(INTERP, return_pmc, retval); return return_pmc; diff --git a/src/pmc/exception.pmc b/src/pmc/exception.pmc index b2f5920239..36999ad40b 100644 --- a/src/pmc/exception.pmc +++ b/src/pmc/exception.pmc @@ -541,30 +541,30 @@ Retrieve an attribute value for the exception object. if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "type"))) { INTVAL type; GET_ATTR_type(interp, SELF, type); - value = pmc_new(interp, enum_class_Integer); + value = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, value, type); } else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "severity"))) { INTVAL severity; GET_ATTR_severity(interp, SELF, severity); - value = pmc_new(interp, enum_class_Integer); + value = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, value, severity); } else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "exit_code"))) { INTVAL exit_code; GET_ATTR_exit_code(interp, SELF, exit_code); - value = pmc_new(interp, enum_class_Integer); + value = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, value, exit_code); } else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "handled"))) { INTVAL handled; GET_ATTR_handled(interp, SELF, handled); - value = pmc_new(interp, enum_class_Integer); + value = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, value, handled); } else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "message"))) { STRING *message = SELF.get_string(); - value = pmc_new(interp, enum_class_String); + value = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, value, message); } else if (Parrot_str_equal(INTERP, name, CONST_STRING(INTERP, "payload"))) { @@ -709,7 +709,7 @@ annotation. If not, returns a Hash of all of them. /* If we didn't have a key specified and we found no annotations to * return, should return an empty hash. */ if (!have_name && PMC_IS_NULL(result)) - result = pmc_new(interp, enum_class_Hash); + result = Parrot_pmc_new(interp, enum_class_Hash); RETURN(PMC *result); } diff --git a/src/pmc/exporter.pmc b/src/pmc/exporter.pmc index 921d6b08fa..5b7fceaed8 100644 --- a/src/pmc/exporter.pmc +++ b/src/pmc/exporter.pmc @@ -231,7 +231,7 @@ Throws an exception if an unknown PMC type is passed. if (got_glb) { STRING * const s_empty = CONST_STRING(interp, ""); - PMC *temp_globals = pmc_new(interp, enum_class_Hash); + PMC *temp_globals = Parrot_pmc_new(interp, enum_class_Hash); if (PMC_IS_NULL(glb)) { temp_globals = PMCNULL; diff --git a/src/pmc/fixedbooleanarray.pmc b/src/pmc/fixedbooleanarray.pmc index 9b9d150cb9..5cc31ff29b 100644 --- a/src/pmc/fixedbooleanarray.pmc +++ b/src/pmc/fixedbooleanarray.pmc @@ -90,7 +90,7 @@ Creates and returns a copy of the array. VTABLE PMC *clone() { unsigned char * my_bit_array, * clone_bit_array; UINTVAL resize_threshold, size; - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_bit_array(INTERP, SELF, my_bit_array); GET_ATTR_size(INTERP, SELF, size); @@ -296,7 +296,7 @@ Returns the PMC value of the element at index C. */ VTABLE PMC *get_pmc_keyed_int(INTVAL key) { - PMC * const ret = pmc_new(INTERP, enum_class_Boolean); + PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Boolean); const INTVAL val = SELF.get_integer_keyed_int(key); VTABLE_set_integer_native(INTERP, ret, val); return ret; @@ -427,7 +427,7 @@ Sets the Parrot string value of the element at index C to C. VTABLE void set_string_keyed_int(INTVAL key, STRING *value) { INTVAL tempInt; - PMC * const tempPMC = pmc_new(INTERP, enum_class_Boolean); + PMC * const tempPMC = Parrot_pmc_new(INTERP, enum_class_Boolean); VTABLE_set_string_native(INTERP, tempPMC, value); tempInt = VTABLE_get_integer(INTERP, tempPMC); @@ -493,7 +493,7 @@ Return a new iterator for SELF. */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); } diff --git a/src/pmc/fixedfloatarray.pmc b/src/pmc/fixedfloatarray.pmc index 1ef1956004..4a107d535f 100644 --- a/src/pmc/fixedfloatarray.pmc +++ b/src/pmc/fixedfloatarray.pmc @@ -60,7 +60,7 @@ Creates and returns a copy of the array. INTVAL size; FLOATVAL *self_float_array, *dest_float_array; size_t mem_size; - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_float_array(INTERP, SELF, self_float_array); if (!self_float_array) @@ -89,7 +89,7 @@ Return an Iterator for this PMC. */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); } /* @@ -248,7 +248,7 @@ Returns the PMC value of the element at index C. */ VTABLE PMC *get_pmc_keyed_int(INTVAL key) { - PMC * const ret = pmc_new(INTERP, enum_class_Float); + PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Float); const FLOATVAL val = SELF.get_number_keyed_int(key); VTABLE_set_number_native(INTERP, ret, val); @@ -374,7 +374,7 @@ Sets the Parrot string value of the element at index C to C. VTABLE void set_string_keyed_int(INTVAL key, STRING *value) { FLOATVAL tempNum; - PMC * const tempPMC = pmc_new(INTERP, enum_class_Float); + PMC * const tempPMC = Parrot_pmc_new(INTERP, enum_class_Float); VTABLE_set_string_native(INTERP, tempPMC, value); tempNum = VTABLE_get_number(INTERP, tempPMC); diff --git a/src/pmc/fixedintegerarray.pmc b/src/pmc/fixedintegerarray.pmc index 4ab7e70b7f..415a7fe6c1 100644 --- a/src/pmc/fixedintegerarray.pmc +++ b/src/pmc/fixedintegerarray.pmc @@ -81,8 +81,8 @@ Creates and returns a copy of the array. INTVAL * int_array; PMC * const dest = PObj_constant_TEST(SELF) - ? constant_pmc_new(INTERP, SELF->vtable->base_type) - : pmc_new(INTERP, SELF->vtable->base_type); + ? constant_Parrot_pmc_new(INTERP, SELF->vtable->base_type) + : Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_int_array(INTERP, SELF, int_array); @@ -294,7 +294,7 @@ Returns the PMC value of the element at index C. */ VTABLE PMC *get_pmc_keyed_int(INTVAL key) { - PMC * const ret = pmc_new(INTERP, enum_class_Integer); + PMC * const ret = Parrot_pmc_new(INTERP, enum_class_Integer); const INTVAL val = SELF.get_integer_keyed_int(key); VTABLE_set_integer_native(INTERP, ret, val); return ret; @@ -422,7 +422,7 @@ Sets the Parrot string value of the element at index C to C. VTABLE void set_string_keyed_int(INTVAL key, STRING *value) { INTVAL tempInt; - PMC * const tempPMC = temporary_pmc_new(INTERP, enum_class_Integer); + PMC * const tempPMC = temporary_Parrot_pmc_new(INTERP, enum_class_Integer); VTABLE_set_string_native(INTERP, tempPMC, value); tempInt = VTABLE_get_integer(INTERP, tempPMC); temporary_pmc_free(interp, tempPMC); @@ -532,7 +532,7 @@ Return a new Iterator for this PMC. */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); } /* diff --git a/src/pmc/fixedpmcarray.pmc b/src/pmc/fixedpmcarray.pmc index ae98ebeabb..b003343e01 100644 --- a/src/pmc/fixedpmcarray.pmc +++ b/src/pmc/fixedpmcarray.pmc @@ -102,7 +102,7 @@ Creates and returns a copy of the array. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); const INTVAL size = PMC_size(SELF); if (size) { @@ -346,7 +346,7 @@ Returns the PMC value of the element at index C<*key>. box = SELF.get_pmc_keyed_int(k); if (box == NULL) - box = pmc_new(INTERP, enum_class_Undef); + box = Parrot_pmc_new(INTERP, enum_class_Undef); return VTABLE_get_pmc_keyed(INTERP, box, nextkey); } @@ -418,7 +418,7 @@ Sets the integer value of the element at index C to C. */ VTABLE void set_integer_keyed_int(INTVAL key, INTVAL value) { - PMC * const val = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const val = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_Integer)); VTABLE_set_integer_native(INTERP, val, value); @@ -436,7 +436,7 @@ Sets the integer value of the element at index C to C. */ VTABLE void set_integer_keyed(PMC *key, INTVAL value) { - PMC * const val = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const val = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_Integer)); VTABLE_set_integer_native(INTERP, val, value); @@ -457,7 +457,7 @@ C. */ VTABLE void set_number_keyed_int(INTVAL key, FLOATVAL value) { - PMC * const val = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const val = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_Float)); VTABLE_set_number_native(INTERP, val, value); @@ -487,7 +487,7 @@ C. /* TT #1295: autovivify an Array and insert it in SELF */ if (!box) - box = pmc_new(INTERP, SELF.type()); + box = Parrot_pmc_new(INTERP, SELF.type()); VTABLE_set_number_keyed(INTERP, box, nextkey, value); } @@ -504,7 +504,7 @@ Sets the Parrot string value of the element at index C to C. */ VTABLE void set_string_keyed_int(INTVAL key, STRING *value) { - PMC * const val = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const val = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_String)); VTABLE_set_string_native(INTERP, val, value); @@ -523,7 +523,7 @@ C. */ VTABLE void set_string_keyed(PMC *key, STRING *value) { - PMC * const val = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const val = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_String)); VTABLE_set_string_native(INTERP, val, value); @@ -575,7 +575,7 @@ Sets the PMC at index C to C. /* TT #1295: autovivify an Array and insert it in SELF */ if (!box) - box = pmc_new(INTERP, SELF.type()); + box = Parrot_pmc_new(INTERP, SELF.type()); VTABLE_set_pmc_keyed(INTERP, box, nextkey, value); } @@ -632,7 +632,7 @@ Return a new iterator for SELF. */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); } /* diff --git a/src/pmc/fixedstringarray.pmc b/src/pmc/fixedstringarray.pmc index 50c1cc0057..0f7421d74b 100644 --- a/src/pmc/fixedstringarray.pmc +++ b/src/pmc/fixedstringarray.pmc @@ -76,7 +76,7 @@ Creates and returns a copy of the array. VTABLE PMC *clone() { STRING **my_str_array, **dest_str_array; - PMC *const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC *const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_str_array(INTERP, SELF, my_str_array); @@ -150,7 +150,7 @@ Gets an iterator for the array. */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_ArrayIterator, SELF); } /* @@ -296,7 +296,7 @@ Returns the PMC value of the element at index C. */ VTABLE PMC *get_pmc_keyed_int(INTVAL key) { - PMC * const ret = pmc_new(INTERP, enum_class_String); + PMC * const ret = Parrot_pmc_new(INTERP, enum_class_String); STRING * const val = SELF.get_string_keyed_int(key); VTABLE_set_string_native(INTERP, ret, val); diff --git a/src/pmc/float.pmc b/src/pmc/float.pmc index 9b1ff6c957..ee05f19481 100644 --- a/src/pmc/float.pmc +++ b/src/pmc/float.pmc @@ -47,7 +47,7 @@ Make an exact copy of this PMC. VTABLE PMC *clone() { FLOATVAL fv; - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_fv(INTERP, SELF, fv); SET_ATTR_fv(INTERP, dest, fv); return dest; @@ -204,7 +204,7 @@ Set C to the negated value of C. VTABLE PMC *neg(PMC *dest) { const FLOATVAL a = -SELF.get_number(); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, a); return dest; @@ -331,7 +331,7 @@ Sets C to the absolute value of SELF. VTABLE PMC *absolute(PMC *dest) { const FLOATVAL a = fabs(SELF.get_number()); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, a); return dest; @@ -416,110 +416,110 @@ Return a new PMC of the type of C with I(value) of SELF. */ METHOD acos() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, acos(SELF.get_number())); RETURN(PMC *d); } METHOD cos() { - PMC * const d = pmc_new(INTERP, + PMC * const d = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_Float)); SET_ATTR_fv(INTERP, d, cos(SELF.get_number())); RETURN(PMC *d); } METHOD asec() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, acos(1.0 / SELF.get_number())); RETURN(PMC *d); } METHOD asin() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, asin(SELF.get_number())); RETURN(PMC *d); } METHOD atan() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, atan(SELF.get_number())); RETURN(PMC *d); } METHOD atan2(PMC *val) { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, atan2(SELF.get_number(), VTABLE_get_number(INTERP, val))); RETURN(PMC *d); } METHOD cosh() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, cosh(SELF.get_number())); RETURN(PMC *d); } METHOD exp() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, exp(SELF.get_number())); RETURN(PMC *d); } METHOD ln() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, log(SELF.get_number())); RETURN(PMC *d); } METHOD log10() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, log10(SELF.get_number())); RETURN(PMC *d); } METHOD log2() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, log(SELF.get_number()) / log(2.0)); RETURN(PMC *d); } METHOD sec() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, 1.0 / cos(SELF.get_number())); RETURN(PMC *d); } METHOD sech() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, 1.0 / cosh(SELF.get_number())); RETURN(PMC *d); } METHOD sin() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, sin(SELF.get_number())); RETURN(PMC *d); } METHOD sinh() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, sinh(SELF.get_number())); RETURN(PMC *d); } METHOD tan() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, tan(SELF.get_number())); RETURN(PMC *d); } METHOD tanh() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, tanh(SELF.get_number())); RETURN(PMC *d); } METHOD sqrt() { - PMC * const d = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + PMC * const d = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); SET_ATTR_fv(INTERP, d, sqrt(SELF.get_number())); RETURN(PMC *d); } diff --git a/src/pmc/hash.pmc b/src/pmc/hash.pmc index 02c1d7d2a6..e0649e7cbd 100644 --- a/src/pmc/hash.pmc +++ b/src/pmc/hash.pmc @@ -106,7 +106,7 @@ Creates and returns a clone of the hash. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); parrot_hash_clone(INTERP, (Hash *)SELF.get_pointer(), (Hash *)VTABLE_get_pointer(INTERP, dest)); @@ -445,7 +445,7 @@ Returns the integer value for the element at C<*key>. box = hash_value_to_pmc(INTERP, hash, b->value); else { /* autovivify an Hash */ - box = pmc_new(INTERP, SELF.type()); + box = Parrot_pmc_new(INTERP, SELF.type()); parrot_hash_put(INTERP, hash, keystr, hash_value_from_pmc(INTERP, hash, box)); } @@ -625,7 +625,7 @@ Returns the string value for the element at C<*key>. box = hash_value_to_pmc(INTERP, hash, b->value); else { /* autovivify an Hash */ - box = pmc_new(INTERP, SELF.type()); + box = Parrot_pmc_new(INTERP, SELF.type()); parrot_hash_put(INTERP, hash, keystr, hash_value_from_pmc(INTERP, hash, box)); } @@ -753,7 +753,7 @@ Returns the PMC value for the element at C<*key>. /* autovivify an Hash */ if (PMC_IS_NULL(box)) - box = pmc_new(INTERP, SELF.type()); + box = Parrot_pmc_new(INTERP, SELF.type()); VTABLE_set_number_keyed(INTERP, box, nextkey, value); } @@ -799,7 +799,7 @@ Sets C as the value for C<*key>. box = hash_value_to_pmc(INTERP, hash, b->value); else { /* autovivify an Hash */ - box = pmc_new(INTERP, SELF.type()); + box = Parrot_pmc_new(INTERP, SELF.type()); parrot_hash_put(INTERP, hash, keystr, hash_value_from_pmc(INTERP, hash, box)); } @@ -994,7 +994,7 @@ Return a new iterator. */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_HashIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_HashIterator, SELF); } /* diff --git a/src/pmc/hashiterator.pmc b/src/pmc/hashiterator.pmc index fbb25ccde9..d8416cb7e0 100644 --- a/src/pmc/hashiterator.pmc +++ b/src/pmc/hashiterator.pmc @@ -229,7 +229,7 @@ the next one. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS, "StopIteration"); - ret = pmc_new(INTERP, enum_class_HashIteratorKey); + ret = Parrot_pmc_new(INTERP, enum_class_HashIteratorKey); VTABLE_set_pointer_keyed_int(INTERP, ret, 0, attrs->parrot_hash); VTABLE_set_pointer_keyed_int(INTERP, ret, 1, attrs->bucket); diff --git a/src/pmc/imageio.pmc b/src/pmc/imageio.pmc index 012300467a..2ee8588d75 100644 --- a/src/pmc/imageio.pmc +++ b/src/pmc/imageio.pmc @@ -148,7 +148,7 @@ visit_todo_list_thaw(PARROT_INTERP, SHIM(PMC* pmc_not_used), ARGIN(PMC* info)) if (type <= 0 || type > interp->n_vtable_max) Parrot_ex_throw_from_c_args(interp, NULL, 1, "Unknown PMC type to thaw %d", type); - pmc = pmc_new_noinit(interp, type); + pmc = Parrot_pmc_new_noinit(interp, type); VTABLE_thaw(interp, pmc, info); { @@ -290,7 +290,7 @@ Initializes the PMC. VTABLE void init() { PARROT_IMAGEIO(SELF)->thaw_ptr = NULL; PARROT_IMAGEIO(SELF)->buffer = NULL; - PARROT_IMAGEIO(SELF)->todo = pmc_new(INTERP, enum_class_ResizablePMCArray); + PARROT_IMAGEIO(SELF)->todo = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); PARROT_IMAGEIO(SELF)->seen = PMCNULL; PARROT_IMAGEIO(SELF)->id_list = PMCNULL; PARROT_IMAGEIO(SELF)->id = 0; @@ -533,7 +533,7 @@ Removes and returns a reference to a pmc from the start of the image. PARROT_IMAGEIO(SELF)->pf->header, PACKFILE_HEADER_BYTES); INC_VISIT_CURSOR(SELF, header_length); - PARROT_IMAGEIO(SELF)->seen = pmc_new(INTERP, enum_class_Hash); + PARROT_IMAGEIO(SELF)->seen = Parrot_pmc_new(INTERP, enum_class_Hash); VTABLE_set_pointer(INTERP, PARROT_IMAGEIO(SELF)->seen, parrot_new_intval_hash(INTERP)); @@ -547,7 +547,7 @@ Removes and returns a reference to a pmc from the start of the image. PARROT_IMAGEIO(SELF)->what = VISIT_THAW_NORMAL; PARROT_IMAGEIO(SELF)->visit_pmc_now = visit_todo_list_thaw; PARROT_IMAGEIO(SELF)->buffer = (Buffer *)image; - PARROT_IMAGEIO(SELF)->id_list = pmc_new(INTERP, enum_class_ResizablePMCArray); + PARROT_IMAGEIO(SELF)->id_list = Parrot_pmc_new(INTERP, enum_class_ResizablePMCArray); PARROT_ASSERT(image->_bufstart == image->strstart); diff --git a/src/pmc/integer.pmc b/src/pmc/integer.pmc index f71332a3e8..e7191ccd4a 100644 --- a/src/pmc/integer.pmc +++ b/src/pmc/integer.pmc @@ -84,7 +84,7 @@ Creates an exact duplicate of this PMC. */ VTABLE PMC *clone() { - PMC * const clone = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const clone = Parrot_pmc_new(INTERP, SELF->vtable->base_type); VTABLE_set_integer_native(INTERP, clone, SELF.get_integer()); return clone; } @@ -265,7 +265,7 @@ Adds C to the integer and returns the result in C<*dest>. const INTVAL c = a + b; if ((c^a) >= 0 || (c^b) >= 0) { - dest = pmc_new(INTERP, VTABLE_type(interp, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(interp, SELF)); /* need this for e.g. Undef PMC */ VTABLE_set_integer_native(INTERP, dest, c); @@ -274,7 +274,7 @@ Adds C to the integer and returns the result in C<*dest>. else { PMC * temp; maybe_throw_overflow_error(interp); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, a); return VTABLE_add(interp, temp, value, dest); } @@ -283,7 +283,7 @@ Adds C to the integer and returns the result in C<*dest>. MULTI PMC *add(Complex value, PMC *dest) { const INTVAL a = SELF.get_integer(); - dest = pmc_new(INTERP, VTABLE_type(INTERP, value)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, value)); VTABLE_set_number_native(INTERP, dest, a + VTABLE_get_number_keyed_int(INTERP, value, 0)); @@ -297,14 +297,14 @@ Adds C to the integer and returns the result in C<*dest>. MULTI PMC *add(BigInt value, PMC *dest) { PMC *temp; maybe_throw_overflow_error(interp); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, SELF.get_integer()); return VTABLE_add(interp, temp, value, dest); } MULTI PMC *add(DEFAULT value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(interp, value)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(interp, value)); VTABLE_set_number_native(INTERP, dest, SELF.get_integer() + VTABLE_get_number(INTERP, value)); @@ -317,7 +317,7 @@ Adds C to the integer and returns the result in C<*dest>. const INTVAL c = a + b; if ((c^a) >= 0 || (c^b) >= 0) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, c); return dest; @@ -325,7 +325,7 @@ Adds C to the integer and returns the result in C<*dest>. else { PMC *temp; maybe_throw_overflow_error(interp); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, a); return VTABLE_add_int(interp, temp, b, dest); } @@ -407,7 +407,7 @@ C and C always. const INTVAL c = a - b; if ((c^a) >= 0 || (c^~b) >= 0) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, c); return dest; @@ -415,7 +415,7 @@ C and C always. else { PMC *temp; maybe_throw_overflow_error(interp); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, a); return VTABLE_subtract(interp, temp, value, dest); } @@ -424,7 +424,7 @@ C and C always. MULTI PMC *subtract(Complex value, PMC *dest) { const INTVAL a = SELF.get_integer(); - dest = pmc_new(INTERP, VTABLE_type(INTERP, value)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, value)); VTABLE_set_number_native(INTERP, dest, a - VTABLE_get_number_keyed_int(INTERP, value, 0)); @@ -438,14 +438,14 @@ C and C always. MULTI PMC *subtract(BigInt value, PMC *dest) { PMC *temp; maybe_throw_overflow_error(interp); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, SELF.get_integer()); return VTABLE_subtract(interp, temp, value, dest); } MULTI PMC *subtract(DEFAULT value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, value)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, value)); VTABLE_set_number_native(INTERP, dest, SELF.get_integer() - VTABLE_get_number(INTERP, value)); @@ -468,7 +468,7 @@ Subtracts C from the integer and returns the result in C<*dest>. const INTVAL c = a - b; if ((c^a) >= 0 || (c^~b) >= 0) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, c); return dest; @@ -476,7 +476,7 @@ Subtracts C from the integer and returns the result in C<*dest>. else { PMC *temp; maybe_throw_overflow_error(interp); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, a); return VTABLE_subtract_int(interp, temp, b, dest); } @@ -568,7 +568,7 @@ Multiplies the integer by C<*value> and returns the result in C<*dest>. const double cf = (double)a * (double)b; if ((double) c == cf) { - dest = pmc_new(INTERP, VTABLE_type(interp, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(interp, SELF)); VTABLE_set_integer_native(INTERP, dest, c); return dest; @@ -576,7 +576,7 @@ Multiplies the integer by C<*value> and returns the result in C<*dest>. else { PMC *temp; maybe_throw_overflow_error(INTERP); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, a); return VTABLE_multiply(INTERP, temp, value, dest); } @@ -600,7 +600,7 @@ Multiplies the integer by C<*value> and returns the result in C<*dest>. MULTI PMC *multiply(DEFAULT value, PMC *dest) { const FLOATVAL valf = VTABLE_get_number(INTERP, value); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() * valf); return dest; @@ -613,7 +613,7 @@ Multiplies the integer by C<*value> and returns the result in C<*dest>. const double cf = (double)a * (double)b; if ((double) c == cf) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, c); return dest; @@ -621,7 +621,7 @@ Multiplies the integer by C<*value> and returns the result in C<*dest>. else { PMC *temp; maybe_throw_overflow_error(INTERP); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, a); return VTABLE_multiply_int(INTERP, temp, b, dest); } @@ -708,7 +708,7 @@ Divides C by C inplace. MULTI PMC *divide(BigInt value, PMC *dest) { PMC *temp; maybe_throw_overflow_error(INTERP); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, SELF.get_integer()); return VTABLE_divide(INTERP, temp, value, dest); } @@ -720,7 +720,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() / d); return dest; } @@ -769,7 +769,7 @@ Divides C by C inplace. MULTI PMC *floor_divide(BigInt value, PMC *dest) { PMC *temp; maybe_throw_overflow_error(INTERP); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, SELF.get_integer()); return VTABLE_floor_divide(INTERP, temp, value, dest); } @@ -783,7 +783,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); f = floor(SELF.get_number() / d); VTABLE_set_integer_native(INTERP, dest, (INTVAL)f); @@ -798,7 +798,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); f = floor(SELF.get_number() / value); VTABLE_set_integer_native(INTERP, dest, (INTVAL)f); @@ -813,7 +813,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); f = floor(SELF.get_number() / value); VTABLE_set_integer_native(INTERP, dest, (INTVAL)f); @@ -892,7 +892,7 @@ Calculates modulus in place. MULTI PMC *modulus(BigInt value, PMC *dest) { PMC *temp; maybe_throw_overflow_error(INTERP); - temp = pmc_new(interp, enum_class_BigInt); + temp = Parrot_pmc_new(interp, enum_class_BigInt); VTABLE_set_integer_native(interp, temp, SELF.get_integer()); return VTABLE_modulus(INTERP, temp, value, dest); } @@ -905,7 +905,7 @@ Calculates modulus in place. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "int modulus by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, intval_mod(SELF.get_integer(), d)); @@ -918,7 +918,7 @@ Calculates modulus in place. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "int modulus by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, intval_mod(SELF.get_integer(), value)); @@ -931,7 +931,7 @@ Calculates modulus in place. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "int modulus by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, intval_mod(SELF.get_integer(), (INTVAL)value)); @@ -993,7 +993,7 @@ The C<==> operation. switch (value->vtable->base_type) { case enum_class_BigInt: - temp = pmc_new(INTERP, enum_class_BigInt); + temp = Parrot_pmc_new(INTERP, enum_class_BigInt); VTABLE_set_integer_native(INTERP, temp, SELF.get_integer()); Parrot_mmd_multi_dispatch_from_c_args(interp, "is_equal", "PP->I", temp, value, &retval); @@ -1154,7 +1154,7 @@ Sets C to the absolute value of SELF. const INTVAL a = abs(SELF.get_integer()); /* TT # 1245 overflow for -maxint */ - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, a); return dest; diff --git a/src/pmc/key.pmc b/src/pmc/key.pmc index 68b4fbb09f..2f9abc1b1d 100644 --- a/src/pmc/key.pmc +++ b/src/pmc/key.pmc @@ -54,7 +54,7 @@ Creates and returns a clone of the key. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); PMC *dkey = dest; PMC *key = SELF; diff --git a/src/pmc/lexinfo.pmc b/src/pmc/lexinfo.pmc index 4179f24e0f..48d47f72f3 100644 --- a/src/pmc/lexinfo.pmc +++ b/src/pmc/lexinfo.pmc @@ -95,7 +95,7 @@ C, which gets an array of the names of the symbols in this lexpad. VTABLE PMC *inspect_str(STRING *what) { if (Parrot_str_equal(interp, what, CONST_STRING(interp, "symbols"))) { - PMC *result = pmc_new(interp, enum_class_ResizableStringArray); + PMC *result = Parrot_pmc_new(interp, enum_class_ResizableStringArray); Hash *hash = (Hash *)SELF.get_pointer(); UINTVAL entries = hash->entries; UINTVAL found = 0; diff --git a/src/pmc/managedstruct.pmc b/src/pmc/managedstruct.pmc index 2dfa4db04d..6a37d2ac00 100644 --- a/src/pmc/managedstruct.pmc +++ b/src/pmc/managedstruct.pmc @@ -142,7 +142,7 @@ of knowing how to make a deep copy of the pointer contents. void *clone_data = PARROT_MANAGEDSTRUCT(SELF)->custom_clone_priv; return clone_func(interp, SELF, clone_data); } - dest = pmc_new_init(interp, SELF->vtable->base_type, + dest = Parrot_pmc_new_init(interp, SELF->vtable->base_type, PARROT_MANAGEDSTRUCT(SELF)->init); if (PARROT_MANAGEDSTRUCT(SELF)->ptr) diff --git a/src/pmc/namespace.pmc b/src/pmc/namespace.pmc index 7f67663413..38fa1d54e5 100644 --- a/src/pmc/namespace.pmc +++ b/src/pmc/namespace.pmc @@ -36,7 +36,7 @@ static void add_to_class( else { /* If we don't have a place to hang methods, make one. */ if (PMC_IS_NULL(nsinfo->methods)) - nsinfo->methods = pmc_new(interp, enum_class_Hash); + nsinfo->methods = Parrot_pmc_new(interp, enum_class_Hash); /* Insert it. */ VTABLE_set_pmc_keyed_str(interp, nsinfo->methods, key, value); @@ -70,7 +70,7 @@ ns_insert_sub_keyed_str(PARROT_INTERP, PMC *self, STRING *key, PMC *value) else { /* If we don't have a place to hang vtable methods, make one. */ if (PMC_IS_NULL(vtable)) - nsinfo->vtable = vtable = pmc_new(interp, enum_class_Hash); + nsinfo->vtable = vtable = Parrot_pmc_new(interp, enum_class_Hash); /* Insert it. */ VTABLE_set_pmc_keyed_int(interp, vtable, sub->vtable_index, value); @@ -312,7 +312,7 @@ really a public API. } else { /* create new tuple */ - new_tuple = pmc_new(INTERP, enum_class_FixedPMCArray); + new_tuple = Parrot_pmc_new(INTERP, enum_class_FixedPMCArray); /* flag it as special */ PObj_get_FLAGS(new_tuple) |= FPA_is_ns_ext; @@ -634,7 +634,7 @@ Returns the name of the namespace as an array of strings. */ METHOD get_name() { - PMC * const ar = pmc_new(INTERP, enum_class_ResizableStringArray); + PMC * const ar = Parrot_pmc_new(INTERP, enum_class_ResizableStringArray); INTVAL elements = 0; PMC *ns = SELF; diff --git a/src/pmc/nci.pmc b/src/pmc/nci.pmc index 646d91926a..e07833ac4b 100644 --- a/src/pmc/nci.pmc +++ b/src/pmc/nci.pmc @@ -254,7 +254,7 @@ Creates and returns a clone of the NCI. Parrot_NCI_attributes *nci_info_ret; void *orig_func; - PMC * const ret = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const ret = Parrot_pmc_new(INTERP, SELF->vtable->base_type); nci_info_ret = PARROT_NCI(ret); /* FIXME if data is malloced (JIT/i386!) then we need diff --git a/src/pmc/object.pmc b/src/pmc/object.pmc index 909edef167..7566d0769d 100644 --- a/src/pmc/object.pmc +++ b/src/pmc/object.pmc @@ -126,7 +126,7 @@ cache_method(PARROT_INTERP, PMC *_class, STRING *name, PMC *method) GETATTR_Class_meth_cache(interp, _class, cache); if (PMC_IS_NULL(cache)) { - cache = pmc_new(interp, enum_class_Hash); + cache = Parrot_pmc_new(interp, enum_class_Hash); SETATTR_Class_meth_cache(interp, _class, cache); } @@ -812,7 +812,7 @@ Used to mark a PMC as read-only shared. UNLOCK_INTERPRETER(master); ret = SELF; - _true = pmc_new(INTERP, enum_class_Integer); + _true = Parrot_pmc_new(INTERP, enum_class_Integer); /* Setting the '_ro' property switches to the read-only vtable */ VTABLE_set_integer_native(INTERP, _true, 1); diff --git a/src/pmc/orderedhash.pmc b/src/pmc/orderedhash.pmc index 147e3ad00a..d15f855f1c 100644 --- a/src/pmc/orderedhash.pmc +++ b/src/pmc/orderedhash.pmc @@ -80,7 +80,7 @@ Overall design heavily inspired by C. /* Create new stored item. FixedPMCArray of (key, value, prev, next). */ static PMC* create_item(PARROT_INTERP, ARGIN(PMC *key), ARGIN(PMC *value)) { - PMC *ret = pmc_new(interp, enum_class_FixedPMCArray); + PMC *ret = Parrot_pmc_new(interp, enum_class_FixedPMCArray); VTABLE_set_integer_native(interp, ret, ORDERED_HASH_ITEM_MAX); VTABLE_set_pmc_keyed_int(interp, ret, ORDERED_HASH_ITEM_KEY, key); @@ -130,7 +130,7 @@ find_bounds(PARROT_INTERP, PMC *pmc_hash, PMC **first, PMC **last) { /* Helpers for boxing values */ static PMC* box_string(PARROT_INTERP, STRING *str) { - PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, + PMC * const ret = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String)); VTABLE_set_string_native(interp, ret, str); return ret; @@ -138,7 +138,7 @@ box_string(PARROT_INTERP, STRING *str) { static PMC* box_integer(PARROT_INTERP, INTVAL val) { - PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, + PMC * const ret = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Integer)); VTABLE_set_integer_native(interp, ret, val); return ret; @@ -146,7 +146,7 @@ box_integer(PARROT_INTERP, INTVAL val) { static PMC* box_number(PARROT_INTERP, FLOATVAL val) { - PMC * const ret = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, + PMC * const ret = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_Float)); VTABLE_set_number_native(interp, ret, val); return ret; @@ -173,7 +173,7 @@ Create new instance of OrderedHash. mem_allocate_zeroed_typed(Parrot_OrderedHash_attributes); PMC_data(SELF) = attrs; - attrs->hash = pmc_new(INTERP, enum_class_Hash); + attrs->hash = Parrot_pmc_new(INTERP, enum_class_Hash); attrs->first = PMCNULL; attrs->last = PMCNULL; @@ -211,7 +211,7 @@ Return a new iterator */ VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_OrderedHashIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_OrderedHashIterator, SELF); } /* @@ -269,7 +269,7 @@ Main set function. } /* Create new entry */ - list_entry = pmc_new(INTERP, enum_class_FixedPMCArray); + list_entry = Parrot_pmc_new(INTERP, enum_class_FixedPMCArray); VTABLE_set_integer_native(INTERP, list_entry, ORDERED_HASH_ITEM_MAX); VTABLE_set_pmc_keyed_int(INTERP, list_entry, ORDERED_HASH_ITEM_VALUE, value); VTABLE_set_pmc_keyed_int(INTERP, list_entry, ORDERED_HASH_ITEM_KEY, key); @@ -337,7 +337,7 @@ Sets the PMC value of the element at index C to C. /* Now we have chicken and egg problem during freeze/thaw */ /* When we try to thaw OrderedHash which stores HLL mapping */ /* Reported by François Perrad */ - PMC *pkey = pmc_new(INTERP, enum_class_String); + PMC *pkey = Parrot_pmc_new(INTERP, enum_class_String); VTABLE_set_string_native(INTERP, pkey, key); VTABLE_set_pmc_keyed(INTERP, SELF, pkey, value); } @@ -392,7 +392,7 @@ Sets the PMC value of the element at index C to C. } VTABLE PMC *get_pmc_keyed_str(STRING *key) { - PMC *pkey = pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String)); + PMC *pkey = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_String)); VTABLE_set_string_native(INTERP, pkey, key); return STATICSELF.get_pmc_keyed(pkey); } @@ -506,21 +506,21 @@ The created key = "\1idx". } VTABLE void set_integer_keyed_int(INTVAL idx, INTVAL value) { - PMC * const v = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const v = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_Integer)); VTABLE_set_integer_native(INTERP, v, value); SELF.set_pmc_keyed_int(idx, v); } VTABLE void set_number_keyed_int(INTVAL idx, FLOATVAL value) { - PMC * const v = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const v = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_Float)); VTABLE_set_number_native(INTERP, v, value); SELF.set_pmc_keyed_int(idx, v); } VTABLE void set_string_keyed_int(INTVAL idx, STRING *value) { - PMC * const v = pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, + PMC * const v = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(INTERP, enum_class_String)); VTABLE_set_string_native(INTERP, v, value); SELF.set_pmc_keyed_int(idx, v); @@ -715,7 +715,7 @@ the clone via integers has different indices, if items were deleted. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); Parrot_OrderedHash_attributes *clone_attrs = PARROT_ORDEREDHASH(dest); diff --git a/src/pmc/os.pmc b/src/pmc/os.pmc index 3bbdc32fa7..99d80ffe96 100644 --- a/src/pmc/os.pmc +++ b/src/pmc/os.pmc @@ -237,7 +237,7 @@ https://trac.parrot.org/parrot/ticket/849 errmsg); } else { - PMC * const array = pmc_new(INTERP, enum_class_FixedPMCArray); + PMC * const array = Parrot_pmc_new(INTERP, enum_class_FixedPMCArray); VTABLE_set_integer_native(INTERP, array, 13); VTABLE_set_integer_keyed_int(INTERP, array, 0, @@ -315,7 +315,7 @@ Stats a file, and returns a 13 position array as in Perl: errmsg); } else { - PMC * const array = pmc_new(INTERP, enum_class_FixedPMCArray); + PMC * const array = Parrot_pmc_new(INTERP, enum_class_FixedPMCArray); VTABLE_set_integer_native(INTERP, array, 13); VTABLE_set_integer_keyed_int(INTERP, array, 0, @@ -490,7 +490,7 @@ reads entries from a directory. errmsg); } - array = pmc_new(INTERP, enum_class_ResizableStringArray); + array = Parrot_pmc_new(INTERP, enum_class_ResizableStringArray); while ((dirent = readdir(dir)) != NULL) { retval = Parrot_str_new(INTERP, dirent->d_name, 0) ; diff --git a/src/pmc/packfile.pmc b/src/pmc/packfile.pmc index 908cafada5..bf3c07543b 100644 --- a/src/pmc/packfile.pmc +++ b/src/pmc/packfile.pmc @@ -71,7 +71,7 @@ Initialize the structure. (Create a blank PackFile object.) PackFile *pf; attrs->uuid = Parrot_str_new_noinit(INTERP, enum_stringrep_one, 0); - attrs->directory = pmc_new(INTERP, enum_class_PackfileDirectory); + attrs->directory = Parrot_pmc_new(INTERP, enum_class_PackfileDirectory); /* Create dummy PackFile and copy default attributes to self */ pf = PackFile_new(interp, 0); diff --git a/src/pmc/packfileannotations.pmc b/src/pmc/packfileannotations.pmc index c1d9c8050c..3c627a16d8 100644 --- a/src/pmc/packfileannotations.pmc +++ b/src/pmc/packfileannotations.pmc @@ -49,7 +49,7 @@ Initialize PackfileAnnotations. Parrot_PackfileAnnotations_attributes * attrs = PMC_data_typed(SELF, Parrot_PackfileAnnotations_attributes*); - attrs->annotations = pmc_new(interp, enum_class_ResizablePMCArray); + attrs->annotations = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); /* Don't initialize C. It will be set to NULL bu auto_attrs handling. And should be set to proper PMC in set_directory. @@ -220,7 +220,7 @@ Initialize PackfileAnnotations from PackFile_Annotations*. for (i = 0; i < a->num_entries; ++i) { PackFile_Annotations_Entry *entry = a->entries[i]; PackFile_Annotations_Key *key = a->keys[entry->key]; - annotation = pmc_new(interp, enum_class_PackfileAnnotation); + annotation = Parrot_pmc_new(interp, enum_class_PackfileAnnotation); /* Poke directly to annotation attributes. */ annotation_attrs = PARROT_PACKFILEANNOTATION(annotation); @@ -289,9 +289,9 @@ Create PackFile_Annotations* from self. ... ] */ - keys = pmc_new(interp, enum_class_Hash); - names = pmc_new(interp, enum_class_ResizableIntegerArray); - types = pmc_new(interp, enum_class_ResizableIntegerArray); + keys = Parrot_pmc_new(interp, enum_class_Hash); + names = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray); + types = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray); last_key_id = -1; /* Iterate over stored annotations and create Key if required. */ @@ -306,7 +306,7 @@ Create PackFile_Annotations* from self. PMC * key_array = VTABLE_get_pmc_keyed_str(interp, keys, entity_attrs->name); if (PMC_IS_NULL(key_array)) { /* Never see this name before. Create new FIA and add to keys. */ - key_array = pmc_new(interp, enum_class_FixedIntegerArray); + key_array = Parrot_pmc_new(interp, enum_class_FixedIntegerArray); VTABLE_set_integer_native(interp, key_array, 3); VTABLE_set_integer_keyed_int(interp, key_array, 0, -1); VTABLE_set_integer_keyed_int(interp, key_array, 1, -1); diff --git a/src/pmc/packfileconstanttable.pmc b/src/pmc/packfileconstanttable.pmc index 5ef94af591..430c3fed7a 100644 --- a/src/pmc/packfileconstanttable.pmc +++ b/src/pmc/packfileconstanttable.pmc @@ -45,8 +45,8 @@ Create empty PackfileConstantTable. Parrot_PackfileConstantTable_attributes * attrs = PMC_data_typed(SELF, Parrot_PackfileConstantTable_attributes*); - attrs->constants = pmc_new(interp, enum_class_ResizablePMCArray); - attrs->types = pmc_new(interp, enum_class_ResizableIntegerArray); + attrs->constants = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + attrs->types = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray); PObj_custom_mark_SET(SELF); PMC_data(SELF) = attrs; diff --git a/src/pmc/packfiledirectory.pmc b/src/pmc/packfiledirectory.pmc index 5eb4cfadd9..7ba2968bf3 100644 --- a/src/pmc/packfiledirectory.pmc +++ b/src/pmc/packfiledirectory.pmc @@ -42,7 +42,7 @@ Initialize PackfileDirectory. Parrot_PackfileDirectory_attributes * attrs = PMC_data_typed(SELF, Parrot_PackfileDirectory_attributes*); - attrs->hash = pmc_new(interp, enum_class_Hash); + attrs->hash = Parrot_pmc_new(interp, enum_class_Hash); PObj_custom_mark_SET(SELF); } @@ -110,7 +110,7 @@ Initialize PackfileDirectory from PackFile_Directory. break; } - segment = pmc_new(interp, pmc_type); + segment = Parrot_pmc_new(interp, pmc_type); name = pfseg->name; VTABLE_set_pmc_keyed_str(interp, SELF, name, segment); diff --git a/src/pmc/packfilefixuptable.pmc b/src/pmc/packfilefixuptable.pmc index 90853ee469..b12c54396b 100644 --- a/src/pmc/packfilefixuptable.pmc +++ b/src/pmc/packfilefixuptable.pmc @@ -42,7 +42,7 @@ Create empty PackfileFixupTable. Parrot_PackfileFixupTable_attributes * attrs = PMC_data_typed(SELF, Parrot_PackfileFixupTable_attributes*); - attrs->entries = pmc_new(interp, enum_class_ResizablePMCArray); + attrs->entries = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); PObj_custom_mark_SET(SELF); } @@ -89,7 +89,7 @@ Initialize from PackFile_FixupTable pointer. for (i = 0; i < table->fixup_count; ++i) { val = table->fixups[i]; - entry = pmc_new(interp, enum_class_PackfileFixupEntry); + entry = Parrot_pmc_new(interp, enum_class_PackfileFixupEntry); VTABLE_set_pointer(interp, entry, (void*)val); VTABLE_set_pmc_keyed_int(interp, attrs->entries, i, entry); } diff --git a/src/pmc/packfilerawsegment.pmc b/src/pmc/packfilerawsegment.pmc index 2998c9598b..2a58561651 100644 --- a/src/pmc/packfilerawsegment.pmc +++ b/src/pmc/packfilerawsegment.pmc @@ -44,7 +44,7 @@ Create empty PackfileRawSegment. Parrot_PackfileRawSegment_attributes * attrs = PMC_data_typed(SELF, Parrot_PackfileRawSegment_attributes*); - attrs->opcodes = pmc_new(interp, enum_class_ResizableIntegerArray); + attrs->opcodes = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray); attrs->type = PF_BYTEC_SEG; PObj_custom_mark_SET(SELF); diff --git a/src/pmc/parrotinterpreter.pmc b/src/pmc/parrotinterpreter.pmc index 34e07f0c0d..22c0b1cdd3 100644 --- a/src/pmc/parrotinterpreter.pmc +++ b/src/pmc/parrotinterpreter.pmc @@ -53,7 +53,7 @@ clone_interpreter(Parrot_Interp d, Parrot_Interp s, INTVAL flags) /* we block GC runs while cloning since C is not yet running */ Parrot_block_GC_mark(d); - d->scheduler = pmc_new(d, enum_class_Scheduler); + d->scheduler = Parrot_pmc_new(d, enum_class_Scheduler); d->scheduler = VTABLE_share_ro(d, d->scheduler); /* can't copy directly, unless you want double-frees */ @@ -305,7 +305,7 @@ Sets C to C<*value>. VTABLE void set_pointer(void *value) { /* XXX: init_world in src/global_setup.c needs to create a - * ParrotInterpreter through pmc_new_noinit. If this PMC hasn't been + * ParrotInterpreter through Parrot_pmc_new_noinit. If this PMC hasn't been * initialized, cheat by initializing instead. */ if (!PMC_data(SELF)) { Parrot_ParrotInterpreter_attributes *attrs = @@ -559,7 +559,7 @@ Introspection interface. C can be: pc - seg->base.data, NULL); } - return pmc_new(interp, enum_class_Hash); + return Parrot_pmc_new(interp, enum_class_Hash); } Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_ATTRIB_NOT_FOUND, @@ -621,7 +621,7 @@ XXX this should of course call C and use freeze/thaw. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); clone_interpreter(PMC_interp(dest), PMC_interp(SELF), PARROT_CLONE_DEFAULT); diff --git a/src/pmc/parrotlibrary.pmc b/src/pmc/parrotlibrary.pmc index c4d115a37c..c9607ceb6b 100644 --- a/src/pmc/parrotlibrary.pmc +++ b/src/pmc/parrotlibrary.pmc @@ -77,7 +77,7 @@ Creates and returns a clone of the library. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); PMC_oplib_init(dest) = PMC_oplib_init(SELF); PMC_dlhandle(dest) = PMC_dlhandle(SELF); diff --git a/src/pmc/pmcproxy.pmc b/src/pmc/pmcproxy.pmc index 249947c9eb..fb578c1a6c 100644 --- a/src/pmc/pmcproxy.pmc +++ b/src/pmc/pmcproxy.pmc @@ -79,7 +79,7 @@ Initializes a PMCProxy PMC. VTABLE void init() { Parrot_Class_attributes * const _pmc = (Parrot_Class_attributes *) PMC_data(SELF); - PMC * const new_attribute = pmc_new(interp, enum_class_Hash); + PMC * const new_attribute = Parrot_pmc_new(interp, enum_class_Hash); STRING * const name = CONST_STRING(interp, "proxy"); /* Set flag for custom GC mark. */ @@ -89,16 +89,16 @@ Initializes a PMCProxy PMC. _pmc->id = 0; _pmc->name = CONST_STRING(interp, ""); _pmc->_namespace = PMCNULL; - _pmc->parents = pmc_new(interp, enum_class_ResizablePMCArray); - _pmc->all_parents = pmc_new(interp, enum_class_ResizablePMCArray); - _pmc->roles = pmc_new(interp, enum_class_ResizablePMCArray); - _pmc->methods = pmc_new(interp, enum_class_Hash); - _pmc->vtable_overrides = pmc_new(interp, enum_class_Hash); - _pmc->parent_overrides = pmc_new(interp, enum_class_Hash); - _pmc->attrib_metadata = pmc_new(interp, enum_class_Hash); + _pmc->parents = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + _pmc->all_parents = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + _pmc->roles = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + _pmc->methods = Parrot_pmc_new(interp, enum_class_Hash); + _pmc->vtable_overrides = Parrot_pmc_new(interp, enum_class_Hash); + _pmc->parent_overrides = Parrot_pmc_new(interp, enum_class_Hash); + _pmc->attrib_metadata = Parrot_pmc_new(interp, enum_class_Hash); _pmc->attrib_index = PMCNULL; _pmc->attrib_cache = PMCNULL; - _pmc->resolve_method = pmc_new(interp, enum_class_ResizablePMCArray); + _pmc->resolve_method = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); /* Set up the attribute storage for the proxy instance */ VTABLE_set_string_keyed_str(interp, new_attribute, CONST_STRING(interp, "name"), name); @@ -194,9 +194,9 @@ Creates an instance of the PMC. Parrot_Class_attributes * const _pmc = PARROT_CLASS(SELF); if (!PMC_IS_NULL(init)) - return pmc_new_init(interp, _pmc->id, init); + return Parrot_pmc_new_init(interp, _pmc->id, init); - return pmc_new(interp, _pmc->id); + return Parrot_pmc_new(interp, _pmc->id); } /* @@ -315,7 +315,7 @@ Returns whether the class does the role with the given C<*rolename>. VTABLE INTVAL does(STRING *role_name) { Parrot_Class_attributes *_class = PARROT_CLASS(SELF); INTVAL id = _class->id; - PMC *proxied = pmc_new(interp, id); + PMC *proxied = Parrot_pmc_new(interp, id); if (VTABLE_does(interp, proxied, role_name)) return 1; @@ -359,7 +359,7 @@ inspect_str. STRING * const meth_str = CONST_STRING(interp, "methods"); STRING * const parents_str = CONST_STRING(interp, "parents"); - PMC * const metadata = pmc_new(interp, enum_class_Hash); + PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_pmc_keyed_str(interp, metadata, name_str, VTABLE_inspect_str(interp, SELF, name_str)); diff --git a/src/pmc/pointer.pmc b/src/pmc/pointer.pmc index b6eacdf828..92e261f500 100644 --- a/src/pmc/pointer.pmc +++ b/src/pmc/pointer.pmc @@ -67,7 +67,7 @@ Creates and returns a clone of the pointer. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new_noinit(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new_noinit(INTERP, SELF->vtable->base_type); PObj_custom_mark_SET(dest); PMC_data(dest) = PMC_data(SELF); return dest; diff --git a/src/pmc/resizablebooleanarray.pmc b/src/pmc/resizablebooleanarray.pmc index 3b1fc2a7b1..71c4b63746 100644 --- a/src/pmc/resizablebooleanarray.pmc +++ b/src/pmc/resizablebooleanarray.pmc @@ -373,7 +373,7 @@ Returns a copy of the array. UINTVAL tail_pos, head_pos; unsigned char * my_bit_array, * dest_bit_array; - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); GET_ATTR_bit_array(INTERP, SELF, my_bit_array); GET_ATTR_size(INTERP, SELF, tail_pos); diff --git a/src/pmc/resizablepmcarray.pmc b/src/pmc/resizablepmcarray.pmc index 20fc3e1dc9..92d27f9854 100644 --- a/src/pmc/resizablepmcarray.pmc +++ b/src/pmc/resizablepmcarray.pmc @@ -366,7 +366,7 @@ the array. VTABLE void push_float(FLOATVAL value) { INTVAL size = PMC_size(SELF); - PMC *val = pmc_new(INTERP, enum_class_Float); + PMC *val = Parrot_pmc_new(INTERP, enum_class_Float); VTABLE_set_number_native(INTERP, val, value); SELF.set_pmc_keyed_int(size, val); @@ -377,7 +377,7 @@ the array. VTABLE void push_integer(INTVAL value) { INTVAL size = PMC_size(SELF); - PMC *val = pmc_new(INTERP, enum_class_Integer); + PMC *val = Parrot_pmc_new(INTERP, enum_class_Integer); VTABLE_set_integer_native(INTERP, val, value); SELF.set_pmc_keyed_int(size, val); @@ -397,7 +397,7 @@ the array. VTABLE void push_string(STRING *value) { INTVAL size = PMC_size(SELF); - PMC *val = pmc_new(INTERP, enum_class_String); + PMC *val = Parrot_pmc_new(INTERP, enum_class_String); VTABLE_assign_string_native(INTERP, val, value); SELF.set_pmc_keyed_int(size, val); @@ -501,7 +501,7 @@ the array. VTABLE void unshift_float(FLOATVAL value) { INTVAL size = PMC_size(SELF); - PMC *val = pmc_new(INTERP, enum_class_Float); + PMC *val = Parrot_pmc_new(INTERP, enum_class_Float); PMC **data; INTVAL i; @@ -521,7 +521,7 @@ the array. VTABLE void unshift_integer(INTVAL value) { INTVAL size = PMC_size(SELF); - PMC *val = pmc_new(INTERP, enum_class_Integer); + PMC *val = Parrot_pmc_new(INTERP, enum_class_Integer); PMC **data; INTVAL i; @@ -559,7 +559,7 @@ the array. VTABLE void unshift_string(STRING *value) { INTVAL size = PMC_size(SELF); - PMC *val = pmc_new(INTERP, enum_class_String); + PMC *val = Parrot_pmc_new(INTERP, enum_class_String); PMC **data; INTVAL i; diff --git a/src/pmc/resizablestringarray.pmc b/src/pmc/resizablestringarray.pmc index 97fdc7ac80..7e1ee7bce7 100644 --- a/src/pmc/resizablestringarray.pmc +++ b/src/pmc/resizablestringarray.pmc @@ -144,7 +144,7 @@ Removes and returns the last element in the array. VTABLE PMC *pop_pmc() { STRING *strval = SELF.pop_string(); - PMC *value = pmc_new(INTERP, enum_class_String); + PMC *value = Parrot_pmc_new(INTERP, enum_class_String); VTABLE_set_string_native(INTERP, value, strval); @@ -308,7 +308,7 @@ Removes and returns the first element in the array. VTABLE PMC *shift_pmc() { STRING *strval = SELF.shift_string(); - PMC *value = pmc_new(INTERP, enum_class_String); + PMC *value = Parrot_pmc_new(INTERP, enum_class_String); VTABLE_set_string_native(INTERP, value, strval); @@ -374,7 +374,7 @@ the array. */ VTABLE void push_integer(INTVAL value) { - PMC *ret = pmc_new(INTERP, enum_class_String); + PMC *ret = Parrot_pmc_new(INTERP, enum_class_String); STRING *val; VTABLE_set_integer_native(INTERP, ret, value); @@ -394,7 +394,7 @@ the array. */ VTABLE void push_float(FLOATVAL value) { - PMC *ret = pmc_new(INTERP, enum_class_String); + PMC *ret = Parrot_pmc_new(INTERP, enum_class_String); STRING *val; VTABLE_set_number_native(INTERP, ret, value); @@ -424,7 +424,7 @@ Removes and returns a String PMC from the start of the array. "ResizableStringArray: Can't shift from an empty array!"); value = SELF.get_string_keyed_int(0); - ret = pmc_new(INTERP, enum_class_String); + ret = Parrot_pmc_new(INTERP, enum_class_String); VTABLE_set_string_native(INTERP, ret, value); SELF.delete_keyed_int(0); @@ -486,7 +486,7 @@ the array. */ VTABLE void unshift_integer(INTVAL value) { - PMC *ret = pmc_new(INTERP, enum_class_String); + PMC *ret = Parrot_pmc_new(INTERP, enum_class_String); STRING *val; VTABLE_set_integer_native(INTERP, ret, value); @@ -506,7 +506,7 @@ the array. */ VTABLE void unshift_float(FLOATVAL value) { - PMC *ret = pmc_new(INTERP, enum_class_String); + PMC *ret = Parrot_pmc_new(INTERP, enum_class_String); STRING *val; VTABLE_set_number_native(INTERP, ret, value); diff --git a/src/pmc/role.pmc b/src/pmc/role.pmc index fec0a787eb..45c4fefd18 100644 --- a/src/pmc/role.pmc +++ b/src/pmc/role.pmc @@ -230,9 +230,9 @@ C. /* Set up the object. */ role->name = CONST_STRING(interp, ""); role->_namespace = PMCNULL; - role->roles = pmc_new(interp, enum_class_ResizablePMCArray); - role->methods = pmc_new(interp, enum_class_Hash); - role->attrib_metadata = pmc_new(interp, enum_class_Hash); + role->roles = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + role->methods = Parrot_pmc_new(interp, enum_class_Hash); + role->attrib_metadata = Parrot_pmc_new(interp, enum_class_Hash); } VTABLE void init_pmc(PMC *init_data) { @@ -276,7 +276,7 @@ Enters the attribute in the C array. VTABLE void add_attribute(STRING *name, PMC *type) { Parrot_Role_attributes * const role = PARROT_ROLE(SELF); - PMC * const new_attribute = pmc_new(interp, enum_class_Hash); + PMC * const new_attribute = Parrot_pmc_new(interp, enum_class_Hash); /* Set name and type. */ VTABLE_set_string_keyed_str(interp, new_attribute, CONST_STRING(interp, "name"), name); @@ -388,7 +388,7 @@ composed into this role. PMC *found; if (Parrot_str_equal(interp, what, CONST_STRING(interp, "name"))) { - found = pmc_new(interp, enum_class_String); + found = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, found, role->name); } else if (Parrot_str_equal(interp, what, CONST_STRING(interp, "namespace"))) { @@ -414,7 +414,7 @@ composed into this role. if (found->vtable->base_type == enum_class_Hash) { /* for Hash return values, create and return a shallow * clone because the VTABLE_clone does a deep clone */ - PMC * const hash = pmc_new(interp, enum_class_Hash); + PMC * const hash = Parrot_pmc_new(interp, enum_class_Hash); PMC * const iter = VTABLE_get_iter(interp, found); while (VTABLE_get_bool(interp, iter)) { STRING * key = VTABLE_shift_string(interp, iter); @@ -441,7 +441,7 @@ inspect_str. VTABLE PMC *inspect() { /* Create a hash, then use inspect_str to get all of the data to * fill it up with. */ - PMC * const metadata = pmc_new(interp, enum_class_Hash); + PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash); STRING * const name = CONST_STRING(interp, "name"); STRING * const _namespace = CONST_STRING(interp, "namespace"); @@ -583,7 +583,7 @@ Sets the name of the role, and updates the namespace accordingly. if (got_name) { /* We'll build a hash just containing the name, then give this to * init_role_from_hash - saves some code duplication. */ - PMC *naming_hash = pmc_new(interp, enum_class_Hash); + PMC *naming_hash = Parrot_pmc_new(interp, enum_class_Hash); VTABLE_set_string_keyed_str(interp, naming_hash, CONST_STRING(interp, "name"), name); init_role_from_hash(interp, SELF, naming_hash); } diff --git a/src/pmc/scalar.pmc b/src/pmc/scalar.pmc index b9426c6202..3032e004a6 100644 --- a/src/pmc/scalar.pmc +++ b/src/pmc/scalar.pmc @@ -112,7 +112,7 @@ Adds C to C inplace. MULTI PMC *add(Complex value, PMC *dest) { const FLOATVAL a = SELF.get_number(); - dest = pmc_new(INTERP, VTABLE_type(INTERP, value)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, value)); VTABLE_set_number_native(INTERP, dest, a + VTABLE_get_number_keyed_int(INTERP, value, 0)); @@ -122,7 +122,7 @@ Adds C to C inplace. } MULTI PMC *add(DEFAULT value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() + VTABLE_get_number(INTERP, value)); @@ -130,7 +130,7 @@ Adds C to C inplace. } VTABLE PMC *add_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() + (FLOATVAL)value); @@ -138,7 +138,7 @@ Adds C to C inplace. } VTABLE PMC *add_float(FLOATVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() + value); @@ -195,7 +195,7 @@ Subtracts C from C inplace. MULTI PMC *subtract(Complex value, PMC *dest) { const FLOATVAL a = SELF.get_number(); - dest = pmc_new(INTERP, VTABLE_type(INTERP, value)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, value)); VTABLE_set_number_native(INTERP, dest, a - VTABLE_get_number_keyed_int(INTERP, value, 0)); @@ -205,14 +205,14 @@ Subtracts C from C inplace. } MULTI PMC *subtract(DEFAULT value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() - VTABLE_get_number(INTERP, value)); return dest; } VTABLE PMC *subtract_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() - (FLOATVAL)value); @@ -220,7 +220,7 @@ Subtracts C from C inplace. } VTABLE PMC *subtract_float(FLOATVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() - value); @@ -272,7 +272,7 @@ Multiplies the number by C and returns the result in C<*dest>. } MULTI PMC *multiply(DEFAULT value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() * VTABLE_get_number(INTERP, value)); @@ -280,7 +280,7 @@ Multiplies the number by C and returns the result in C<*dest>. } VTABLE PMC *multiply_int(INTVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() * value); @@ -288,7 +288,7 @@ Multiplies the number by C and returns the result in C<*dest>. } VTABLE PMC *multiply_float(FLOATVAL value, PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() * value); @@ -344,7 +344,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() / d); return dest; @@ -355,7 +355,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() / value); return dest; @@ -366,7 +366,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, SELF.get_number() / value); return dest; @@ -427,7 +427,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); d = floor(SELF.get_number() / d); VTABLE_set_integer_native(INTERP, dest, (INTVAL)d); @@ -439,7 +439,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, floor(SELF.get_number() / value)); @@ -451,7 +451,7 @@ Divides C by C inplace. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float division by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, floor(SELF.get_number() / value)); @@ -517,7 +517,7 @@ Calculates modulus inplace Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float modulus by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, floatval_mod(SELF.get_number(), d)); @@ -529,7 +529,7 @@ Calculates modulus inplace Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float modulus by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, floatval_mod(SELF.get_number(), (FLOATVAL)value)); @@ -541,7 +541,7 @@ Calculates modulus inplace Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_DIV_BY_ZERO, "float modulus by zero"); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_number_native(INTERP, dest, floatval_mod(SELF.get_number(), value)); @@ -592,7 +592,7 @@ Set C to the negated value of C. VTABLE PMC *neg(PMC *dest) { const INTVAL a = -SELF.get_integer(); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_integer_native(INTERP, dest, a); return dest; @@ -630,7 +630,7 @@ Concatenate the string C in place. STRING * const s = Parrot_str_concat(INTERP, SELF.get_string(), VTABLE_get_string(INTERP, value), 0); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_string_native(INTERP, dest, s); return dest; @@ -640,7 +640,7 @@ Concatenate the string C in place. STRING * const s = Parrot_str_concat(INTERP, SELF.get_string(), value, 0); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_string_native(INTERP, dest, s); return dest; @@ -679,7 +679,7 @@ Repeat the string C in place C times. STRING * const s = SELF.get_string(); const UINTVAL n = (UINTVAL)VTABLE_get_integer(INTERP, value); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_string_native(INTERP, dest, Parrot_str_repeat(INTERP, s, n)); @@ -690,7 +690,7 @@ Repeat the string C in place C times. STRING * const s = SELF.get_string(); const UINTVAL n = value; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_string_native(INTERP, dest, Parrot_str_repeat(INTERP, s, n)); @@ -862,7 +862,7 @@ Returns the result of the logical C of C and C<*value>. else if (value_bool && ! my_bool) return value; - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_bool(INTERP, dest, 0); return dest; } @@ -883,7 +883,7 @@ C<*value>. VTABLE PMC *logical_not(PMC *dest) { const INTVAL a = ! SELF.get_bool(); - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_bool(INTERP, dest, a); return dest; @@ -934,7 +934,7 @@ Sets this PMC as shared and read-only. */ VTABLE PMC *share_ro() { PMC *ret = pt_shared_fixup(INTERP, SELF); - PMC * const _true = pmc_new(INTERP, enum_class_Integer); + PMC * const _true = Parrot_pmc_new(INTERP, enum_class_Integer); VTABLE_set_integer_native(INTERP, _true, 1); diff --git a/src/pmc/scheduler.pmc b/src/pmc/scheduler.pmc index 7e5c0b6cee..3a2e663460 100644 --- a/src/pmc/scheduler.pmc +++ b/src/pmc/scheduler.pmc @@ -57,11 +57,11 @@ Initializes a concurrency scheduler object. /* Set up the core struct. */ core_struct->id = 0; core_struct->max_tid = 0; - core_struct->task_list = pmc_new(interp, enum_class_Hash); - core_struct->task_index = pmc_new(interp, enum_class_ResizableIntegerArray); - core_struct->wait_index = pmc_new(interp, enum_class_ResizablePMCArray); - core_struct->handlers = pmc_new(interp, enum_class_ResizablePMCArray); - core_struct->messages = pmc_new(interp, enum_class_ResizablePMCArray); + core_struct->task_list = Parrot_pmc_new(interp, enum_class_Hash); + core_struct->task_index = Parrot_pmc_new(interp, enum_class_ResizableIntegerArray); + core_struct->wait_index = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + core_struct->handlers = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); + core_struct->messages = Parrot_pmc_new(interp, enum_class_ResizablePMCArray); core_struct->interp = INTERP; MUTEX_INIT(core_struct->msg_lock); } diff --git a/src/pmc/sockaddr.pmc b/src/pmc/sockaddr.pmc index b11d0e5a67..4588fc7a2a 100644 --- a/src/pmc/sockaddr.pmc +++ b/src/pmc/sockaddr.pmc @@ -80,7 +80,7 @@ Creates and returns a clone of the pointer. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); memcpy(PARROT_SOCKADDR(dest)->pointer, PARROT_SOCKADDR(SELF)->pointer, sizeof (struct sockaddr_in)); return dest; diff --git a/src/pmc/string.pmc b/src/pmc/string.pmc index f6bade2d6e..d58613765f 100644 --- a/src/pmc/string.pmc +++ b/src/pmc/string.pmc @@ -71,7 +71,7 @@ Creates a copy of the string. */ VTABLE PMC *clone() { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); VTABLE_set_string_native(INTERP, dest, Parrot_str_copy(INTERP, SELF.get_string())); return dest; } @@ -436,7 +436,7 @@ Replace the string at C with the chr of C. } VTABLE PMC *get_pmc_keyed_int(INTVAL pos) { - PMC * const dest = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const dest = Parrot_pmc_new(INTERP, SELF->vtable->base_type); VTABLE_set_string_native(INTERP, dest, SELF.get_string_keyed_int(pos)); return dest; } @@ -511,7 +511,7 @@ TODO Currently overflow to BigInt is B handled nor detected. */ METHOD to_int(INTVAL base) { - PMC *result = pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, + PMC *result = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_Integer)); /* TODO verify encoding */ @@ -584,7 +584,7 @@ Return length of the string. } VTABLE PMC *get_iter() { - return pmc_new_init(INTERP, enum_class_StringIterator, SELF); + return Parrot_pmc_new_init(INTERP, enum_class_StringIterator, SELF); } /* diff --git a/src/pmc/stringhandle.pmc b/src/pmc/stringhandle.pmc index 7bd184161d..57efd52ae4 100644 --- a/src/pmc/stringhandle.pmc +++ b/src/pmc/stringhandle.pmc @@ -94,7 +94,7 @@ Create a copy of the stringhandle. VTABLE PMC *clone() { Parrot_StringHandle_attributes * const old_struct = PARROT_STRINGHANDLE(SELF); - PMC * const copy = pmc_new(INTERP, enum_class_StringHandle); + PMC * const copy = Parrot_pmc_new(INTERP, enum_class_StringHandle); Parrot_StringHandle_attributes * const data_struct = PARROT_STRINGHANDLE(copy); if (old_struct->stringhandle != NULL) diff --git a/src/pmc/stringiterator.pmc b/src/pmc/stringiterator.pmc index 3e0cefcf23..af58972b06 100644 --- a/src/pmc/stringiterator.pmc +++ b/src/pmc/stringiterator.pmc @@ -73,7 +73,7 @@ Marks the current idx/key and the aggregate as live. Parrot_StringIterator_attributes * const attrs = PARROT_STRINGITERATOR(SELF); PMC * const clone = - pmc_new_init(INTERP, enum_class_StringIterator, attrs->string); + Parrot_pmc_new_init(INTERP, enum_class_StringIterator, attrs->string); Parrot_StringIterator_attributes * const clone_attrs = PARROT_STRINGITERATOR(clone); @@ -184,7 +184,7 @@ Shift next character from C as PMC. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS, "StopIteration"); - ret = pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_String)); + ret = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_String)); VTABLE_set_string_native(INTERP, ret, VTABLE_get_string_keyed_int(INTERP, attrs->string, attrs->pos++)); return ret; @@ -248,7 +248,7 @@ Shift "next" character from C for reverse iterator as PMC. Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_OUT_OF_BOUNDS, "StopIteration"); - ret = pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_String)); + ret = Parrot_pmc_new(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_String)); VTABLE_set_string_native(INTERP, ret, VTABLE_get_string_keyed_int(INTERP, attrs->string, --attrs->pos)); return ret; diff --git a/src/pmc/sub.pmc b/src/pmc/sub.pmc index bc5d0ac72c..85019a02ce 100644 --- a/src/pmc/sub.pmc +++ b/src/pmc/sub.pmc @@ -388,7 +388,7 @@ Invokes the subroutine. * create new context, place it in interpreter */ context = Parrot_pcc_get_signature(INTERP, caller_ctx); if (PMC_IS_NULL(context)) - context = pmc_new(INTERP, enum_class_CallContext); + context = Parrot_pmc_new(INTERP, enum_class_CallContext); CURRENT_CONTEXT(INTERP) = context; Parrot_pcc_set_caller_ctx(INTERP, context, caller_ctx); Parrot_pcc_allocate_registers(INTERP, context, sub->n_regs_used); @@ -425,7 +425,7 @@ Invokes the subroutine. * and factor out common code with coroutine pmc */ if (!PMC_IS_NULL(sub->lex_info)) { - Parrot_pcc_set_lex_pad(interp, context, pmc_new_init(INTERP, + Parrot_pcc_set_lex_pad(interp, context, Parrot_pmc_new_init(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_LexPad), sub->lex_info)); VTABLE_set_pointer(INTERP, Parrot_pcc_get_lex_pad(interp, context), context); @@ -458,7 +458,7 @@ Invokes the subroutine. Parrot_pcc_set_sub(interp, dummy, outer_pmc); if (!PMC_IS_NULL(outer_sub->lex_info)) { - Parrot_pcc_set_lex_pad(interp, dummy, pmc_new_init(INTERP, + Parrot_pcc_set_lex_pad(interp, dummy, Parrot_pmc_new_init(INTERP, Parrot_get_ctx_HLL_type(interp, enum_class_LexPad), outer_sub->lex_info)); VTABLE_set_pointer(INTERP, Parrot_pcc_get_lex_pad(interp, dummy), dummy); @@ -506,7 +506,7 @@ Creates and returns a clone of the subroutine. */ VTABLE PMC *clone() { - PMC * const ret = pmc_new(INTERP, SELF->vtable->base_type); + PMC * const ret = Parrot_pmc_new(INTERP, SELF->vtable->base_type); Parrot_Sub_attributes *dest_sub; Parrot_Sub_attributes *sub; @@ -761,7 +761,7 @@ Returns the full set of meta-data about the sub. { /* Create a hash, then use inspect_str to get all of the data to * fill it up with. */ - PMC * const metadata = pmc_new(interp, enum_class_Hash); + PMC * const metadata = Parrot_pmc_new(interp, enum_class_Hash); STRING * const pos_required_str = CONST_STRING(interp, "pos_required"); STRING * const pos_optional_str = CONST_STRING(interp, "pos_optional"); STRING * const named_required_str = CONST_STRING(interp, "named_required"); @@ -908,7 +908,7 @@ The number of optional named arguments "Unknown introspection value '%S'", what); } - retval = pmc_new(INTERP, enum_class_Integer); + retval = Parrot_pmc_new(INTERP, enum_class_Integer); VTABLE_set_integer_native(INTERP, retval, count_found); return retval; } @@ -1064,7 +1064,7 @@ slurpy arguments). if (PMC_IS_NULL(sub->lex_info)) { const INTVAL lex_info_id = Parrot_get_ctx_HLL_type(interp, enum_class_LexInfo); - sub->lex_info = pmc_new_init(interp, lex_info_id, SELF); + sub->lex_info = Parrot_pmc_new_init(interp, lex_info_id, SELF); } /* If we've got a context around for the outer sub, set it as the diff --git a/src/pmc/task.pmc b/src/pmc/task.pmc index 96ca765f36..a6a92fb12b 100644 --- a/src/pmc/task.pmc +++ b/src/pmc/task.pmc @@ -180,7 +180,7 @@ Create a copy of the task, resetting status, ID, and birthtime. VTABLE PMC *clone() { /* Create the new task PMC, of the same type of this one (we may * have been subclassed). */ - PMC * const copy = pmc_new(interp, SELF->vtable->base_type); + PMC * const copy = Parrot_pmc_new(interp, SELF->vtable->base_type); Parrot_Task_attributes * const new_struct = PARROT_TASK(copy); Parrot_Task_attributes * const old_struct = PARROT_TASK(SELF); @@ -206,27 +206,27 @@ Gets the value of an attribute for this task. PMC *value; if (Parrot_str_equal(interp, name, CONST_STRING(interp, "id"))) { - value = pmc_new(interp, enum_class_Integer); + value = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, value, core_struct->id); } else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "type"))) { - value = pmc_new(interp, enum_class_String); + value = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, value, core_struct->type); } else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "subtype"))) { - value = pmc_new(interp, enum_class_String); + value = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, value, core_struct->subtype); } else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "priority"))) { - value = pmc_new(interp, enum_class_Integer); + value = Parrot_pmc_new(interp, enum_class_Integer); VTABLE_set_integer_native(interp, value, core_struct->priority); } else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "status"))) { - value = pmc_new(interp, enum_class_String); + value = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, value, core_struct->status); } else if (Parrot_str_equal(interp, name, CONST_STRING(interp, "birthtime"))) { - value = pmc_new(interp, enum_class_Float); + value = Parrot_pmc_new(interp, enum_class_Float); VTABLE_set_number_native(interp, value, core_struct->birthtime); } else { diff --git a/src/pmc/undef.pmc b/src/pmc/undef.pmc index a28db768be..677ba22dc5 100644 --- a/src/pmc/undef.pmc +++ b/src/pmc/undef.pmc @@ -217,7 +217,7 @@ Returns 1. */ VTABLE PMC *logical_not(PMC *dest) { - dest = pmc_new(INTERP, VTABLE_type(INTERP, SELF)); + dest = Parrot_pmc_new(INTERP, VTABLE_type(INTERP, SELF)); VTABLE_set_bool(INTERP, dest, 1); return dest; } @@ -264,7 +264,7 @@ Clones the current Undef PMC. */ VTABLE PMC *clone() { - return pmc_new(INTERP, SELF->vtable->base_type); + return Parrot_pmc_new(INTERP, SELF->vtable->base_type); } /* diff --git a/src/pmc/unmanagedstruct.pmc b/src/pmc/unmanagedstruct.pmc index 7205605e2c..3c44f1f4cd 100644 --- a/src/pmc/unmanagedstruct.pmc +++ b/src/pmc/unmanagedstruct.pmc @@ -386,7 +386,7 @@ ret_pmc(PARROT_INTERP, PMC *pmc, char *p, int type, INTVAL idx) PMC *sig = VTABLE_getprop(interp, ptr, signature_str); if (VTABLE_defined(interp, sig)) { STRING *sig_str = VTABLE_get_string(interp, sig); - ret = pmc_new(interp, enum_class_NCI); + ret = Parrot_pmc_new(interp, enum_class_NCI); VTABLE_set_pointer_keyed_str(interp, ret, sig_str, *(PMC **)p); } @@ -703,7 +703,7 @@ Return a clone of this PMC. */ VTABLE PMC *clone() { - PMC *clone = pmc_new(INTERP, enum_class_UnManagedStruct); + PMC *clone = Parrot_pmc_new(INTERP, enum_class_UnManagedStruct); mem_sys_memmove(PMC_data(clone), PMC_data(SELF), sizeof (Parrot_UnManagedStruct_attributes)); PARROT_UNMANAGEDSTRUCT(clone)->init = diff --git a/src/pmc_freeze.c b/src/pmc_freeze.c index 13c5dc2474..dd2fdb467d 100644 --- a/src/pmc_freeze.c +++ b/src/pmc_freeze.c @@ -54,7 +54,7 @@ STRING* Parrot_freeze(PARROT_INTERP, ARGIN(PMC *pmc)) { ASSERT_ARGS(Parrot_freeze) - PMC *image = pmc_new(interp, enum_class_ImageIO); + PMC *image = Parrot_pmc_new(interp, enum_class_ImageIO); VTABLE_set_pmc(interp, image, pmc); return VTABLE_get_string(interp, image); } @@ -84,7 +84,7 @@ Parrot_thaw(PARROT_INTERP, ARGIN(STRING *image)) { ASSERT_ARGS(Parrot_thaw) - PMC *info = pmc_new(interp, enum_class_ImageIO); + PMC *info = Parrot_pmc_new(interp, enum_class_ImageIO); int gc_block = 0; PMC *result; diff --git a/src/scheduler.c b/src/scheduler.c index 81cf320e02..7299b3cb6c 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -79,7 +79,7 @@ Parrot_cx_init_scheduler(PARROT_INTERP) /* Add the very first interpreter to the list of interps. */ pt_add_to_interpreters(interp, NULL); - scheduler = pmc_new(interp, enum_class_Scheduler); + scheduler = Parrot_pmc_new(interp, enum_class_Scheduler); scheduler = VTABLE_share_ro(interp, scheduler); interp->scheduler = scheduler; @@ -290,7 +290,7 @@ Parrot_cx_schedule_timer(PARROT_INTERP, INTVAL repeat, ARGIN_NULLOK(PMC *sub)) { ASSERT_ARGS(Parrot_cx_schedule_timer) - PMC * const timer = pmc_new(interp, enum_class_Timer); + PMC * const timer = Parrot_pmc_new(interp, enum_class_Timer); VTABLE_set_number_keyed_int(interp, timer, PARROT_TIMER_NSEC, duration); VTABLE_set_number_keyed_int(interp, timer, PARROT_TIMER_INTERVAL, interval); @@ -356,7 +356,7 @@ Parrot_cx_schedule_callback(PARROT_INTERP, ARGIN(PMC *user_data), ARGIN(char *ext_data)) { ASSERT_ARGS(Parrot_cx_schedule_callback) - PMC *callback = pmc_new(interp, enum_class_Task); + PMC *callback = Parrot_pmc_new(interp, enum_class_Task); Parrot_Task_attributes * const task_struct = PARROT_TASK(callback); task_struct->type = CONST_STRING(interp, "callback"); @@ -483,7 +483,7 @@ Parrot_cx_add_handler_local(PARROT_INTERP, ARGIN(PMC *handler)) { ASSERT_ARGS(Parrot_cx_add_handler_local) if (PMC_IS_NULL(Parrot_pcc_get_handlers(interp, interp->ctx))) - Parrot_pcc_set_handlers(interp, interp->ctx, pmc_new(interp, enum_class_ResizablePMCArray)); + Parrot_pcc_set_handlers(interp, interp->ctx, Parrot_pmc_new(interp, enum_class_ResizablePMCArray)); VTABLE_unshift_pmc(interp, Parrot_pcc_get_handlers(interp, interp->ctx), handler); @@ -730,7 +730,7 @@ Parrot_cx_send_message(PARROT_INTERP, ARGIN(STRING *messagetype), SHIM(PMC *payl ASSERT_ARGS(Parrot_cx_send_message) if (interp->scheduler) { Parrot_Scheduler_attributes * sched_struct = PARROT_SCHEDULER(interp->scheduler); - PMC *message = pmc_new(interp, enum_class_SchedulerMessage); + PMC *message = Parrot_pmc_new(interp, enum_class_SchedulerMessage); VTABLE_set_string_native(interp, message, messagetype); message = VTABLE_share_ro(interp, message); diff --git a/src/sub.c b/src/sub.c index 2fa4ec1bc6..c52e6330c2 100644 --- a/src/sub.c +++ b/src/sub.c @@ -64,7 +64,7 @@ PMC * new_ret_continuation_pmc(PARROT_INTERP, ARGIN_NULLOK(opcode_t *address)) { ASSERT_ARGS(new_ret_continuation_pmc) - PMC* const continuation = pmc_new(interp, enum_class_RetContinuation); + PMC* const continuation = Parrot_pmc_new(interp, enum_class_RetContinuation); VTABLE_set_pointer(interp, continuation, address); return continuation; } @@ -612,7 +612,7 @@ Parrot_get_sub_pmc_from_subclass(PARROT_INTERP, ARGIN(PMC *subclass)) { } /* Get the Sub PMC itself. */ - key = pmc_new(interp, enum_class_String); + key = Parrot_pmc_new(interp, enum_class_String); VTABLE_set_string_native(interp, key, CONST_STRING(interp, "Sub")); sub_pmc = VTABLE_get_attr_keyed(interp, subclass, key, CONST_STRING(interp, "proxy")); if (sub_pmc->vtable->base_type == enum_class_Sub) { diff --git a/src/thread.c b/src/thread.c index 9f6f9c8db7..06baedad67 100644 --- a/src/thread.c +++ b/src/thread.c @@ -188,7 +188,7 @@ make_local_copy(PARROT_INTERP, ARGIN(Parrot_Interp from), ARGIN(PMC *arg)) else if (VTABLE_isa(from, arg, _multi_sub)) { INTVAL i = 0; const INTVAL n = VTABLE_elements(from, arg); - ret_val = pmc_new(interp, enum_class_MultiSub); + ret_val = Parrot_pmc_new(interp, enum_class_MultiSub); for (i = 0; i < n; ++i) { PMC *const orig = VTABLE_get_pmc_keyed_int(from, arg, i); @@ -288,7 +288,7 @@ make_local_args_copy(PARROT_INTERP, ARGIN(Parrot_Interp old_interp), ARGIN_NULLO old_size = VTABLE_get_integer(old_interp, args); /* XXX should this be a different type? */ - ret_val = pmc_new(interp, enum_class_FixedPMCArray); + ret_val = Parrot_pmc_new(interp, enum_class_FixedPMCArray); VTABLE_set_integer_native(interp, ret_val, old_size); for (i = 0; i < old_size; ++i) { @@ -620,7 +620,7 @@ pt_ns_clone(PARROT_INTERP, ARGOUT(Parrot_Interp d), ARGOUT(PMC *dest_ns), PMC *sub_ns = VTABLE_get_pmc_keyed_str(d, dest_ns, key); if (PMC_IS_NULL(sub_ns) || sub_ns->vtable->base_type != enum_class_NameSpace) { - sub_ns = pmc_new(d, enum_class_NameSpace); + sub_ns = Parrot_pmc_new(d, enum_class_NameSpace); VTABLE_set_pmc_keyed_str(d, dest_ns, key, sub_ns); } pt_ns_clone(s, d, sub_ns, s, val); @@ -752,7 +752,7 @@ pt_thread_run(PARROT_INTERP, ARGOUT(PMC *dest_interp), ARGIN(PMC *sub), ARGIN_NU * XXX FIXME move this elsewhere? at least the set_pmc_keyed_int */ old_dest_interp = dest_interp; - dest_interp = pmc_new_noinit(interpreter, enum_class_ParrotThread); + dest_interp = Parrot_pmc_new_noinit(interpreter, enum_class_ParrotThread); /* so it's not accidentally deleted */ VTABLE_set_pointer(interp, old_dest_interp, NULL); diff --git a/src/utils.c b/src/utils.c index d1ea0f11e9..fbc1ea8ee4 100644 --- a/src/utils.c +++ b/src/utils.c @@ -545,7 +545,7 @@ tm_to_array(PARROT_INTERP, ARGIN(const struct tm *tm)) { ASSERT_ARGS(tm_to_array) - PMC * const Array = pmc_new(interp, + PMC * const Array = Parrot_pmc_new(interp, Parrot_get_ctx_HLL_type(interp, enum_class_FixedIntegerArray)); VTABLE_set_integer_native(interp, Array, 9);