This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ext/B: remove pre-5.10 support
authorDavid Mitchell <davem@iabyn.com>
Wed, 24 Oct 2012 17:10:22 +0000 (18:10 +0100)
committerDavid Mitchell <davem@iabyn.com>
Fri, 26 Oct 2012 15:51:55 +0000 (16:51 +0100)
Expunge all conditional code that supports 5.6.x through 5.9.x,
making 5.10.0 the oldest release notionally supported.
This simplifies things considerably.

See p5p thread starting at
    Message-ID: <20121018122941.GE1908@iabyn.com>

ext/B/B.pm
ext/B/B.xs
ext/B/B/Concise.pm
ext/B/Makefile.PL
ext/B/t/OptreeCheck.pm
ext/B/t/concise-xs.t
ext/B/t/f_sort.t
ext/B/t/optree_constants.t
ext/B/t/optree_misc.t
ext/B/t/optree_specials.t
ext/B/t/pragma.t

index 6802568..97bfd08 100644 (file)
@@ -35,8 +35,7 @@ push @B::EXPORT_OK, (qw(minus_c ppname save_BEGINs
                        parents comppadlist sv_undef compile_stats timing_info
                        begin_av init_av check_av end_av regex_padav dowarn
                        defstash curstash warnhook diehook inc_gv @optype
-                       @specialsv_name
-                     ), $] > 5.009 && 'unitcheck_av');
+                       @specialsv_name unitcheck_av));
 
 @B::SV::ISA = 'B::OBJECT';
 @B::NULL::ISA = 'B::SV';
@@ -49,10 +48,8 @@ push @B::EXPORT_OK, (qw(minus_c ppname save_BEGINs
 @B::PVNV::ISA = qw(B::PVIV B::NV);
 @B::PVMG::ISA = 'B::PVNV';
 @B::REGEXP::ISA = 'B::PVMG' if $] >= 5.011;
-# Change in the inheritance hierarchy post 5.9.0
-@B::PVLV::ISA = $] > 5.009 ? 'B::GV' : 'B::PVMG';
-# BM is eliminated post 5.9.5, but effectively is a specialisation of GV now.
-@B::BM::ISA = $] > 5.009005 ? 'B::GV' : 'B::PVMG';
+@B::PVLV::ISA = 'B::GV';
+@B::BM::ISA = 'B::GV';
 @B::AV::ISA = 'B::PVMG';
 @B::GV::ISA = 'B::PVMG';
 @B::HV::ISA = 'B::PVMG';
index 53023cd..13f4881 100644 (file)
@@ -21,9 +21,7 @@ typedef FILE * InputStream;
 
 static const char* const svclassnames[] = {
     "B::NULL",
-#if PERL_VERSION >= 9
     "B::BIND",
-#endif
     "B::IV",
     "B::NV",
 #if PERL_VERSION <= 10
@@ -33,22 +31,14 @@ static const char* const svclassnames[] = {
     "B::PVIV",
     "B::PVNV",
     "B::PVMG",
-#if PERL_VERSION <= 8
-    "B::BM",
-#endif
 #if PERL_VERSION >= 11
     "B::REGEXP",
 #endif
-#if PERL_VERSION >= 9
     "B::GV",
-#endif
     "B::PVLV",
     "B::AV",
     "B::HV",
     "B::CV",
-#if PERL_VERSION <= 8
-    "B::GV",
-#endif
     "B::FM",
     "B::IO",
 };
@@ -183,8 +173,7 @@ cc_opclass(pTHX_ const OP *o)
        return (!custom &&
                   (o->op_private & (OPpTRANS_TO_UTF|OPpTRANS_FROM_UTF))
               )
-#if  defined(USE_ITHREADS) \
-  && (PERL_VERSION > 8 || (PERL_VERSION == 8 && PERL_SUBVERSION >= 9))
+#if  defined(USE_ITHREADS)
                ? OPc_PADOP : OPc_PVOP;
 #else
                ? OPc_SVOP : OPc_PVOP;
@@ -274,7 +263,6 @@ make_sv_object(pTHX_ SV *sv)
     return arg;
 }
 
-#if PERL_VERSION >= 9
 static SV *
 make_temp_object(pTHX_ SV *temp)
 {
@@ -339,7 +327,6 @@ make_cop_io_object(pTHX_ COP *cop)
        return make_sv_object(aTHX_ NULL);
     }
 }
-#endif
 
 static SV *
 make_mg_object(pTHX_ MAGIC *mg)
@@ -466,15 +453,8 @@ cchar(pTHX_ SV *sv)
     return sstr;
 }
 
-#if PERL_VERSION >= 9
-#  define PMOP_pmreplstart(o)  o->op_pmstashstartu.op_pmreplstart
-#  define PMOP_pmreplroot(o)   o->op_pmreplrootu.op_pmreplroot
-#else
-#  define PMOP_pmreplstart(o)  o->op_pmreplstart
-#  define PMOP_pmreplroot(o)   o->op_pmreplroot
-#  define PMOP_pmpermflags(o)  o->op_pmpermflags
-#  define PMOP_pmdynflags(o)      o->op_pmdynflags
-#endif
+#define PMOP_pmreplstart(o)    o->op_pmstashstartu.op_pmreplstart
+#define PMOP_pmreplroot(o)     o->op_pmreplrootu.op_pmreplroot
 
 static SV *
 walkoptree(pTHX_ OP *o, const char *method, SV *ref)
@@ -527,15 +507,9 @@ static SV **
 oplist(pTHX_ OP *o, SV **SP)
 {
     for(; o; o = o->op_next) {
-#if PERL_VERSION >= 9
        if (o->op_opt == 0)
            break;
        o->op_opt = 0;
-#else
-       if (o->op_seq == 0)
-           break;
-       o->op_seq = 0;
-#endif
        XPUSHs(make_op_object(aTHX_ o));
         switch (o->op_type) {
        case OP_SUBST:
@@ -596,9 +570,7 @@ typedef IO  *B__IO;
 
 typedef MAGIC  *B__MAGIC;
 typedef HE      *B__HE;
-#if PERL_VERSION >= 9
 typedef struct refcounted_he   *B__RHE;
-#endif
 #ifdef PadlistARRAY
 typedef PADLIST        *B__PADLIST;
 #endif
@@ -655,10 +627,8 @@ BOOT:
     ASSIGN_COMMON_ALIAS(I, initav);
     cv = newXS("B::check_av", intrpvar_sv_common, file);
     ASSIGN_COMMON_ALIAS(I, checkav_save);
-#if PERL_VERSION >= 9
     cv = newXS("B::unitcheck_av", intrpvar_sv_common, file);
     ASSIGN_COMMON_ALIAS(I, unitcheckav_save);
-#endif
     cv = newXS("B::begin_av", intrpvar_sv_common, file);
     ASSIGN_COMMON_ALIAS(I, beginav_save);
     cv = newXS("B::end_av", intrpvar_sv_common, file);
@@ -840,16 +810,7 @@ cstring(sv)
 void
 threadsv_names()
     PPCODE:
-#if PERL_VERSION <= 8
-# ifdef USE_5005THREADS
-       int i;
-       const STRLEN len = strlen(PL_threadsv_names);
 
-       EXTEND(sp, len);
-       for (i = 0; i < len; i++)
-           PUSHs(newSVpvn_flags(&PL_threadsv_names[i], 1, SVs_TEMP));
-# endif
-#endif
 
 #define SVp            0x00000
 #define U32p           0x10000
@@ -865,12 +826,8 @@ threadsv_names()
 #define UNOP_first_ix          OPp | offsetof(struct unop, op_first)
 #define BINOP_last_ix          OPp | offsetof(struct binop, op_last)
 #define LOGOP_other_ix         OPp | offsetof(struct logop, op_other)
-#if PERL_VERSION >= 9
-#  define PMOP_pmreplstart_ix \
+#define PMOP_pmreplstart_ix \
                OPp | offsetof(struct pmop, op_pmstashstartu.op_pmreplstart)
-#else
-#  define PMOP_pmreplstart_ix  OPp | offsetof(struct pmop, op_pmreplstart)
-#endif
 #define LOOP_redoop_ix         OPp | offsetof(struct loop, op_redoop)
 #define LOOP_nextop_ix         OPp | offsetof(struct loop, op_nextop)
 #define LOOP_lastop_ix         OPp | offsetof(struct loop, op_lastop)
@@ -898,11 +855,7 @@ threadsv_names()
 
 #define COP_seq_ix             U32p | offsetof(struct cop, cop_seq)
 #define COP_line_ix            line_tp | offsetof(struct cop, cop_line)
-#if PERL_VERSION >= 9
 #define COP_hints_ix           U32p | offsetof(struct cop, cop_hints)
-#else
-#define COP_hints_ix           U8p | offsetof(struct cop, op_private)
-#endif
 
 #ifdef USE_ITHREADS
 #define COP_stashpv_ix         char_pp | offsetof(struct cop, cop_stashpv)
@@ -1012,7 +965,6 @@ ppaddr(o)
            SvPVX(sv)[i] = toUPPER(SvPVX(sv)[i]);
        ST(0) = sv;
 
-#if PERL_VERSION >= 9
 #  These 3 are all bitfields, so we can't take their addresses.
 UV
 type(o)
@@ -1034,25 +986,6 @@ type(o)
     OUTPUT:
        RETVAL
 
-#else
-
-UV
-type(o)
-       B::OP           o
-    ALIAS:
-       seq = 1
-    CODE:
-       switch(ix) {
-         case 1:
-           RETVAL = o->op_seq;
-           break;
-         default:
-           RETVAL = o->op_type;
-       }
-    OUTPUT:
-       RETVAL
-
-#endif
 
 void
 oplist(o)
@@ -1077,53 +1010,28 @@ children(o)
 
 MODULE = B     PACKAGE = B::PMOP               PREFIX = PMOP_
 
-#if PERL_VERSION <= 8
 
 void
 PMOP_pmreplroot(o)
        B::PMOP         o
-       OP *            root = NO_INIT
     CODE:
-       root = o->op_pmreplroot;
-       /* OP_PUSHRE stores an SV* instead of an OP* in op_pmreplroot */
        if (o->op_type == OP_PUSHRE) {
-           ST(0) = sv_newmortal();
-#  ifdef USE_ITHREADS
-            sv_setiv(ST(0), INT2PTR(PADOFFSET,root) );
-#  else
-           sv_setiv(newSVrv(ST(0), root ?
-                            svclassnames[SvTYPE((SV*)root)] : "B::SV"),
-                    PTR2IV(root));
-#  endif
-       }
-       else {
-           ST(0) = make_op_object(aTHX_ root);
-       }
-
-#else
-
-void
-PMOP_pmreplroot(o)
-       B::PMOP         o
-    CODE:
-       if (o->op_type == OP_PUSHRE) {
-#  ifdef USE_ITHREADS
+#ifdef USE_ITHREADS
            ST(0) = sv_newmortal();
             sv_setiv(ST(0), o->op_pmreplrootu.op_pmtargetoff);
-#  else
+#else
            GV *const target = o->op_pmreplrootu.op_pmtargetgv;
            ST(0) = sv_newmortal();
            sv_setiv(newSVrv(ST(0), target ?
                             svclassnames[SvTYPE((SV*)target)] : "B::SV"),
                     PTR2IV(target));
-#  endif
+#endif
        }
        else {
            OP *const root = o->op_pmreplrootu.op_pmreplroot; 
            ST(0) = make_op_object(aTHX_ root);
        }
 
-#endif
 
 #ifdef USE_ITHREADS
 #define PMOP_pmstashpv(o)      PmopSTASHPV(o);
@@ -1142,23 +1050,6 @@ PMOP_pmstash(o)
 
 #endif
 
-#if PERL_VERSION < 9
-
-void
-PMOP_pmnext(o)
-       B::PMOP         o
-    PPCODE:
-       PUSHs(make_op_object(aTHX_ o->op_pmnext));
-
-U32
-PMOP_pmpermflags(o)
-       B::PMOP         o
-
-U8
-PMOP_pmdynflags(o)
-        B::PMOP         o
-
-#endif
 
 void
 PMOP_precomp(o)
@@ -1170,12 +1061,10 @@ PMOP_precomp(o)
        rx = PM_GETRE(o);
        ST(0) = sv_newmortal();
        if (rx) {
-#if PERL_VERSION >= 9
            if (ix) {
                sv_setuv(ST(0), RX_EXTFLAGS(rx));
-           } else
-#endif
-           {
+           }
+           else {
                sv_setpvn(ST(0), RX_PRECOMP(rx), RX_PRELEN(rx));
            }
        }
@@ -1201,10 +1090,8 @@ BOOT:
         cv = newXS("B::COP::filegv", XS_B__OP_next, __FILE__);
         XSANY.any_i32 = COP_filegv_ix;
 #endif
-#if PERL_VERSION >= 9
         cv = newXS("B::PMOP::reflags", XS_B__PMOP_precomp, __FILE__);
         XSANY.any_i32 = 1;
-#endif
 }
 
 MODULE = B     PACKAGE = B::PADOP
@@ -1330,14 +1217,9 @@ COP_warnings(o)
     ALIAS:
        io = 1
     PPCODE:
-#if PERL_VERSION >= 9
        ST(0) = ix ? make_cop_io_object(aTHX_ o) : make_warnings_object(aTHX_ o);
-#else
-       ST(0) = make_sv_object(aTHX_ ix ? o->cop_io : o->cop_warnings);
-#endif
        XSRETURN(1);
 
-#if PERL_VERSION >= 9
 
 B::RHE
 COP_hints_hash(o)
@@ -1347,7 +1229,6 @@ COP_hints_hash(o)
     OUTPUT:
        RETVAL
 
-#endif
 
 MODULE = B     PACKAGE = B::SV
 
@@ -1399,7 +1280,6 @@ MODULE = B        PACKAGE = B::IV
 #define IV_uvx_ix      sv_UVp | offsetof(struct xpvuv, xuv_uv)
 #define NV_nvx_ix      sv_NVp | offsetof(struct xpvnv, xnv_u.xnv_nv)
 
-#if PERL_VERSION >= 10
 #define NV_cop_seq_range_low_ix \
                        sv_U32p | offsetof(struct xpvnv, xnv_u.xpad_cop_seq.xlow)
 #define NV_cop_seq_range_high_ix \
@@ -1408,51 +1288,30 @@ MODULE = B      PACKAGE = B::IV
                        sv_U32p | offsetof(struct xpvnv, xnv_u.xpad_cop_seq.xlow)
 #define NV_parent_fakelex_flags_ix \
                        sv_U32p | offsetof(struct xpvnv, xnv_u.xpad_cop_seq.xhigh)
-#else
-#define NV_cop_seq_range_low_ix \
-                       sv_NVp | offsetof(struct xpvnv, xnv_nv)
-#define NV_cop_seq_range_high_ix \
-                       sv_UVp | offsetof(struct xpvnv, xuv_uv)
-#define NV_parent_pad_index_ix \
-                       sv_NVp | offsetof(struct xpvnv, xnv_nv)
-#define NV_parent_fakelex_flags_ix \
-                       sv_UVp | offsetof(struct xpvnv, xuv_uv)
-#endif
 
 #define PV_cur_ix      sv_STRLENp | offsetof(struct xpv, xpv_cur)
 #define PV_len_ix      sv_STRLENp | offsetof(struct xpv, xpv_len)
 
 #define PVMG_stash_ix  sv_SVp | offsetof(struct xpvmg, xmg_stash)
 
-#if PERL_VERSION >= 10
-#  if PERL_VERSION > 14
+#if PERL_VERSION > 14
 #    define PVBM_useful_ix     sv_I32p | offsetof(struct xpvgv, xnv_u.xbm_s.xbm_useful)
 #    define PVBM_previous_ix   sv_UVp | offsetof(struct xpvuv, xuv_uv)
-#  else
+#else
 #define PVBM_useful_ix sv_I32p | offsetof(struct xpvgv, xiv_u.xivu_i32)
 #define PVBM_previous_ix    sv_U32p | offsetof(struct xpvgv, xnv_u.xbm_s.xbm_previous)
-#  endif
-#define PVBM_rare_ix   sv_U8p | offsetof(struct xpvgv, xnv_u.xbm_s.xbm_rare)
-#else
-#define PVBM_useful_ix sv_I32p | offsetof(struct xpvbm, xbm_useful)
-#define PVBM_previous_ix    sv_U16p | offsetof(struct xpvbm, xbm_previous)
-#define PVBM_rare_ix   sv_U8p | offsetof(struct xpvbm, xbm_rare)
 #endif
 
+#define PVBM_rare_ix   sv_U8p | offsetof(struct xpvgv, xnv_u.xbm_s.xbm_rare)
+
 #define PVLV_targoff_ix        sv_U32p | offsetof(struct xpvlv, xlv_targoff)
 #define PVLV_targlen_ix        sv_U32p | offsetof(struct xpvlv, xlv_targlen)
 #define PVLV_targ_ix   sv_SVp | offsetof(struct xpvlv, xlv_targ)
 #define PVLV_type_ix   sv_char_p | offsetof(struct xpvlv, xlv_type)
 
-#if PERL_VERSION >= 10
 #define PVGV_stash_ix  sv_SVp | offsetof(struct xpvgv, xnv_u.xgv_stash)
 #define PVGV_flags_ix  sv_STRLENp | offsetof(struct xpvgv, xpv_cur)
 #define PVIO_lines_ix  sv_IVp | offsetof(struct xpvio, xiv_iv)
-#else
-#define PVGV_stash_ix  sv_SVp | offsetof(struct xpvgv, xgv_stash)
-#define PVGV_flags_ix  sv_U8p | offsetof(struct xpvgv, xgv_flags)
-#define PVIO_lines_ix  sv_IVp | offsetof(struct xpvio, xio_lines)
-#endif
 
 #define PVIO_page_ix       sv_IVp | offsetof(struct xpvio, xio_page)
 #define PVIO_page_len_ix    sv_IVp | offsetof(struct xpvio, xio_page_len)
@@ -1714,16 +1573,6 @@ PV(sv)
            len = SvCUR(sv);
            p = SvPVX_const(sv);
            utf8 = SvUTF8(sv);
-#if PERL_VERSION < 10
-           /* Before 5.10 (well 931b58fb28fa5ca7), PAD_COMPNAME_GEN was stored
-              in SvCUR(), which meant we had to attempt this special casing
-              to avoid tripping up over variable names in the pads.  */
-           if((SvLEN(sv) && len >= SvLEN(sv))) {
-               /* It claims to be longer than the space allocated for it -
-                  presumably it's a variable name in the pad  */
-               len = strlen(p);
-           }
-#endif
         }
         else {
             /* XXX for backward compatibility, but should fail */
@@ -1815,14 +1664,9 @@ GvNAME(gv)
        FILE = 1
        B::HV::NAME = 2
     CODE:
-#if PERL_VERSION >= 10
        ST(0) = sv_2mortal(newSVhek(!ix ? GvNAME_HEK(gv)
                                        : (ix == 1 ? GvFILE_HEK(gv)
                                                   : HvNAME_HEK((HV *)gv))));
-#else
-       ST(0) = !ix ? newSVpvn_flags(GvNAME(gv), GvNAMELEN(gv), SVs_TEMP)
-                   : sv_2mortal(newSVpv(ix == 1 ? GvFILE(gv) : HvNAME((HV *)gv), 0))
-#endif
 
 bool
 is_empty(gv)
@@ -1831,11 +1675,7 @@ is_empty(gv)
        isGV_with_GP = 1
     CODE:
        if (ix) {
-#if PERL_VERSION >= 9
            RETVAL = isGV_with_GP(gv) ? TRUE : FALSE;
-#else
-           RETVAL = TRUE; /* In 5.8 and earlier they all are.  */
-#endif
        } else {
             RETVAL = GvGP(gv) == Null(GP*);
        }
@@ -1906,13 +1746,6 @@ FILEGV(gv)
 
 MODULE = B     PACKAGE = B::IO         PREFIX = Io
 
-#if PERL_VERSION <= 8
-
-short
-IoSUBPROCESS(io)
-       B::IO   io
-
-#endif
 
 bool
 IsSTD(io,name)
@@ -1964,28 +1797,11 @@ AvARRAYelt(av, idx)
        else
            XPUSHs(make_sv_object(aTHX_ NULL));
 
-#if PERL_VERSION < 9
-                                  
-#define AvOFF(av) ((XPVAV*)SvANY(av))->xof_off
-
-IV
-AvOFF(av)
-       B::AV   av
-
-MODULE = B     PACKAGE = B::AV
-
-U8
-AvFLAGS(av)
-       B::AV   av
-
-#endif
 
 MODULE = B     PACKAGE = B::FM         PREFIX = Fm
 
-#if PERL_VERSION > 7 || (PERL_VERSION == 7 && PERL_SUBVERSION >= 3)
-# undef FmLINES
-# define FmLINES(sv) 0
-#endif
+#undef FmLINES
+#define FmLINES(sv) 0
 
 IV
 FmLINES(form)
@@ -2056,16 +1872,6 @@ I32
 HvRITER(hv)
        B::HV   hv
 
-#if PERL_VERSION < 9
-
-B::PMOP
-HvPMROOT(hv)
-       B::HV   hv
-    PPCODE:
-       PUSHs(make_op_object(aTHX_ HvPMROOT(hv)));
-
-#endif
-
 void
 HvARRAY(hv)
        B::HV   hv
@@ -2098,8 +1904,6 @@ HeHASH(he)
 
 MODULE = B     PACKAGE = B::RHE
 
-#if PERL_VERSION >= 9
-
 SV*
 HASH(h)
        B::RHE h
@@ -2108,7 +1912,6 @@ HASH(h)
     OUTPUT:
        RETVAL
 
-#endif
 
 #ifdef PadlistARRAY
 
index 7de36df..130c84c 100644 (file)
@@ -14,7 +14,7 @@ use warnings; # uses #3 and #4, since warnings uses Carp
 
 use Exporter (); # use #5
 
-our $VERSION   = "0.93";
+our $VERSION   = "0.94";
 our @ISA       = qw(Exporter);
 our @EXPORT_OK = qw( set_style set_style_standard add_callback
                     concise_subref concise_cv concise_main
@@ -47,8 +47,7 @@ my %style =
     "(?(#seq)?)#noise#arg(?([#targarg])?)"],
    "debug" =>
    ["#class (#addr)\n\top_next\t\t#nextaddr\n\top_sibling\t#sibaddr\n\t"
-    . "op_ppaddr\tPL_ppaddr[OP_#NAME]\n\top_type\t\t#typenum\n" .
-    ($] > 5.009 ? '' : "\top_seq\t\t#seqnum\n")
+    . "op_ppaddr\tPL_ppaddr[OP_#NAME]\n\top_type\t\t#typenum\n"
     . "\top_flags\t#flagval\n\top_private\t#privval\t#hintsval\n"
     . "(?(\top_first\t#firstaddr\n)?)(?(\top_last\t\t#lastaddr\n)?)"
     . "(?(\top_sv\t\t#svaddr\n)?)",
@@ -510,15 +509,9 @@ sub walk_exec {
                push @$targ, $ar;
                push @todo, [$op->pmreplstart, $ar];
            } elsif ($name =~ /^enter(loop|iter)$/) {
-               if ($] > 5.009) {
-                   $labels{${$op->nextop}} = "NEXT";
-                   $labels{${$op->lastop}} = "LAST";
-                   $labels{${$op->redoop}} = "REDO";
-               } else {
-                   $labels{$op->nextop->seq} = "NEXT";
-                   $labels{$op->lastop->seq} = "LAST";
-                   $labels{$op->redoop->seq} = "REDO";         
-               }
+               $labels{${$op->nextop}} = "NEXT";
+               $labels{${$op->lastop}} = "LAST";
+               $labels{${$op->redoop}} = "REDO";
            }
        }
     }
@@ -606,7 +599,7 @@ $priv{$_}{128} = "LVINTRO"
        "padav", "padhv", "enteriter", "entersub");
 $priv{$_}{64} = "REFC" for ("leave", "leavesub", "leavesublv", "leavewrite");
 $priv{"aassign"}{64} = "COMMON";
-$priv{"aassign"}{32} = $] < 5.009 ? "PHASH" : "STATE";
+$priv{"aassign"}{32} = "STATE";
 $priv{"sassign"}{32} = "STATE";
 $priv{"sassign"}{64} = "BKWARD";
 $priv{"sassign"}{128}= "CV2GV";
@@ -659,18 +652,14 @@ $priv{"exit"}{128} = "VMS";
 $priv{$_}{2} = "FTACCESS"
   for ("ftrread", "ftrwrite", "ftrexec", "fteread", "ftewrite", "fteexec");
 @{$priv{"entereval"}}{2,4,8,16} = qw "HAS_HH UNI BYTES COPHH";
-if ($] >= 5.009) {
-  # Stacked filetests are post 5.8.x
-  @{$priv{$_}}{4,8,16} = ("FTSTACKED","FTSTACKING","FTAFTERt")
-    for ("ftrread", "ftrwrite", "ftrexec", "fteread", "ftewrite", "fteexec",
-         "ftis", "fteowned", "ftrowned", "ftzero", "ftsize", "ftmtime",
-        "ftatime", "ftctime", "ftsock", "ftchr", "ftblk", "ftfile", "ftdir",
-        "ftpipe", "ftlink", "ftsuid", "ftsgid", "ftsvtx", "fttty", "fttext",
-        "ftbinary");
-  # Lexical $_ is post 5.8.x
-  $priv{$_}{2} = "GREPLEX"
-    for ("mapwhile", "mapstart", "grepwhile", "grepstart");
-}
+@{$priv{$_}}{4,8,16} = ("FTSTACKED","FTSTACKING","FTAFTERt")
+for ("ftrread", "ftrwrite", "ftrexec", "fteread", "ftewrite", "fteexec",
+     "ftis", "fteowned", "ftrowned", "ftzero", "ftsize", "ftmtime",
+     "ftatime", "ftctime", "ftsock", "ftchr", "ftblk", "ftfile", "ftdir",
+     "ftpipe", "ftlink", "ftsuid", "ftsgid", "ftsvtx", "fttty", "fttext",
+     "ftbinary");
+$priv{$_}{2} = "GREPLEX"
+for ("mapwhile", "mapstart", "grepwhile", "grepstart");
 $priv{$_}{128} = '+1' for qw "caller wantarray runcv";
 @{$priv{coreargs}}{1,2,64,128} = ('DREF1','DREF2','$MOD','MARK');
 $priv{$_}{128} = 'UTF' for qw "last redo next goto dump";
@@ -801,20 +790,16 @@ sub concise_op {
        if (defined $padname and class($padname) ne "SPECIAL") {
            $h{targarg}  = $padname->PVX;
            if ($padname->FLAGS & SVf_FAKE) {
-               if ($] < 5.009) {
-                   $h{targarglife} = "$h{targarg}:FAKE";
-               } else {
-                   # These changes relate to the jumbo closure fix.
-                   # See changes 19939 and 20005
-                   my $fake = '';
-                   $fake .= 'a'
-                       if $padname->PARENT_FAKELEX_FLAGS & PAD_FAKELEX_ANON;
-                   $fake .= 'm'
-                       if $padname->PARENT_FAKELEX_FLAGS & PAD_FAKELEX_MULTI;
-                   $fake .= ':' . $padname->PARENT_PAD_INDEX
-                       if $curcv->CvFLAGS & CVf_ANON;
-                   $h{targarglife} = "$h{targarg}:FAKE:$fake";
-               }
+               # These changes relate to the jumbo closure fix.
+               # See changes 19939 and 20005
+               my $fake = '';
+               $fake .= 'a'
+                   if $padname->PARENT_FAKELEX_FLAGS & PAD_FAKELEX_ANON;
+               $fake .= 'm'
+                   if $padname->PARENT_FAKELEX_FLAGS & PAD_FAKELEX_MULTI;
+               $fake .= ':' . $padname->PARENT_PAD_INDEX
+                   if $curcv->CvFLAGS & CVf_ANON;
+               $h{targarglife} = "$h{targarg}:FAKE:$fake";
            }
            else {
                my $intro = $padname->COP_SEQ_RANGE_LOW - $cop_seq_base;
@@ -899,13 +884,8 @@ sub concise_op {
     }
     $h{seq} = $h{hyphseq} = seq($op);
     $h{seq} = "" if $h{seq} eq "-";
-    if ($] > 5.009) {
-       $h{opt} = $op->opt;
-       $h{label} = $labels{$$op};
-    } else {
-       $h{seqnum} = $op->seq;
-       $h{label} = $labels{$op->seq};
-    }
+    $h{opt} = $op->opt;
+    $h{label} = $labels{$$op};
     $h{next} = $op->next;
     $h{next} = (class($h{next}) eq "NULL") ? "(end)" : seq($h{next});
     $h{nextaddr} = sprintf("%#x", $ {$op->next});
index de6530c..0a27e85 100644 (file)
@@ -24,13 +24,6 @@ my @names = qw(HEf_SVKEY
               SVTYPEMASK SVt_PVGV SVt_PVHV
               PAD_FAKELEX_ANON PAD_FAKELEX_MULTI);
 
-if ($] < 5.009) {
-    # Constant not present after 5.8.x
-    push @names, 'AVf_REAL';
-    # This is only present in 5.10, but it's useful to B::Deparse to be able
-    # to import a dummy value from B
-    push @names, {name=>"OPpPAD_STATE", default=>["IV", "0"]};
-}
 
 # First element in each tuple is the file; second is a regex snippet
 # giving the prefix to limit the names of symbols to define that come
index 8983d1c..18552f0 100644 (file)
@@ -657,14 +657,6 @@ sub mkCheckRex {
        $repl;
      }gem;
 
-    if ($] < 5.009) {
-       # add 5.8 private flags, which bleadperl (5.9.1) doesn't have/use/render
-       # works because it adds no wildcards, which are butchered below..
-        $str =~ s|(mapstart l?K\*?)|$1/2|mg;
-        $str =~ s|(grepstart l?K\*?)|$1/2|msg;
-        $str =~ s|(mapwhile.*? l?K)|$1/1|msg;
-       $str =~ s|(grepwhile.*? l?K)|$1/1|msg;
-    }
     $tc->{wantstr} = $str;
 
     # make targ args wild
@@ -707,26 +699,6 @@ sub mkCheckRex {
        [$1 . ($2 && ':{') . $4]xegm;   # change to the hints without open.pm
     }
 
-    if ($] < 5.009) {
-       # 5.8.x doesn't provide the hints in the OP, which means that
-       # B::Concise doesn't show the symbolic hints. So strip all the
-       # symbolic hints from the golden results.
-       $str =~ s[(                     # capture
-                  \(\?:next\|db\)state # the regexp matching next/db state
-                  .*                   # all sorts of things follow it
-                 v                     # The opening v
-                 )
-                 :(?:\\[{*]            # \{ or \*
-                     |[^,\\])          # or other symbols on their own
-                   (?:,
-                    (?:\\[{*]
-                       |[^,\\])
-                     )*                # maybe some more joined with commas
-               (\ ->[0-9a-z]+)?
-               $
-              ]
-       [$1$2]xgm;                      # change to the hints without flags
-    }
 
     # don't care about:
     $str =~ s/:-?\d+,-?\d+/:-?\\d+,-?\\d+/msg;         # FAKE line numbers
index eeb9f73..b44cf49 100644 (file)
@@ -146,7 +146,7 @@ my $testpkgs = {
                  formfeed end_av dowarn diehook defstash curstash
                  cstring comppadlist check_av cchar cast_I32 bootstrap
                  begin_av amagic_generation sub_generation address
-                 ), $] > 5.009 ? ('unitcheck_av') : ()],
+                 unitcheck_av) ],
     },
 
     B::Deparse => { dflt => 'perl',    # 236 functions
@@ -171,7 +171,7 @@ my $testpkgs = {
                     POSTFIX SVf_FAKE SVf_IOK SVf_NOK SVf_POK SVf_ROK
                     SVpad_OUR SVs_RMG SVs_SMG SWAP_CHILDREN OPpPAD_STATE
                     OPpCONST_ARYBASE OPpEVAL_BYTES OPpSUBSTR_REPL_FIRST
-                    /, $] > 5.009 ? ('RXf_SKIPWHITE') : ('PMf_SKIPWHITE'),
+                    RXf_SKIPWHITE /,
                    'CVf_LOCKED', # This ends up as a constant, pre or post 5.10
                    ],
                 },
@@ -218,7 +218,7 @@ my $testpkgs = {
                             new listen import getsockopt croak
                             connected connect configure confess close
                             carp bind atmark accept sockaddr_in6
-                            /, $] > 5.009 ? ('blocking') : () ],
+                            blocking/ ],
 
                    XS => [qw/ unpack_sockaddr_un unpack_sockaddr_in
                           sockatmark sockaddr_family pack_sockaddr_un
index 4e03beb..152d882 100644 (file)
@@ -687,10 +687,6 @@ EOT_EOT
 # b  <1> leavesub[1 ref] K/REFC,1
 EONT_EONT
 
-if($] < 5.009) {
-    # 5.8.x doesn't show the /STABLE flag, so massage the golden results.
-    s!/STABLE!!s foreach ($expect, $expect_nt);
-}
 
 checkOptree(note   => q{},
            bcopts => q{-exec},
index b04b290..8b292fe 100644 (file)
@@ -49,7 +49,6 @@ my $want = {  # expected types, how value renders in-line, todos (maybe)
     # these are not inlined, at least not per BC::Concise
     #myyes     => [ $RV_class, ],
     #myno      => [ $RV_class, ],
-    $] > 5.009 ? (
     myaref     => [ $RV_class, '\\\\' ],
     myfl       => [ 'NV', myfl ],
     myint      => [ 'IV', myint ],
@@ -59,13 +58,6 @@ my $want = { # expected types, how value renders in-line, todos (maybe)
     myrex      => [ $RV_class, '\\\\' ],
     ),
     myundef    => [ 'NULL', ],
-    ) : (
-    myaref     => [ 'PVIV', '' ],
-    myfl       => [ 'PVNV', myfl ],
-    myint      => [ 'PVIV', myint ],
-    myrex      => [ 'PVNV', '' ],
-    myundef    => [ 'PVIV', ],
-    )
 };
 
 use constant WEEKDAYS
@@ -196,10 +188,6 @@ EOT_EOT
 # 2        <0> padav[@list:FAKE:m:71] ->3
 EONT_EONT
 
-if($] < 5.009) {
-    # 5.8.x doesn't add the m flag to padav
-    s/FAKE:m:\d+/FAKE/ foreach ($expect, $expect_nt);
-}
 
 checkOptree ( name     => 'constant sub returning list',
              code      => \&WEEKDAYS,
@@ -249,13 +237,6 @@ EONT_EONT
 if($] < 5.015) {
     s/M(?=\*? ->)//g for $expect, $expect_nt;
 }
-if($] < 5.009) {
-    # 5.8.x's use constant has larger types
-    foreach ($expect, $expect_nt) {
-       s/IV 42/PV$&/;
-       s/NV 1.41/PV$&/;
-    }
-}
 
 checkOptree ( name     => 'call many in a print statement',
              code      => \&printem,
index 747a1ed..6bc081b 100644 (file)
@@ -135,11 +135,6 @@ my $nt = <<'EONT_EONT';
 # 6           <$> gvsv(*_) s ->7
 EONT_EONT
 
-if ($] < 5.009) {
-    $t =~ s/GV /BM /;
-    $nt =~ s/GV /BM /;
-} 
-
 checkOptree ( name      => 'index and PVBM',
              prog      => '$_ = index q(foo), q(foo)',
              strip_open_hints => 1,
index 567a905..3cf354c 100644 (file)
@@ -20,7 +20,7 @@ BEGIN {
 use OptreeCheck;       # ALSO DOES @ARGV HANDLING !!!!!!
 use Config;
 
-plan tests => 13 + ($] > 5.009 ? 2 : 0);
+plan tests => 15;
 
 require_ok("B::Concise");
 
@@ -34,16 +34,9 @@ my $out = runperl(
 my $src = q[our ($beg, $chk, $init, $end, $uc) = qq{'foo'}; BEGIN { $beg++ } CHECK { $chk++ } INIT { $init++ } END { $end++ } UNITCHECK {$uc++}];
 
 
-my @warnings_todo;
-@warnings_todo = (todo =>
-   "Change 23768 (Remove Carp from warnings.pm) alters expected output, not"
-   . "propagated to 5.8.x")
-    if $] < 5.009;
-
 checkOptree ( name     => 'BEGIN',
              bcopts    => 'BEGIN',
              prog      => $src,
-             @warnings_todo,
              strip_open_hints => 1,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # BEGIN 1:
@@ -193,12 +186,11 @@ EOT_EOT
 # 2              <$> gvsv(*chk) s ->3
 EONT_EONT
 
-if ($] >= 5.009) {
-    checkOptree ( name => 'UNITCHECK',
-                 bcopts=> 'UNITCHECK',
-                 prog  => $src,
-                 strip_open_hints => 1,
-                 expect=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
+checkOptree ( name     => 'UNITCHECK',
+             bcopts=> 'UNITCHECK',
+             prog      => $src,
+             strip_open_hints => 1,
+             expect=> <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # UNITCHECK 1:
 # 4  <1> leavesub[1 ref] K/REFC,1 ->(end)
 # -     <@> lineseq KP ->4
@@ -215,7 +207,6 @@ EOT_EOT
 # -           <1> ex-rv2sv sKRM/1 ->3
 # 2              <$> gvsv(*uc) s ->3
 EONT_EONT
-}
 
 checkOptree ( name     => 'INIT',
              bcopts    => 'INIT',
@@ -244,7 +235,6 @@ EONT_EONT
 checkOptree ( name     => 'all of BEGIN END INIT CHECK UNITCHECK -exec',
              bcopts    => [qw/ BEGIN END INIT CHECK UNITCHECK -exec /],
              prog      => $src,
-             @warnings_todo,
              strip_open_hints => 1,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # BEGIN 1:
@@ -374,7 +364,6 @@ EONT_EONT
 checkOptree ( name     => 'regression test for patch 25352',
              bcopts    => [qw/ BEGIN END INIT CHECK -exec /],
              prog      => 'print q/foo/',
-             @warnings_todo,
              expect    => <<'EOT_EOT', expect_nt => <<'EONT_EONT');
 # BEGIN 1:
 # 1  <;> nextstate(B::Concise -275 Concise.pm:356) v:*,&,{,x*,x&,x$,$
index 2ed390d..376de7c 100644 (file)
@@ -11,10 +11,6 @@ BEGIN {    ## no critic strict
         print "1..0 # Skip -- Perl configured without B module\n";
         exit 0;
     }
-    if ( $] < 5.009 ) {
-        print "1..0 # Skip -- No user pragmata in 5.8.x\n";
-        exit 0;
-    }
 }
 
 use strict;