more op_folded support: B, dump
authorReini Urban <rurban@x-ray.at>
Thu, 18 Jul 2013 19:50:35 +0000 (14:50 -0500)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 19 Jul 2013 17:11:00 +0000 (10:11 -0700)
also add more B::OP accessors for the missing bitfields

dump.c
ext/B/B.xs

diff --git a/dump.c b/dump.c
index 6ba4fd2..84d3eb8 100644 (file)
--- a/dump.c
+++ b/dump.c
@@ -861,6 +861,7 @@ S_op_private_to_names(pTHX_ SV *tmpsv, U32 optype, U32 op_private) {
         if (o->op_slabbed)  sv_catpvs(tmpsv, ",SLABBED");               \
         if (o->op_savefree) sv_catpvs(tmpsv, ",SAVEFREE");              \
         if (o->op_static)   sv_catpvs(tmpsv, ",STATIC");                \
+        if (o->op_folded)   sv_catpvs(tmpsv, ",FOLDED");                \
         if (!xml)                                                        \
             Perl_dump_indent(aTHX_ level, file, "FLAGS = (%s)\n",       \
                             SvCUR(tmpsv) ? SvPVX_const(tmpsv) + 1 : "");\
index e7049f0..20eeba8 100644 (file)
@@ -718,6 +718,14 @@ struct OP_methods {
     STR_WITH_LEN("warnings"),0,       -1,                                /*44*/
     STR_WITH_LEN("io"),      0,       -1,                                /*45*/
     STR_WITH_LEN("hints_hash"),0,     -1,                                /*46*/
+#if PERL_VERSION >= 17
+    STR_WITH_LEN("slabbed"), 0,       -1,                                /*47*/
+    STR_WITH_LEN("savefree"),0,       -1,                                /*48*/
+    STR_WITH_LEN("static"),  0,       -1,                                /*49*/
+#if PERL_VERSION >= 19
+    STR_WITH_LEN("folded"),  0,       -1,                                /*50*/
+#endif
+#endif
 };
 
 #include "const-c.inc"
@@ -989,6 +997,10 @@ next(o)
        B::COP::warnings     = 44
        B::COP::io           = 45
        B::COP::hints_hash   = 46
+       B::OP::slabbed       = 47
+       B::OP::savefree      = 48
+       B::OP::static        = 49
+       B::OP::folded        = 50
     PREINIT:
        char *ptr;
        SV *ret;
@@ -1064,10 +1076,22 @@ next(o)
            case 30: /* type  */
            case 31: /* opt   */
            case 32: /* spare */
-           /* These 3 are all bitfields, so we can't take their addresses */
+#if PERL_VERSION >= 17
+           case 47: /* slabbed  */
+           case 48: /* savefree */
+           case 49: /* static   */
+#if PERL_VERSION >= 19
+           case 50: /* folded   */
+#endif
+#endif
+           /* These are all bitfields, so we can't take their addresses */
                ret = sv_2mortal(newSVuv((UV)(
                                      ix == 30 ? o->op_type
                                    : ix == 31 ? o->op_opt
+                                   : ix == 47 ? o->op_slabbed
+                                   : ix == 48 ? o->op_savefree
+                                   : ix == 49 ? o->op_static
+                                   : ix == 50 ? o->op_folded
                                    :            o->op_spare)));
                break;
            case 33: /* children */