Replace direct flags tests & manipulations for SVpad_TYPED and
[p5sagit/p5-mst-13.2.git] / dump.c
diff --git a/dump.c b/dump.c
index 088e860..b63ad5c 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -89,7 +89,7 @@ Perl_dump_sub(pTHX_ const GV *gv)
 
     gv_fullname3(sv, gv, NULL);
     Perl_dump_indent(aTHX_ 0, Perl_debug_log, "\nSUB %s = ", SvPVX_const(sv));
-    if (CvXSUB(GvCV(gv)))
+    if (CvISXSUB(GvCV(gv)))
        Perl_dump_indent(aTHX_ 0, Perl_debug_log, "(xsub 0x%"UVxf" %d)\n",
            PTR2UV(CvXSUB(GvCV(gv))),
            (int)CvXSUBANY(GvCV(gv)).any_i32);
@@ -894,7 +894,6 @@ static const struct { const char type; const char *name; } magic_names[] = {
        { PERL_MAGIC_sv,             "sv(\\0)" },
        { PERL_MAGIC_arylen,         "arylen(#)" },
        { PERL_MAGIC_rhash,          "rhash(%)" },
-       { PERL_MAGIC_glob,           "glob(*)" },
        { PERL_MAGIC_pos,            "pos(.)" },
        { PERL_MAGIC_symtab,         "symtab(:)" },
        { PERL_MAGIC_backref,        "backref(<)" },
@@ -956,7 +955,6 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32
             else if (v == &PL_vtbl_dbline)     s = "dbline";
             else if (v == &PL_vtbl_isa)        s = "isa";
             else if (v == &PL_vtbl_arylen)     s = "arylen";
-            else if (v == &PL_vtbl_glob)       s = "glob";
             else if (v == &PL_vtbl_mglob)      s = "mglob";
             else if (v == &PL_vtbl_nkeys)      s = "nkeys";
             else if (v == &PL_vtbl_taint)      s = "taint";
@@ -1178,7 +1176,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        if (GvUNIQUE(sv))       sv_catpv(d, "UNIQUE,");
        if (GvASSUMECV(sv))     sv_catpv(d, "ASSUMECV,");
        if (GvIN_PAD(sv))       sv_catpv(d, "IN_PAD,");
-       if (flags & SVpad_OUR)  sv_catpv(d, "OUR,");
+       if (SvPAD_OUR(sv))      sv_catpv(d, "OUR,");
+       if (SvPAD_TYPED(sv))    sv_catpv(d, "TYPED,");
        if (GvIMPORTED(sv)) {
            sv_catpv(d, "IMPORT");
            if (GvIMPORTED(sv) == GVf_IMPORTED)
@@ -1202,8 +1201,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        if (SvVALID(sv))        sv_catpv(d, "VALID,");
        break;
     case SVt_PVMG:
-       if (flags & SVpad_TYPED)
-                               sv_catpv(d, "TYPED,");
+       if (SvPAD_TYPED(sv))    sv_catpv(d, "TYPED,");
        break;
     case SVt_PVAV:
        break;
@@ -1283,8 +1281,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        SvREFCNT_dec(d);
        return;
     }
-    if ((type >= SVt_PVIV && type != SVt_PVAV && type != SVt_PVHV)
-       || type == SVt_IV) {
+    if (type == SVt_IV || (type >= SVt_PVIV && type != SVt_PVAV
+                          && type != SVt_PVHV && type != SVt_PVCV)) {
        if (SvIsUV(sv)
 #ifdef PERL_OLD_COPY_ON_WRITE
                       || SvIsCOW(sv)
@@ -1303,7 +1301,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
 #endif
        PerlIO_putc(file, '\n');
     }
-    if ((type >= SVt_PVNV && type != SVt_PVAV && type != SVt_PVHV)
+    if ((type >= SVt_PVNV && type != SVt_PVAV && type != SVt_PVHV
+        && type != SVt_PVCV && type != SVt_PVFM)
        || type == SVt_NV) {
        STORE_NUMERIC_LOCAL_SET_STANDARD();
        /* %Vg doesn't work? --jhi */
@@ -1323,7 +1322,7 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        SvREFCNT_dec(d);
        return;
     }
-    if (type <= SVt_PVLV && type != SVt_PVGV) {
+    if (type <= SVt_PVLV) {
        if (SvPVX_const(sv)) {
            Perl_dump_indent(aTHX_ level, file,"  PV = 0x%"UVxf" ", PTR2UV(SvPVX_const(sv)));
            if (SvOOK(sv))
@@ -1486,15 +1485,22 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
        /* FALL THROUGH */
     case SVt_PVFM:
        do_hv_dump(level, file, "  COMP_STASH", CvSTASH(sv));
-       if (CvSTART(sv))
-           Perl_dump_indent(aTHX_ level, file, "  START = 0x%"UVxf" ===> %"IVdf"\n", PTR2UV(CvSTART(sv)), (IV)sequence_num(CvSTART(sv)));
-       Perl_dump_indent(aTHX_ level, file, "  ROOT = 0x%"UVxf"\n", PTR2UV(CvROOT(sv)));
-        if (CvROOT(sv) && dumpops)
-           do_op_dump(level+1, file, CvROOT(sv));
-       Perl_dump_indent(aTHX_ level, file, "  XSUB = 0x%"UVxf"\n", PTR2UV(CvXSUB(sv)));
-       {
+       if (!CvISXSUB(sv)) {
+           if (CvSTART(sv)) {
+               Perl_dump_indent(aTHX_ level, file,
+                                "  START = 0x%"UVxf" ===> %"IVdf"\n",
+                                PTR2UV(CvSTART(sv)),
+                                (IV)sequence_num(CvSTART(sv)));
+           }
+           Perl_dump_indent(aTHX_ level, file, "  ROOT = 0x%"UVxf"\n",
+                            PTR2UV(CvROOT(sv)));
+           if (CvROOT(sv) && dumpops) {
+               do_op_dump(level+1, file, CvROOT(sv));
+           }
+       } else {
            SV *constant = cv_const_sv((CV *)sv);
 
+           Perl_dump_indent(aTHX_ level, file, "  XSUB = 0x%"UVxf"\n", PTR2UV(CvXSUB(sv)));
 
            if (constant) {
                Perl_dump_indent(aTHX_ level, file, "  XSUBANY = 0x%"UVxf
@@ -1669,7 +1675,7 @@ Perl_debop(pTHX_ const OP *o)
             AV * const comppad = (AV*)(*av_fetch(padlist, 0, FALSE));
             sv = *av_fetch(comppad, o->op_targ, FALSE);
         } else
-            sv = Nullsv;
+            sv = NULL;
         if (sv)
            PerlIO_printf(Perl_debug_log, "(%s)", SvPV_nolen_const(sv));
         else
@@ -1695,7 +1701,7 @@ S_deb_curcv(pTHX_ I32 ix)
     else if (ix == 0 && PL_curstackinfo->si_type == PERLSI_MAIN)
         return PL_main_cv;
     else if (ix <= 0)
-        return Nullcv;
+        return NULL;
     else
         return deb_curcv(ix - 1);
 }