diff options
author | Karl Berry <karl@freefriends.org> | 2019-03-10 21:56:14 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-03-10 21:56:14 +0000 |
commit | e0a2a718e89f9700d627f1e6a8eea8f21d2fbeb8 (patch) | |
tree | 39972f65008b0d70f306a5f976494d29411bc41e /Master/tlpkg/tlperl/lib/B.pm | |
parent | b206fdc77d81ed1600949062f08de5690a4bf66f (diff) |
tl19 perl 5.28.1 for Windows, from Siep
git-svn-id: svn://tug.org/texlive/trunk@50322 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/tlperl/lib/B.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/B.pm | 117 |
1 files changed, 28 insertions, 89 deletions
diff --git a/Master/tlpkg/tlperl/lib/B.pm b/Master/tlpkg/tlperl/lib/B.pm index 5ea96fa2211..ce061e49101 100644 --- a/Master/tlpkg/tlperl/lib/B.pm +++ b/Master/tlpkg/tlperl/lib/B.pm @@ -6,16 +6,21 @@ # License or the Artistic License, as specified in the README file. # package B; -use strict; -require Exporter; @B::ISA = qw(Exporter); +# If B is loaded without imports, we do not want to unnecessarily pollute the stash with Exporter. +sub import { + return unless scalar @_ > 1; # Called as a method call. + require Exporter; + B->export_to_level(1, @_); +} + # walkoptree_slow comes from B.pm (you are there), # walkoptree comes from B.xs BEGIN { - $B::VERSION = '1.68'; + $B::VERSION = '1.74'; @B::EXPORT_OK = (); # Our BOOT code needs $VERSION set, and will append to @EXPORT_OK. @@ -43,12 +48,12 @@ push @B::EXPORT_OK, (qw(minus_c ppname save_BEGINs @B::IV::ISA = 'B::SV'; @B::NV::ISA = 'B::SV'; # RV is eliminated with 5.11.0, but effectively is a specialisation of IV now. -@B::RV::ISA = $] >= 5.011 ? 'B::IV' : 'B::SV'; +@B::RV::ISA = 'B::IV'; @B::PVIV::ISA = qw(B::PV B::IV); @B::PVNV::ISA = qw(B::PVIV B::NV); @B::PVMG::ISA = 'B::PVNV'; -@B::REGEXP::ISA = 'B::PVMG' if $] >= 5.011; -@B::INVLIST::ISA = 'B::PV' if $] >= 5.019; +@B::REGEXP::ISA = 'B::PVMG'; +@B::INVLIST::ISA = 'B::PV'; @B::PVLV::ISA = 'B::GV'; @B::BM::ISA = 'B::GV'; @B::AV::ISA = 'B::PVMG'; @@ -74,13 +79,14 @@ push @B::EXPORT_OK, (qw(minus_c ppname save_BEGINs @B::SPECIAL::ISA = 'B::OBJECT'; -@B::optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP +our @optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP METHOP UNOP_AUX); # bytecode.pl contained the following comment: # Nullsv *must* come first in the following so that the condition # ($$sv == 0) can continue to be used to test (sv == Nullsv). -@B::specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no - (SV*)pWARN_ALL (SV*)pWARN_NONE (SV*)pWARN_STD); +our @specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no + (SV*)pWARN_ALL (SV*)pWARN_NONE (SV*)pWARN_STD + &PL_sv_zero); { # Stop "-w" from complaining about the lack of a real B::OBJECT class @@ -114,15 +120,17 @@ sub B::IV::int_value { } sub B::NULL::as_string() {""} -*B::IV::as_string = \*B::IV::int_value; -*B::PV::as_string = \*B::PV::PV; +*B::IV::as_string = *B::IV::as_string = \*B::IV::int_value; +*B::PV::as_string = *B::PV::as_string = \*B::PV::PV; # The input typemap checking makes no distinction between different SV types, # so the XS body will generate the same C code, despite the different XS # "types". So there is no change in behaviour from doing "newXS" like this, # compared with the old approach of having a (near) duplicate XS body. # We should fix the typemap checking. -*B::IV::RV = \*B::PV::RV if $] > 5.012; + +# Since perl 5.12.0 +*B::IV::RV = *B::IV::RV = \*B::PV::RV; my $debug; my $op_count = 0; @@ -256,12 +264,12 @@ sub walkoptree_exec { sub walksymtable { my ($symref, $method, $recurse, $prefix) = @_; my $sym; - my $ref; my $fullname; no strict 'refs'; $prefix = '' unless defined $prefix; foreach my $sym ( sort keys %$symref ) { - $ref= $symref->{$sym}; + my $dummy = $symref->{$sym}; # Copying the glob and incrementing + # the GPs refcnt clears cached methods $fullname = "*main::".$prefix.$sym; if ($sym =~ /::$/) { $sym = $prefix . $sym; @@ -541,52 +549,10 @@ give incomprehensible results, or worse. =head2 SV-RELATED CLASSES -B::IV, B::NV, B::RV, B::PV, B::PVIV, B::PVNV, B::PVMG, B::BM (5.9.5 and -earlier), B::PVLV, B::AV, B::HV, B::CV, B::GV, B::FM, B::IO. These classes +B::IV, B::NV, B::PV, B::PVIV, B::PVNV, B::PVMG, +B::PVLV, B::AV, B::HV, B::CV, B::GV, B::FM, B::IO. These classes correspond in the obvious way to the underlying C structures of similar names. -The inheritance hierarchy mimics the underlying C "inheritance". For the -5.10.x branch, (I<ie> 5.10.0, 5.10.1 I<etc>) this is: - - B::SV - | - +------------+------------+------------+ - | | | | - B::PV B::IV B::NV B::RV - \ / / - \ / / - B::PVIV / - \ / - \ / - \ / - B::PVNV - | - | - B::PVMG - | - +-----+-----+-----+-----+ - | | | | | - B::AV B::GV B::HV B::CV B::IO - | | - | | - B::PVLV B::FM - -For 5.9.0 and earlier, PVLV is a direct subclass of PVMG, and BM is still -present as a distinct type, so the base of this diagram is - - - | - | - B::PVMG - | - +------+-----+-----+-----+-----+-----+ - | | | | | | | - B::PVLV B::BM B::AV B::GV B::HV B::CV B::IO - | - | - B::FM - -For 5.11.0 and later, B::RV is abolished, and IVs can be used to store -references, and a new type B::REGEXP is introduced, giving this structure: +The inheritance hierarchy mimics the underlying C "inheritance": B::SV | @@ -950,17 +916,6 @@ IoIFP($io) == PerlIO_stderr(). Like C<ARRAY>, but takes an index as an argument to get only one element, rather than a list of all of them. -=item OFF - -This method is deprecated if running under Perl 5.8, and is no longer present -if running under Perl 5.9 - -=item AvFLAGS - -This method returns the AV specific -flags. In Perl 5.9 these are now stored -in with the main SV flags, so this method is no longer present. - =back =head2 B::CV Methods @@ -981,8 +936,7 @@ in with the main SV flags, so this method is no longer present. =item PADLIST -Returns a B::PADLIST object under Perl 5.18 or higher, or a B::AV in -earlier versions. +Returns a B::PADLIST object. =item OUTSIDE @@ -1020,11 +974,6 @@ Returns the name of a lexical sub, otherwise C<undef>. =item ARRAY -=item PMROOT - -This method is not present if running under Perl 5.9, as the PMROOT -information is no longer stored directly in the hash. - =back =head2 OP-RELATED CLASSES @@ -1167,16 +1116,8 @@ op is contained within. =item pmreplstart -=item pmnext - -Only up to Perl 5.9.4 - =item pmflags -=item extflags - -Since Perl 5.9.5 - =item precomp =item pmoffset @@ -1292,10 +1233,8 @@ Perl 5.22 introduced the B::PADNAMELIST and B::PADNAME classes. =item ARRAY -A list of pads. The first one contains the names. - -The first one is a B::PADNAMELIST under Perl 5.22, and a B::AV under -earlier versions. The rest are currently B::AV objects, but that could +A list of pads. The first one is a B::PADNAMELIST containing the names. +The rest are currently B::AV objects, but that could change in future versions. =item ARRAYelt |