Author: jkeenan
Date: Mon Mar 24 08:57:32 2008
New Revision: 26527
Modified:
trunk/lib/Parrot/Pmc2c/Pmc2cMain.pm
trunk/t/tools/pmc2cutils/01-pmc2cutils.t
trunk/t/tools/pmc2cutils/02-find_file.t
trunk/t/tools/pmc2cutils/03-dump_vtable.t
trunk/t/tools/pmc2cutils/04-dump_pmc.t
trunk/t/tools/pmc2cutils/05-gen_c.t
trunk/t/tools/pmc2cutils/06-print_tree.t
trunk/tools/build/pmc2c.pl
Log:
Applying patch submitted in RT 38194 ([TODO] build - optimize pmc2c.pl).
Reduce number of invocations of FindBin.
Modified: trunk/lib/Parrot/Pmc2c/Pmc2cMain.pm
==============================================================================
--- trunk/lib/Parrot/Pmc2c/Pmc2cMain.pm (original)
+++ trunk/lib/Parrot/Pmc2c/Pmc2cMain.pm Mon Mar 24 08:57:32 2008
@@ -3,7 +3,6 @@
package Parrot::Pmc2c::Pmc2cMain;
use strict;
use warnings;
-use FindBin;
use Storable ();
use Parrot::PMC ();
use Parrot::Pmc2c::VTable ();
@@ -88,7 +87,7 @@
unless ( defined $allargsref->{args} and ref( $allargsref->{args} ) eq
q{ARRAY} );
unshift @{ $allargsref->{include} },
- ( ".", "$FindBin::Bin/../..", "$FindBin::Bin/../../src/pmc/" );
+ ( ".", "$allargsref->{bin}/../..", "$allargsref->{bin}/../../src/pmc/"
);
foreach my $opt qw(nolines) {
if ( !defined $allargsref->{opt}{$opt} ) {
@@ -100,7 +99,7 @@
=head3 C<dump_vtable()>
- $self->dump_vtable("$FindBin::Bin/../../src/vtable.tbl");
+ $self->dump_vtable("$Bin/../../src/vtable.tbl");
B<Purpose:> Create a F<.dump> file for the default vtable (from which
all PMCs inherit).
Modified: trunk/t/tools/pmc2cutils/01-pmc2cutils.t
==============================================================================
--- trunk/t/tools/pmc2cutils/01-pmc2cutils.t (original)
+++ trunk/t/tools/pmc2cutils/01-pmc2cutils.t Mon Mar 24 08:57:32 2008
@@ -31,6 +31,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
Modified: trunk/t/tools/pmc2cutils/02-find_file.t
==============================================================================
--- trunk/t/tools/pmc2cutils/02-find_file.t (original)
+++ trunk/t/tools/pmc2cutils/02-find_file.t Mon Mar 24 08:57:32 2008
@@ -32,6 +32,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
Modified: trunk/t/tools/pmc2cutils/03-dump_vtable.t
==============================================================================
--- trunk/t/tools/pmc2cutils/03-dump_vtable.t (original)
+++ trunk/t/tools/pmc2cutils/03-dump_vtable.t Mon Mar 24 08:57:32 2008
@@ -41,6 +41,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
$dump_file = $self->dump_vtable("$main::topdir/src/vtable.tbl");
Modified: trunk/t/tools/pmc2cutils/04-dump_pmc.t
==============================================================================
--- trunk/t/tools/pmc2cutils/04-dump_pmc.t (original)
+++ trunk/t/tools/pmc2cutils/04-dump_pmc.t Mon Mar 24 08:57:32 2008
@@ -62,6 +62,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -100,6 +101,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -141,6 +143,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -156,6 +159,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -191,6 +195,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -236,6 +241,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -287,6 +293,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -329,6 +336,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -368,6 +376,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -411,6 +420,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -468,6 +478,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
Modified: trunk/t/tools/pmc2cutils/05-gen_c.t
==============================================================================
--- trunk/t/tools/pmc2cutils/05-gen_c.t (original)
+++ trunk/t/tools/pmc2cutils/05-gen_c.t Mon Mar 24 08:57:32 2008
@@ -65,6 +65,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -106,6 +107,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -148,6 +150,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -198,6 +201,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
Modified: trunk/t/tools/pmc2cutils/06-print_tree.t
==============================================================================
--- trunk/t/tools/pmc2cutils/06-print_tree.t (original)
+++ trunk/t/tools/pmc2cutils/06-print_tree.t Mon Mar 24 08:57:32 2008
@@ -65,6 +65,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -114,6 +115,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -167,6 +169,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -220,6 +223,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
@@ -269,6 +273,7 @@
include => [EMAIL PROTECTED],
opt => \%opt,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
isa_ok( $self, q{Parrot::Pmc2c::Pmc2cMain} );
Modified: trunk/tools/build/pmc2c.pl
==============================================================================
--- trunk/tools/build/pmc2c.pl (original)
+++ trunk/tools/build/pmc2c.pl Mon Mar 24 08:57:32 2008
@@ -4,10 +4,9 @@
use strict;
use warnings;
-use FindBin;
-use lib "$FindBin::Bin/../..";
-use lib "$FindBin::Bin/../../lib";
use Getopt::Long ();
+use FindBin qw($Bin);
+use lib "$Bin/../../lib";
use Parrot::Pmc2c::Pmc2cMain ();
my ( %action, %options, @pmc_include_paths );
@@ -39,11 +38,12 @@
include => [EMAIL PROTECTED],
opt => \%options,
args => [EMAIL PROTECTED],
+ bin => $Bin,
}
);
if ( $action{default} ) {
- $self->dump_vtable("$FindBin::Bin/../../src/vtable.tbl");
+ $self->dump_vtable("$Bin/../../src/vtable.tbl");
exit;
}