[svn:parrot] r39866 - in trunk: . lib/Parrot lib/Parrot/OpTrans tools/build

cotto at svn.parrot.org cotto at svn.parrot.org
Thu Jul 2 07:07:09 UTC 2009


Author: cotto
Date: Thu Jul  2 07:07:07 2009
New Revision: 39866
URL: https://trac.parrot.org/parrot/changeset/39866

Log:
[ops2c] remove OpTrans::Compiled, which was only used by a tool removed back in r28978

Deleted:
   trunk/lib/Parrot/OpTrans/Compiled.pm
Modified:
   trunk/MANIFEST
   trunk/META.yml
   trunk/lib/Parrot/OpTrans.pm
   trunk/lib/Parrot/OpTrans/C.pm
   trunk/lib/Parrot/OpTrans/CGP.pm
   trunk/lib/Parrot/OpTrans/CGoto.pm
   trunk/lib/Parrot/OpTrans/CPrederef.pm
   trunk/lib/Parrot/OpTrans/CSwitch.pm
   trunk/tools/build/ops2c.pl

Modified: trunk/MANIFEST
==============================================================================
--- trunk/MANIFEST	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/MANIFEST	Thu Jul  2 07:07:07 2009	(r39866)
@@ -1,7 +1,7 @@
 # ex: set ro:
 # $Id$
 #
-# generated by tools/dev/mk_manifest_and_skip.pl Tue Jun 30 19:44:18 2009 UT
+# generated by tools/dev/mk_manifest_and_skip.pl Thu Jul  2 07:01:15 2009 UT
 #
 # See below for documentation on the format of this file.
 #
@@ -1068,7 +1068,6 @@
 lib/Parrot/OpTrans/CGoto.pm                                 [devel]lib
 lib/Parrot/OpTrans/CPrederef.pm                             [devel]lib
 lib/Parrot/OpTrans/CSwitch.pm                               [devel]lib
-lib/Parrot/OpTrans/Compiled.pm                              [devel]lib
 lib/Parrot/Ops2c/Auxiliary.pm                               [devel]lib
 lib/Parrot/Ops2c/Utils.pm                                   [devel]lib
 lib/Parrot/Ops2pm.pm                                        [devel]lib

Modified: trunk/META.yml
==============================================================================
--- trunk/META.yml	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/META.yml	Thu Jul  2 07:07:07 2009	(r39866)
@@ -30,7 +30,6 @@
         - Parrot::Docs::HTMLPage
         - Parrot::OpTrans::CGP
         - Parrot::OpTrans::CSwitch
-        - Parrot::OpTrans::Compiled
         - Parrot::OpsFile
 requires:
   Storable: 2.12

Modified: trunk/lib/Parrot/OpTrans.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans.pm	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/lib/Parrot/OpTrans.pm	Thu Jul  2 07:07:07 2009	(r39866)
@@ -16,9 +16,9 @@
 The subclass hierarchy is as follows:
 
     OpTrans
-       |_________________________
-       |           |             |
-       C         CGoto       Compiled
+       |___________
+       |           |
+       C         CGoto
        |           |
     CPrederef      |
        | |         |
@@ -259,8 +259,6 @@
 
 =item C<Parrot::OpTrans::CSwitch>
 
-=item C<Parrot::OpTrans::Compiled>
-
 =back
 
 =cut

Modified: trunk/lib/Parrot/OpTrans/C.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/C.pm	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/lib/Parrot/OpTrans/C.pm	Thu Jul  2 07:07:07 2009	(r39866)
@@ -184,8 +184,6 @@
 
 =item C<Parrot::OpTrans::CSwitch>
 
-=item C<Parrot::OpTrans::Compiled>
-
 =back
 
 =cut

Modified: trunk/lib/Parrot/OpTrans/CGP.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CGP.pm	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/lib/Parrot/OpTrans/CGP.pm	Thu Jul  2 07:07:07 2009	(r39866)
@@ -162,8 +162,6 @@
 
 =item C<Parrot::OpTrans::CSwitch>
 
-=item C<Parrot::OpTrans::Compiled>
-
 =back
 
 =cut

Modified: trunk/lib/Parrot/OpTrans/CGoto.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CGoto.pm	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/lib/Parrot/OpTrans/CGoto.pm	Thu Jul  2 07:07:07 2009	(r39866)
@@ -367,8 +367,6 @@
 
 =item C<Parrot::OpTrans::CSwitch>
 
-=item C<Parrot::OpTrans::Compiled>
-
 =back
 
 =cut

Modified: trunk/lib/Parrot/OpTrans/CPrederef.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CPrederef.pm	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/lib/Parrot/OpTrans/CPrederef.pm	Thu Jul  2 07:07:07 2009	(r39866)
@@ -130,8 +130,6 @@
 
 =item C<Parrot::OpTrans::CSwitch>
 
-=item C<Parrot::OpTrans::Compiled>
-
 =back
 
 =cut

Modified: trunk/lib/Parrot/OpTrans/CSwitch.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/CSwitch.pm	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/lib/Parrot/OpTrans/CSwitch.pm	Thu Jul  2 07:07:07 2009	(r39866)
@@ -247,8 +247,6 @@
 
 =item C<Parrot::OpTrans::CPrederef>
 
-=item C<Parrot::OpTrans::Compiled>
-
 =back
 
 =cut

Deleted: trunk/lib/Parrot/OpTrans/Compiled.pm
==============================================================================
--- trunk/lib/Parrot/OpTrans/Compiled.pm	Thu Jul  2 07:07:07 2009	(r39865)
+++ /dev/null	00:00:00 1970	(deleted)
@@ -1,242 +0,0 @@
-# Copyright (C) 2001-2004, Parrot Foundation.
-# $Id$
-
-=head1 NAME
-
-Parrot::OpTrans::Compiled - Transform Parrot Bytecode To C
-
-=head1 DESCRIPTION
-
-C<Parrot::OpTrans::Compiled> inherits from C<Parrot::OpTrans> and is
-used by F<tools/build/pbc2c.pl> to transform Parrot bytecode to a C code
-run loop.
-
-=head2 Instance Methods
-
-=over 4
-
-=cut
-
-package Parrot::OpTrans::Compiled;
-
-use strict;
-use warnings;
-
-use base qw( Parrot::OpTrans );
-
-=item C<defines()>
-
-Returns the C C<#define> macros required by the ops.
-
-=cut
-
-sub defines {
-    return <<END;
-#define REL_PC (cur_opcode - start_code)
-#define IREG(i) REG_INT(interp, i)
-#define NREG(i) REG_NUM(interp, i)
-#define PREG(i) REG_PMC(interp, i)
-#define SREG(i) REG_STR(interp, i)
-#define CONST(i) interp->code->const_table->constants[i]
-END
-}
-
-=item C<pc($pc)>
-
-=item C<pc()>
-
-Sets/gets the current position in Parrot code.
-
-=cut
-
-sub pc {
-    my $self = shift;
-
-    if (@_) {
-        $self->{PC} = shift;
-    }
-    else {
-        return $self->{PC};
-    }
-}
-
-=item C<args(@args)>
-
-=item C<args()>
-
-Sets/gets the transform's arguments.
-
-=cut
-
-sub args {
-    my $self = shift;
-
-    if (@_) {
-        $self->{ARGS} = [@_];
-    }
-    else {
-        return $self->{ARGS};
-    }
-}
-
-=item C<arg($index)>
-
-Returns the argument at index C<$index>.
-
-=cut
-
-sub arg {
-    my $self = shift;
-
-    return $self->{ARGS}[shift];
-}
-
-=item C<goto_address($address)>
-
-Transforms the C<goto ADDRESS($address)> macro in an ops file into the
-relevant C code.
-
-=cut
-
-sub goto_address {
-    my ( $self, $addr ) = @_;
-
-    #print STDERR "pbcc: map_ret_abs($addr)\n";
-
-    return "cur_opcode = $addr;\ngoto switch_label";
-}
-
-=item C<expr_offset($offset)>
-
-An offset expression is always an offset from C<start_code>, because
-the C<ret> instruction may be in a different runops core. C<ret> will
-always treat saved addresses as relative to C<start_code>, because that
-interpretation is global across all runops cores.
-
-=cut
-
-sub expr_offset {
-    my ( $self, $offset ) = @_;
-
-    return sprintf( "start_code + %d + %s", $self->pc, $offset );
-}
-
-=item C<goto_offset($offset)>
-
-Transforms the C<goto OFFSET($offset)> macro in an ops file into the
-relevant C code.
-
-=cut
-
-sub goto_offset {
-    my ( $self, $offset ) = @_;
-
-    if ( $offset =~ /^-?\d+$/ ) {
-        return sprintf( "goto PC_%d", $self->pc + $offset );
-    }
-    else {
-        return sprintf( "cur_opcode = &&PC_%d; cur_opcode += %s; goto switch_label",
-            $self->pc, $offset );
-    }
-
-    #print STDERR "pbcc: map_ret_rel($offset)\n";
-}
-
-=item C<goto_pop()>
-
-Transforms the C<goto POP()> macro in an ops file into the relevant C
-code.
-
-=cut
-
-sub goto_pop {
-    my ($self) = @_;
-
-    return "cur_opcode = pop_dest(interp);\ngoto switch_label";
-}
-
-my %arg_maps = (
-    'i'  => "IREG(%ld)",
-    'n'  => "NREG(%ld)",
-    'p'  => "PREG(%ld)",
-    's'  => "SREG(%ld)",
-    'k'  => "PREG(%ld)",
-    'ki' => "IREG(%ld)",
-
-    'ic'  => "%ld",
-    'nc'  => "CONST(%ld)->u.number",
-    'pc'  => "CONST(%ld)->u.key",
-    'sc'  => "CONST(%ld)->u.string",
-    'kc'  => "CONST(%ld)->u.key",
-    'kic' => "%ld",
-);
-
-=item C<access_arg($type, $value, $op)>
-
-Returns the C code for the specified op argument type (see
-C<Parrot::OpTrans>) and value. C<$op> is an instance of C<Parrot::Op>.
-
-=cut
-
-sub access_arg {
-    my ( $self, $type, $num, $op ) = @_;
-
-    #print STDERR "pbcc: map_arg($type, $num)\n";
-
-    return sprintf( $arg_maps{$type}, $self->arg( $num - 1 ) );
-}
-
-=item C<restart_address($address)>
-
-Returns the C code for C<restart ADDRESS($address)>.
-
-=cut
-
-sub restart_address {
-    my ( $self, $addr ) = @_;
-
-    die "pbc2c.pl: Cannot handle RESUME ops!";
-}
-
-=item C<restart_offset($offset)>
-
-Returns the C code for C<restart OFFSET($offset)>.
-
-=cut
-
-sub restart_offset {
-    my ( $self, $offset ) = @_;
-
-    die "pbc2c.pl: Cannot handle RESUME ops!";
-}
-
-=back
-
-=head1 SEE ALSO
-
-=over 4
-
-=item C<Parrot::OpTrans>
-
-=item C<Parrot::OpTrans::C>
-
-=item C<Parrot::OpTrans::CGP>
-
-=item C<Parrot::OpTrans::CGoto>
-
-=item C<Parrot::OpTrans::CPrederef>
-
-=item C<Parrot::OpTrans::CSwitch>
-
-=back
-
-=cut
-
-1;
-
-# Local Variables:
-#   mode: cperl
-#   cperl-indent-level: 4
-#   fill-column: 100
-# End:
-# vim: expandtab shiftwidth=4:

Modified: trunk/tools/build/ops2c.pl
==============================================================================
--- trunk/tools/build/ops2c.pl	Thu Jul  2 01:59:21 2009	(r39865)
+++ trunk/tools/build/ops2c.pl	Thu Jul  2 07:07:07 2009	(r39866)
@@ -155,8 +155,6 @@
 
 =item C<Parrot::OpTrans::CGoto>
 
-=item C<Parrot::OpTrans::Compiled>
-
 =item C<Parrot::OpTrans::CGP>
 
 =item C<Parrot::OpTrans::CSwitch>


More information about the parrot-commits mailing list