Front page | perl.perl5.porters |
Postings from April 2000
Bytecode Patches
Thread Next
From:
simon
Date:
April 11, 2000 08:25
Subject:
Bytecode Patches
Message ID:
slrn8f6ee0.4p5.simon@othersideofthe.earth.li
Two things I noticed: GET_NV doesn't exist in B::Disassembler. I don't
know why not. Second, Bytecode compiling pulls in warnings and
attributes in things that don't really need it, meaning that a byte
stream that should be 300 bytes or so ends up at half a meg. Bletch.
This patch fixes both.
diff -ruN bleadperl/ext/B/B/Bytecode.pm perl2/ext/B/B/Bytecode.pm
--- bleadperl/ext/B/B/Bytecode.pm Wed Mar 8 02:24:19 2000
+++ perl2/ext/B/B/Bytecode.pm Tue Apr 11 23:38:25 2000
@@ -654,7 +654,7 @@
warn "done main program, now walking symbol table\n" if $debug_bc;
my ($pack, %exclude);
foreach $pack (qw(B O AutoLoader DynaLoader XSLoader Config DB VMS strict vars
- FileHandle Exporter Carp UNIVERSAL IO Fcntl Symbol
+ FileHandle Exporter Carp UNIVERSAL IO Fcntl Symbol warnings attributes File::Spec
SelectSaver blib Cwd))
{
$exclude{$pack."::"} = 1;
diff -ruN bleadperl/ext/B/B/Disassembler.pm perl2/ext/B/B/Disassembler.pm
--- bleadperl/ext/B/B/Disassembler.pm Fri Mar 3 02:39:15 2000
+++ perl2/ext/B/B/Disassembler.pm Tue Apr 11 23:34:30 2000
@@ -31,6 +31,13 @@
return unpack("n", $str);
}
+sub GET_NV {
+ my $fh = shift;
+ my $str = $fh->readn(8);
+ croak "reached EOF while reading NV" unless length($str) == 8;
+ return unpack("N", $str);
+}
+
sub GET_U32 {
my $fh = shift;
my $str = $fh->readn(4);
--
"Consider a spherical bear, in simple harmonic motion..."
-- Professor in the UCB physics department
Thread Next
-
Bytecode Patches
by simon