diff --git a/src/pmc/p5interpreter.pmc b/src/pmc/p5interpreter.pmc index 8833974..7a3a930 100644 --- a/src/pmc/p5interpreter.pmc +++ b/src/pmc/p5interpreter.pmc @@ -89,7 +89,7 @@ Set up P5Interpreter PMC. perl_parse(my_perl, xs_init, 3, embedding, NULL); PL_exit_flags |= PERL_EXIT_DESTRUCT_END; perl_run(my_perl); - SETATTR_P5Interpreter_my_perl(interp, SELF, my_perl); + SET_ATTR_my_perl(interp, SELF, my_perl); /* We turn on auto-flush to avoid oddness in interactions between * IO systems. */ @@ -108,7 +108,7 @@ Mark source string, if we have one. VTABLE void mark() { if (PMC_data(SELF)) { STRING *source; - GETATTR_P5Interpreter_source(interp, SELF, source); + GET_ATTR_source(interp, SELF, source); if (source) Parrot_gc_mark_PObj_alive(interp, (PObj*)source); } @@ -127,10 +127,10 @@ Destructor for the P5Interpreter PMC. struct interpreter *my_perl; /* Destroy interpreter if it's got no more usage. */ - GETATTR_P5Interpreter_my_perl(interp, SELF, my_perl); + GET_ATTR_my_perl(interp, SELF, my_perl); perl_destruct(my_perl); perl_free(my_perl); - + /* XXX We should only call PERL_SYS_TERM right at the end, not per * interpreter destroy. Skip doing it for now at all, but need to * work out where to put this. */ @@ -152,7 +152,7 @@ Set the source code that we will run. */ VTABLE void set_string_native(STRING *source) { - SETATTR_P5Interpreter_source(interp, SELF, source); + SET_ATTR_source(interp, SELF, source); } /* @@ -174,11 +174,11 @@ Run the Perl 5 code. /* Get source into a C string so we can give it to Perl 5. * XXX We'd best care about encodings and charset here some day. */ - GETATTR_P5Interpreter_source(interp, SELF, source); + GET_ATTR_source(interp, SELF, source); c_source = Parrot_str_to_cstring(interp, source); /* Evaluate it. */ - GETATTR_P5Interpreter_my_perl(interp, SELF, my_perl); + GET_ATTR_my_perl(interp, SELF, my_perl); return_code = eval_pv(c_source, TRUE); result = pmc_new(interp, pmc_type(interp, string_from_literal(interp, "P5Scalar"))); SETATTR_P5Scalar_p5i(interp, result, SELF); diff --git a/src/pmc/p5invocation.pmc b/src/pmc/p5invocation.pmc index 0462196..b6b4e64 100644 --- a/src/pmc/p5invocation.pmc +++ b/src/pmc/p5invocation.pmc @@ -139,9 +139,9 @@ Mark GC-ables. if (PMC_data(SELF)) { PMC *p5i, *invocant_ns; STRING *name; - GETATTR_P5Invocation_p5i(interp, SELF, p5i); - GETATTR_P5Invocation_invocant_ns(interp, SELF, invocant_ns); - GETATTR_P5Invocation_name(interp, SELF, name); + GET_ATTR_p5i(interp, SELF, p5i); + GET_ATTR_invocant_ns(interp, SELF, invocant_ns); + GET_ATTR_name(interp, SELF, name); if (p5i) Parrot_gc_mark_PObj_alive(interp, (PObj*)p5i); if (invocant_ns) @@ -173,14 +173,14 @@ Handles the actual invocation. PMC *p5i, *results, *ns, *ns_key, *return_helper; PMC *capture, *named_names, *named_args, *iter; PerlInterpreter *my_perl; - + /* Get the interpreter, SV and the name. */ - GETATTR_P5Invocation_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); GETATTR_P5Interpreter_my_perl(interp, p5i, my_perl); - GETATTR_P5Invocation_name(interp, SELF, name); + GET_ATTR_name(interp, SELF, name); c_name = Parrot_str_to_cstring(interp, name); - GETATTR_P5Invocation_invocant_sv(interp, SELF, invocant_sv); - GETATTR_P5Invocation_invocant_ns(interp, SELF, invocant_ns); + GET_ATTR_invocant_sv(interp, SELF, invocant_sv); + GET_ATTR_invocant_ns(interp, SELF, invocant_ns); /* Grab the parameters; toss the invocant as we already have that. */ capture = Parrot_pcc_get_signature(interp, CURRENT_CONTEXT(interp)); diff --git a/src/pmc/p5namespace.pmc b/src/pmc/p5namespace.pmc index 092316b..c6617cd 100644 --- a/src/pmc/p5namespace.pmc +++ b/src/pmc/p5namespace.pmc @@ -52,8 +52,8 @@ Set up P5Namespace PMC. PMC_data(SELF) = mem_allocate_zeroed_typed(Parrot_P5Namespace_attributes); PObj_custom_mark_SET(SELF); PObj_custom_destroy_SET(SELF); - SETATTR_P5Namespace_p5i(interp, SELF, p5i); - SETATTR_P5Namespace_marshall_cache(interp, SELF, PMCNULL); + SET_ATTR_p5i(interp, SELF, p5i); + SET_ATTR_marshall_cache(interp, SELF, PMCNULL); } @@ -70,9 +70,9 @@ Mark GC-ables. if (PMC_data(SELF)) { PMC *p5i, *cache; STRING *name; - GETATTR_P5Namespace_p5i(interp, SELF, p5i); - GETATTR_P5Namespace_marshall_cache(interp, SELF, cache); - GETATTR_P5Namespace_ns_name(interp, SELF, name); + GET_ATTR_p5i(interp, SELF, p5i); + GET_ATTR_marshall_cache(interp, SELF, cache); + GET_ATTR_ns_name(interp, SELF, name); if (p5i) Parrot_gc_mark_PObj_alive(interp, (PObj*)p5i); if (cache) @@ -108,11 +108,9 @@ Set the name of the Perl 5 namespace that we map to. */ VTABLE void set_string_native(STRING *name) { - SETATTR_P5Namespace_ns_name(interp, SELF, name); + SET_ATTR_ns_name(interp, SELF, name); } - - /* =item C @@ -124,7 +122,7 @@ Hands back a P5Invocation so we can call a method on the package. */ VTABLE PMC *find_method(STRING *name) { PMC *p5i, *result; - GETATTR_P5Namespace_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); /* Make and return a P5Invocation object. */ result = pmc_new(interp, pmc_type(interp, CONST_STRING(interp, "P5Invocation"))); diff --git a/src/pmc/p5scalar.pmc b/src/pmc/p5scalar.pmc index 3d0f820..945df2c 100644 --- a/src/pmc/p5scalar.pmc +++ b/src/pmc/p5scalar.pmc @@ -62,9 +62,9 @@ Returns the integer value of the SV. PMC *p5i; PerlInterpreter *my_perl; struct sv *sv; - GETATTR_P5Scalar_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); GETATTR_P5Interpreter_my_perl(interp, p5i, my_perl); - GETATTR_P5Scalar_sv(interp, SELF, sv); + GET_ATTR_sv(interp, SELF, sv); return SvIV(sv); } @@ -82,9 +82,9 @@ Returns the number value of the SV. PMC *p5i; PerlInterpreter *my_perl; struct sv *sv; - GETATTR_P5Scalar_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); GETATTR_P5Interpreter_my_perl(interp, p5i, my_perl); - GETATTR_P5Scalar_sv(interp, SELF, sv); + GET_ATTR_sv(interp, SELF, sv); return SvNV(sv); } @@ -102,9 +102,9 @@ Returns the string value of the SV. PerlInterpreter *my_perl; struct sv *sv; char *perl5_str; - GETATTR_P5Scalar_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); GETATTR_P5Interpreter_my_perl(interp, p5i, my_perl); - GETATTR_P5Scalar_sv(interp, SELF, sv); + GET_ATTR_sv(interp, SELF, sv); perl5_str = SvPVutf8_nolen(sv); return Parrot_str_new(interp, perl5_str, strlen(perl5_str)); } @@ -125,15 +125,15 @@ the given name on the given Perl 5 Scalar invocant. PerlInterpreter *my_perl; struct sv *invocant; - GETATTR_P5Scalar_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); GETATTR_P5Interpreter_my_perl(interp, p5i, my_perl); - GETATTR_P5Scalar_sv(interp, SELF, invocant); + GET_ATTR_sv(interp, SELF, invocant); result = pmc_new(interp, pmc_type(interp, string_from_literal(interp, "P5Invocation"))); SETATTR_P5Invocation_p5i(interp, result, p5i); SETATTR_P5Invocation_invocant_sv(interp, result, SvREFCNT_inc(invocant)); SETATTR_P5Invocation_name(interp, result, name); - + return result; } @@ -153,9 +153,9 @@ Checks if a class can do a given method. INTVAL result; char *c_name; - GETATTR_P5Scalar_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); GETATTR_P5Interpreter_my_perl(interp, p5i, my_perl); - GETATTR_P5Scalar_sv(interp, SELF, invocant); + GET_ATTR_sv(interp, SELF, invocant); c_name = Parrot_str_to_cstring(interp, name); /* If it's not blessed, the answer is "no" right off. */ diff --git a/src/pmc/p5sv.pmc b/src/pmc/p5sv.pmc index a05a857..2dd2062 100644 --- a/src/pmc/p5sv.pmc +++ b/src/pmc/p5sv.pmc @@ -63,7 +63,7 @@ Mark GC-ables. VTABLE void mark() { if (PMC_data(SELF)) { PMC *p5i; - GETATTR_P5Scalar_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); if (p5i) Parrot_gc_mark_PObj_alive(interp, (PObj*)p5i); } @@ -84,7 +84,7 @@ Decrement reference count of held SV. PMC *p5i; PerlInterpreter *my_perl; struct sv *sv; - GETATTR_P5SV_p5i(interp, SELF, p5i); + GET_ATTR_p5i(interp, SELF, p5i); /* There is a small destruction order issue here; Parrot may destroy the interpreter before the last SV references. But if the interpreter is destroyed, we have no need, the @@ -105,7 +105,7 @@ Decrement reference count of held SV. if (PMC_data(p5i)) { GETATTR_P5Interpreter_my_perl(interp, p5i, my_perl); - GETATTR_P5SV_sv(interp, SELF, sv); + GET_ATTR_sv(interp, SELF, sv); SvREFCNT_dec(sv); } mem_sys_free(PMC_data(SELF));