[svn:parrot] r46010 - in trunk/lib/Parrot/Pmc2c: . PMC

bacek at svn.parrot.org bacek at svn.parrot.org
Sun Apr 25 12:17:43 UTC 2010


Author: bacek
Date: Sun Apr 25 12:17:42 2010
New Revision: 46010
URL: https://trac.parrot.org/parrot/changeset/46010

Log:
Use C<_self> instead of C<pmc> as replacement for C<SELF>

Modified:
   trunk/lib/Parrot/Pmc2c/MethodEmitter.pm
   trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm
   trunk/lib/Parrot/Pmc2c/PMC/Null.pm
   trunk/lib/Parrot/Pmc2c/PMC/Object.pm
   trunk/lib/Parrot/Pmc2c/PMC/default.pm

Modified: trunk/lib/Parrot/Pmc2c/MethodEmitter.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/MethodEmitter.pm	Sun Apr 25 12:12:43 2010	(r46009)
+++ trunk/lib/Parrot/Pmc2c/MethodEmitter.pm	Sun Apr 25 12:17:42 2010	(r46010)
@@ -107,7 +107,7 @@
         $newl   = "\n";
         $semi   = '';
     }
-    my $pmcarg = 'PMC *pmc';
+    my $pmcarg = 'PMC *_self';
     $pmcarg    = "SHIM($pmcarg)" if $self->pmc_unused;
 
     return <<"EOC";
@@ -134,7 +134,7 @@
       \.(\w+)        # other_method
       \(\s*(.*?)\)   # capture argument list
       }x,
-        sub { "pmc->vtable->$1(" . full_arguments($2) . ')' }
+        sub { "_self->vtable->$1(" . full_arguments($2) . ')' }
     );
 
     # Rewrite STATICSELF.other_method(args...)
@@ -151,8 +151,8 @@
         }
     );
 
-    # Rewrite SELF -> pmc, INTERP -> interp
-    $body->subst( qr{\bSELF\b},   sub { 'pmc' } );
+    # Rewrite SELF -> _self, INTERP -> interp
+    $body->subst( qr{\bSELF\b},   sub { '_self' } );
     $body->subst( qr{\bINTERP\b}, sub { 'interp' } );
 
     # Rewrite GET_ATTR, SET_ATTR with typename
@@ -219,7 +219,7 @@
         \.(\w+)        # other_method
         \(\s*(.*?)\)   # capture argument list
       }x,
-        sub { "pmc->vtable->$1(" . full_arguments($2) . ')' }
+        sub { "_self->vtable->$1(" . full_arguments($2) . ')' }
     );
 
     # Rewrite SELF(args...). See comments above.
@@ -228,7 +228,7 @@
         \bSELF\b       # Macro: SELF
         \(\s*(.*?)\)   # capture argument list
       }x,
-        sub { "pmc->vtable->$name(" . full_arguments($1) . ')' }
+        sub { "_self->vtable->$name(" . full_arguments($1) . ')' }
     );
 
     # Rewrite OtherClass.SELF.other_method(args...)
@@ -304,8 +304,8 @@
         }
     );
 
-    # Rewrite SELF -> pmc, INTERP -> interp
-    $body->subst( qr{\bSELF\b},   sub { 'pmc' } );
+    # Rewrite SELF -> _self, INTERP -> interp
+    $body->subst( qr{\bSELF\b},   sub { '_self' } );
     $body->subst( qr{\bINTERP\b}, sub { 'interp' } );
 
     # Rewrite GET_ATTR, SET_ATTR with typename

Modified: trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm	Sun Apr 25 12:12:43 2010	(r46009)
+++ trunk/lib/Parrot/Pmc2c/PCCMETHOD.pm	Sun Apr 25 12:17:42 2010	(r46010)
@@ -399,7 +399,7 @@
     unshift @$linear_args,
         {
         type  => convert_type_string_to_reg_type('PMC'),
-        name  => 'pmc',
+        name  => '_self',
         attrs => parse_adverb_attributes(':invocant')
         };
 

Modified: trunk/lib/Parrot/Pmc2c/PMC/Null.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMC/Null.pm	Sun Apr 25 12:12:43 2010	(r46009)
+++ trunk/lib/Parrot/Pmc2c/PMC/Null.pm	Sun Apr 25 12:17:42 2010	(r46010)
@@ -44,7 +44,7 @@
         # to avoid compiler warnings
         my $body = <<"EOC";
     UNUSED(interp)
-    UNUSED(pmc)
+    UNUSED(_self)
 EOC
 
         foreach my $param (split /,\s*/, $method->parameters) {

Modified: trunk/lib/Parrot/Pmc2c/PMC/Object.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMC/Object.pm	Sun Apr 25 12:12:43 2010	(r46009)
+++ trunk/lib/Parrot/Pmc2c/PMC/Object.pm	Sun Apr 25 12:17:42 2010	(r46010)
@@ -52,7 +52,7 @@
         $superargs       =~ s/^,//;
 
         my $method_body_text = <<"EOC";
-    Parrot_Object_attributes * const obj       = PARROT_OBJECT(pmc);
+    Parrot_Object_attributes * const obj       = PARROT_OBJECT(_self);
     Parrot_Class_attributes  * const _class    = PARROT_CLASS(obj->_class);
     STRING        * const meth_name = CONST_STRING_GEN(interp, "$vt_method_name");
 
@@ -66,7 +66,7 @@
         PMC * const meth = Parrot_oo_find_vtable_override_for_class(interp, cur_class, meth_name);
         if (!PMC_IS_NULL(meth)) {
             $pcc_result_decl
-            Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi$pcc_sig", pmc$pcc_args);
+            Parrot_pcc_invoke_sub_from_c_args(interp, meth, "Pi$pcc_sig", _self$pcc_args);
             $pcc_return_stmt
         }
         /* method name is $vt_method_name */

Modified: trunk/lib/Parrot/Pmc2c/PMC/default.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/PMC/default.pm	Sun Apr 25 12:12:43 2010	(r46009)
+++ trunk/lib/Parrot/Pmc2c/PMC/default.pm	Sun Apr 25 12:17:42 2010	(r46010)
@@ -55,9 +55,9 @@
             # Generate default_ro_find_method.
             $self->{emitter}->emit(<<'EOC');
 static  PMC *
-Parrot_default_ro_find_method(PARROT_INTERP, PMC *pmc, STRING *method_name) {
+Parrot_default_ro_find_method(PARROT_INTERP, PMC *_self, STRING *method_name) {
     /* Use non-readonly find_method. Current vtable is ro variant. So ro_variant contains non-ro variant */
-    PMC *const method = pmc->vtable->ro_variant_vtable->find_method(interp, pmc, method_name);
+    PMC *const method = _self->vtable->ro_variant_vtable->find_method(interp, _self, method_name);
     if (!PMC_IS_NULL(VTABLE_getprop(interp, method, CONST_STRING_GEN(interp, "write"))))
         return PMCNULL;
     else
@@ -90,7 +90,7 @@
         $body .= "    UNUSED($param)\n";
     }
     my $vt_method_name = uc $method->name;
-    $body .= qq{    $stub_func(interp, pmc, PARROT_VTABLE_SLOT_$vt_method_name);\n};
+    $body .= qq{    $stub_func(interp, _self, PARROT_VTABLE_SLOT_$vt_method_name);\n};
 
     $clone->body( Parrot::Pmc2c::Emitter->text($body));
 


More information about the parrot-commits mailing list