summaryrefslogtreecommitdiff
path: root/opcode.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-10-31 15:52:50 +0000
committerNicholas Clark <nick@ccl4.org>2005-10-31 15:52:50 +0000
commit1d5774de323ac43a91c2a30cf2e40384e4754f98 (patch)
treee62b70709d532d61e9ba14338604930519ad027a /opcode.pl
parent609700aa10bcdb000422f710ddafea2d63c0c0b9 (diff)
downloadperl-1d5774de323ac43a91c2a30cf2e40384e4754f98.tar.gz
It appears that it's trivially easy to alias opcode functions in
the opcode table. We should be able to get both a speed and size saving here. Time will tell how much. p4raw-id: //depot/perl@25929
Diffstat (limited to 'opcode.pl')
-rwxr-xr-xopcode.pl16
1 files changed, 15 insertions, 1 deletions
diff --git a/opcode.pl b/opcode.pl
index 571fa14ae7..a3284dae3b 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -33,6 +33,19 @@ while (<DATA>) {
$args{$key} = $args;
}
+# Set up aliases
+
+my %alias;
+
+# Format is "this function" => "does these op names"
+my @raw_alias = (
+ Perl_do_kv => 'keys values',
+ );
+
+while (my ($func, $names) = splice @raw_alias, 0, 2) {
+ $alias{$_} = $func foreach split ' ', $names;
+}
+
# Emit defines.
$i = 0;
@@ -170,7 +183,8 @@ EXT Perl_ppaddr_t PL_ppaddr[] /* or perlvars.h */
END
for (@ops) {
- print "\tMEMBER_TO_FPTR(Perl_pp_$_),\n" unless $_ eq "custom";
+ my $name = $alias{$_} || "Perl_pp_$_";
+ print "\tMEMBER_TO_FPTR($name),\n" unless $_ eq "custom";
}
print <<END;