[svn:parrot] r44578 - in trunk/lib/Parrot: . OpTrans Ops2c

cotto at svn.parrot.org cotto at svn.parrot.org
Tue Mar 2 04:38:38 UTC 2010


Author: cotto
Date: Tue Mar  2 04:38:37 2010
New Revision: 44578
URL: https://trac.parrot.org/parrot/changeset/44578

Log:
[ops2c] replace opsarraytype with opcode_t and remove supporting code

Modified:
   trunk/lib/Parrot/OpTrans.pm
   trunk/lib/Parrot/OpTrans/CGoto.pm
   trunk/lib/Parrot/Ops2c/Utils.pm

Modified: trunk/lib/Parrot/OpTrans.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans.pm	Tue Mar  2 02:10:08 2010	(r44577)
+++ trunk/lib/Parrot/OpTrans.pm	Tue Mar  2 04:38:37 2010	(r44578)
@@ -76,22 +76,6 @@
     return '';
 }
 
-=item C<defines()>
-
-Implemented in subclasses to return the C C<#define> macros required.
-
-=item C<opsarraytype()>
-
-Returns the type for the array of opcodes. By default here it's an array
-C<opcode_t>, but the prederef runops core uses an array of C<void*> to
-do its clever tricks.
-
-=cut
-
-sub opsarraytype {
-    return 'opcode_t';
-}
-
 =item C<core_type()>
 
 Implemented in subclasses to return the type of core created by the

Modified: trunk/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CGoto.pm	Tue Mar  2 02:10:08 2010	(r44577)
+++ trunk/lib/Parrot/OpTrans/CGoto.pm	Tue Mar  2 04:38:37 2010	(r44578)
@@ -283,7 +283,6 @@
 
 sub run_core_after_addr_table {
     my ( $self, $bs ) = @_;
-    my $t = $self->opsarraytype;
     return <<END_C;
 
     if (!${bs}ops_addr)

Modified: trunk/lib/Parrot/Ops2c/Utils.pm
==============================================================================
--- trunk/lib/Parrot/Ops2c/Utils.pm	Tue Mar  2 02:10:08 2010	(r44577)
+++ trunk/lib/Parrot/Ops2c/Utils.pm	Tue Mar  2 04:38:37 2010	(r44578)
@@ -186,7 +186,6 @@
     $argsref->{preamble}     = $preamble;
     $argsref->{init_func}    = $init_func;
     $argsref->{bs}           = "$argsref->{base}$argsref->{suffix}_";
-    $argsref->{opsarraytype} = $argsref->{trans}->opsarraytype();
 
     # Invoked as:  ${defines}
     $argsref->{defines} = $argsref->{trans}->defines();
@@ -606,9 +605,8 @@
     $prev_src = '';
     foreach my $op ( $self->{ops}->ops ) {
         my $func_name = $op->func_name( $self->{trans} );
-        my $arg_types = "$self->{opsarraytype} *, PARROT_INTERP";
-        my $prototype = "$self->{sym_export} $self->{opsarraytype} * $func_name ($arg_types)";
-        my $args      = "$self->{opsarraytype} *cur_opcode, PARROT_INTERP";
+        my $prototype = 
+          "$self->{sym_export} opcode_t * $func_name (opcode_t *, PARROT_INTERP)";
         my $definition;
         my $comment = '';
         my $one_op  = "";
@@ -622,7 +620,7 @@
             $comment    = "/* " . $op->full_name() . " */";
         }
         else {
-            $definition = "$self->{opsarraytype} *\n$func_name ($args)";
+            $definition = "opcode_t *\n$func_name (opcode_t *cur_opcode, PARROT_INTERP)";
         }
 
         my $src = $op->source( $self->{trans} );


More information about the parrot-commits mailing list