summaryrefslogtreecommitdiff
path: root/dump.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-24 15:11:53 +0100
committerNicholas Clark <nick@ccl4.org>2011-06-11 09:52:56 +0200
commitc13a5c80de2334e935eada0927b9f5f7c862a45e (patch)
tree0c3f447e07e19ac968e711ec579a327c9090125f /dump.c
parent2bda37bab5fb768caff2b228fda376b75df4815c (diff)
downloadperl-c13a5c80de2334e935eada0927b9f5f7c862a45e.tar.gz
Store FBMs in PVMGs, instead of GVs.
This should reduce the complexity of code dealing with GVs, as they no longer try to play several different incompatible roles. (As suggested by Ben Morrow. However, it didn't turn out to be as straightforward as one might have hoped).
Diffstat (limited to 'dump.c')
-rw-r--r--dump.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/dump.c b/dump.c
index b541aa15be..c3c07b2bdf 100644
--- a/dump.c
+++ b/dump.c
@@ -1647,8 +1647,6 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
sv_catpv(d, " ),");
}
}
- if (SvTAIL(sv)) sv_catpv(d, "TAIL,");
- if (SvVALID(sv)) sv_catpv(d, "VALID,");
/* FALL THROUGH */
default:
evaled_or_uv:
@@ -1656,6 +1654,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
if (SvIsUV(sv) && !(flags & SVf_ROK)) sv_catpv(d, "IsUV,");
break;
case SVt_PVMG:
+ if (SvTAIL(sv)) sv_catpv(d, "TAIL,");
+ if (SvVALID(sv)) sv_catpv(d, "VALID,");
if (SvPAD_TYPED(sv)) sv_catpv(d, "TYPED,");
if (SvPAD_OUR(sv)) sv_catpv(d, "OUR,");
/* FALL THROUGH */
@@ -1798,6 +1798,12 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
}
if (SvSTASH(sv))
do_hv_dump(level, file, " STASH", SvSTASH(sv));
+
+ if ((type == SVt_PVMG || type == SVt_PVLV) && SvVALID(sv)) {
+ Perl_dump_indent(aTHX_ level, file, " RARE = %u\n", (U8)BmRARE(sv));
+ Perl_dump_indent(aTHX_ level, file, " PREVIOUS = %"UVuf"\n", (UV)BmPREVIOUS(sv));
+ Perl_dump_indent(aTHX_ level, file, " USEFUL = %"IVdf"\n", (IV)BmUSEFUL(sv));
+ }
}
/* Dump type-specific SV fields */
@@ -2089,11 +2095,6 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
do_sv_dump(level+1, file, LvTARG(sv), nest+1, maxnest,
dumpops, pvlim);
}
- if (SvVALID(sv)) {
- Perl_dump_indent(aTHX_ level, file, " RARE = %u\n", (U8)BmRARE(sv));
- Perl_dump_indent(aTHX_ level, file, " PREVIOUS = %"UVuf"\n", (UV)BmPREVIOUS(sv));
- Perl_dump_indent(aTHX_ level, file, " USEFUL = %"IVdf"\n", (IV)BmUSEFUL(sv));
- }
if (!isGV_with_GP(sv))
break;
Perl_dump_indent(aTHX_ level, file, " NAME = \"%s\"\n", GvNAME(sv));