Skip to content

Commit

Permalink
start rename of pmc_new to Parrot_pmc_new
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.parrot.org/parrot/branches/pmc_func_cleanup@44031 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information
Whiteknight committed Feb 16, 2010
1 parent 243599b commit 083213a
Show file tree
Hide file tree
Showing 83 changed files with 537 additions and 537 deletions.
2 changes: 1 addition & 1 deletion compilers/imcc/parser_util.c
Expand Up @@ -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;
Expand Down
20 changes: 10 additions & 10 deletions compilers/imcc/pbc.c
Expand Up @@ -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;

Expand All @@ -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);
}
}
Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
}

Expand Down Expand Up @@ -1297,15 +1297,15 @@ 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 {
/* use a possible type mapping for the Sub PMCs, and create it */
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. */
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions compilers/pirc/src/bcgen.c
Expand Up @@ -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);
Expand All @@ -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;
Expand Down Expand Up @@ -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 */
Expand All @@ -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);
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}

}
Expand All @@ -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);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions compilers/pirc/src/pircompunit.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions compilers/pirc/src/piremit.c
Expand Up @@ -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);
Expand All @@ -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);
Expand All @@ -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);

Expand Down
2 changes: 1 addition & 1 deletion compilers/pirc/src/pirpcc.c
Expand Up @@ -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);
Expand Down
10 changes: 5 additions & 5 deletions src/dynext.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/embed.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/exceptions.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/extend.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/frame_builder.c
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/global.c
Expand Up @@ -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))
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 083213a

Please sign in to comment.