summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bytecode.pl7
-rw-r--r--cv.h7
-rw-r--r--doio.c4
-rw-r--r--dump.c16
-rw-r--r--ext/B/B.pm14
-rw-r--r--ext/B/B.xs50
-rw-r--r--ext/B/B/Asmdata.pm141
-rw-r--r--ext/B/B/Bytecode.pm15
-rw-r--r--ext/B/B/C.pm39
-rw-r--r--ext/B/B/Debug.pm14
-rw-r--r--ext/B/B/Deparse.pm2
-rw-r--r--ext/B/B/Lint.pm12
-rw-r--r--ext/B/B/Terse.pm5
-rw-r--r--ext/B/B/Xref.pm4
-rw-r--r--ext/B/typemap3
-rw-r--r--ext/ByteLoader/byterun.c159
-rw-r--r--ext/ByteLoader/byterun.h143
-rw-r--r--ext/Devel/Peek/Peek.pm1
-rw-r--r--gv.c18
-rw-r--r--gv.h5
-rw-r--r--lib/Time/Local.pm35
-rw-r--r--op.c84
-rw-r--r--op.h15
-rw-r--r--opcode.h6
-rwxr-xr-xopcode.pl8
-rw-r--r--perl.h2
-rw-r--r--pp_hot.c6
-rw-r--r--pp_sys.c10
-rw-r--r--regexec.c2
-rw-r--r--run.c4
-rw-r--r--sv.h6
31 files changed, 428 insertions, 409 deletions
diff --git a/bytecode.pl b/bytecode.pl
index 7d9b223f7c..326633e2fa 100644
--- a/bytecode.pl
+++ b/bytecode.pl
@@ -9,7 +9,7 @@ my %alias_to = (
U8 => [qw(char)],
);
-my @optype= qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP GVOP PVOP LOOP COP);
+my @optype= qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP);
# Nullsv *must* come first in the following so that the condition
# ($$sv == 0) can continue to be used to test (sv == Nullsv).
@@ -339,7 +339,6 @@ xcv_stash *(SV**)&CvSTASH(bytecode_sv) svindex
xcv_start CvSTART(bytecode_sv) opindex
xcv_root CvROOT(bytecode_sv) opindex
xcv_gv *(SV**)&CvGV(bytecode_sv) svindex
-xcv_filegv *(SV**)&CvFILEGV(bytecode_sv) svindex
xcv_depth CvDEPTH(bytecode_sv) long
xcv_padlist *(SV**)&CvPADLIST(bytecode_sv) svindex
xcv_outside *(SV**)&CvOUTSIDE(bytecode_sv) svindex
@@ -366,7 +365,7 @@ gp_refcnt_add GvREFCNT(bytecode_sv) I32 x
gp_av *(SV**)&GvAV(bytecode_sv) svindex
gp_hv *(SV**)&GvHV(bytecode_sv) svindex
gp_cv *(SV**)&GvCV(bytecode_sv) svindex
-gp_filegv *(SV**)&GvFILEGV(bytecode_sv) svindex
+gp_file GvFILE(bytecode_sv) pvcontents
gp_io *(SV**)&GvIOp(bytecode_sv) svindex
gp_form *(SV**)&GvFORM(bytecode_sv) svindex
gp_cvgen GvCVGEN(bytecode_sv) U32
@@ -393,7 +392,7 @@ pregcomp PL_op pvcontents x
op_pmflags cPMOP->op_pmflags U16
op_pmpermflags cPMOP->op_pmpermflags U16
op_sv cSVOP->op_sv svindex
-op_gv *(SV**)&cGVOP->op_gv svindex
+op_padix cPADOP->op_padix PADOFFSET
op_pv cPVOP->op_pv pvcontents
op_pv_tr cPVOP->op_pv op_tr_array
op_redoop cLOOP->op_redoop opindex
diff --git a/cv.h b/cv.h
index 67d4a8ef6e..b822eaae87 100644
--- a/cv.h
+++ b/cv.h
@@ -24,8 +24,10 @@ struct xpvcv {
void (*xcv_xsub) (pTHXo_ CV*);
ANY xcv_xsubany;
GV * xcv_gv;
- GV * xcv_filegv;
- long xcv_depth; /* >= 2 indicates recursive call */
+#if defined(PERL_BINCOMPAT_5005)
+ GV * xcv_filegv; /* XXX unused (and deprecated) */
+#endif
+ long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#ifdef USE_THREADS
@@ -43,7 +45,6 @@ struct xpvcv {
#define CvXSUB(sv) ((XPVCV*)SvANY(sv))->xcv_xsub
#define CvXSUBANY(sv) ((XPVCV*)SvANY(sv))->xcv_xsubany
#define CvGV(sv) ((XPVCV*)SvANY(sv))->xcv_gv
-#define CvFILEGV(sv) ((XPVCV*)SvANY(sv))->xcv_filegv
#define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xcv_depth
#define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist
#define CvOUTSIDE(sv) ((XPVCV*)SvANY(sv))->xcv_outside
diff --git a/doio.c b/doio.c
index 123815d2f4..d9fd6dfe35 100644
--- a/doio.c
+++ b/doio.c
@@ -1044,7 +1044,7 @@ Perl_my_stat(pTHX)
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
- tmpgv = cGVOP->op_gv;
+ tmpgv = (GV*)cSVOP->op_sv;
do_fstat:
io = GvIO(tmpgv);
if (io && IoIFP(io)) {
@@ -1097,7 +1097,7 @@ Perl_my_lstat(pTHX)
STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
EXTEND(SP,1);
- if (cGVOP->op_gv == PL_defgv) {
+ if ((GV*)cSVOP->op_sv == PL_defgv) {
if (PL_laststype != OP_LSTAT)
Perl_croak(aTHX_ "The stat preceding -l _ wasn't an lstat");
return PL_laststatval;
diff --git a/dump.c b/dump.c
index f2f75f0ca9..388100309d 100644
--- a/dump.c
+++ b/dump.c
@@ -512,11 +512,11 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
switch (o->op_type) {
case OP_GVSV:
case OP_GV:
- if (cGVOPo->op_gv) {
+ if (cSVOPo->op_sv) {
SV *tmpsv = NEWSV(0,0);
ENTER;
SAVEFREESV(tmpsv);
- gv_fullname3(tmpsv, cGVOPo->op_gv, Nullch);
+ gv_fullname3(tmpsv, (GV*)cSVOPo->op_sv, Nullch);
Perl_dump_indent(aTHX_ level, file, "GV = %s\n", SvPV(tmpsv, n_a));
LEAVE;
}
@@ -570,6 +570,15 @@ Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, OP *o)
case OP_SUBST:
do_pmop_dump(level, file, cPMOPo);
break;
+ case OP_LEAVE:
+ case OP_LEAVEEVAL:
+ case OP_LEAVESUB:
+ case OP_LEAVESUBLV:
+ case OP_LEAVEWRITE:
+ case OP_SCOPE:
+ if (o->op_private & OPpREFCOUNTED)
+ Perl_dump_indent(aTHX_ level, file, "REFCNT = %"UVuf"\n", (UV)o->op_targ);
+ break;
default:
break;
}
@@ -1059,7 +1068,6 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
Perl_dump_indent(aTHX_ level, file, " XSUB = 0x%"UVxf"\n", PTR2UV(CvXSUB(sv)));
Perl_dump_indent(aTHX_ level, file, " XSUBANY = %"IVdf"\n", (IV)CvXSUBANY(sv).any_i32);
do_gvgv_dump(level, file, " GVGV::GV", CvGV(sv));
- do_gv_dump(level, file, " FILEGV", CvFILEGV(sv));
Perl_dump_indent(aTHX_ level, file, " DEPTH = %"IVdf"\n", (IV)CvDEPTH(sv));
#ifdef USE_THREADS
Perl_dump_indent(aTHX_ level, file, " MUTEXP = 0x%"UVxf"\n", PTR2UV(CvMUTEXP(sv)));
@@ -1118,8 +1126,8 @@ Perl_do_sv_dump(pTHX_ I32 level, PerlIO *file, SV *sv, I32 nest, I32 maxnest, bo
Perl_dump_indent(aTHX_ level, file, " CVGEN = 0x%"UVxf"\n", (UV)GvCVGEN(sv));
Perl_dump_indent(aTHX_ level, file, " GPFLAGS = 0x%"UVxf"\n", (UV)GvGPFLAGS(sv));
Perl_dump_indent(aTHX_ level, file, " LINE = %"IVdf"\n", (IV)GvLINE(sv));
+ Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", GvFILE(sv));
Perl_dump_indent(aTHX_ level, file, " FLAGS = 0x%"UVxf"\n", (UV)GvFLAGS(sv));
- do_gv_dump (level, file, " FILEGV", GvFILEGV(sv));
do_gv_dump (level, file, " EGV", GvEGV(sv));
break;
case SVt_PVIO:
diff --git a/ext/B/B.pm b/ext/B/B.pm
index 2187e59a72..bc6d6cbe69 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -40,7 +40,7 @@ use strict;
@B::LOGOP::ISA = 'B::UNOP';
@B::LISTOP::ISA = 'B::BINOP';
@B::SVOP::ISA = 'B::OP';
-@B::GVOP::ISA = 'B::OP';
+@B::PADOP::ISA = 'B::OP';
@B::PVOP::ISA = 'B::OP';
@B::CVOP::ISA = 'B::OP';
@B::LOOP::ISA = 'B::LISTOP';
@@ -442,6 +442,8 @@ C<REFCNT> (corresponding to the C function C<SvREFCNT>).
=item LINE
+=item FILE
+
=item FILEGV
=item GvREFCNT
@@ -510,8 +512,6 @@ C<REFCNT> (corresponding to the C function C<SvREFCNT>).
=item GV
-=item FILEGV
-
=item DEPTH
=item PADLIST
@@ -549,7 +549,7 @@ C<REFCNT> (corresponding to the C function C<SvREFCNT>).
=head2 OP-RELATED CLASSES
B::OP, B::UNOP, B::BINOP, B::LOGOP, B::LISTOP, B::PMOP,
-B::SVOP, B::GVOP, B::PVOP, B::CVOP, B::LOOP, B::COP.
+B::SVOP, B::PADOP, B::PVOP, B::CVOP, B::LOOP, B::COP.
These classes correspond in
the obvious way to the underlying C structures of similar names. The
inheritance hierarchy mimics the underlying C "inheritance". Access
@@ -648,13 +648,15 @@ This returns the op description from the global C PL_op_desc array
=item sv
+=item gv
+
=back
-=head2 B::GVOP METHOD
+=head2 B::PADOP METHOD
=over 4
-=item gv
+=item padix
=back
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 2d6145da66..224354c850 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -56,7 +56,7 @@ typedef enum {
OPc_LISTOP, /* 5 */
OPc_PMOP, /* 6 */
OPc_SVOP, /* 7 */
- OPc_GVOP, /* 8 */
+ OPc_PADOP, /* 8 */
OPc_PVOP, /* 9 */
OPc_CVOP, /* 10 */
OPc_LOOP, /* 11 */
@@ -72,7 +72,7 @@ static char *opclassnames[] = {
"B::LISTOP",
"B::PMOP",
"B::SVOP",
- "B::GVOP",
+ "B::PADOP",
"B::PVOP",
"B::CVOP",
"B::LOOP",
@@ -117,8 +117,8 @@ cc_opclass(pTHX_ OP *o)
case OA_SVOP:
return OPc_SVOP;
- case OA_GVOP:
- return OPc_GVOP;
+ case OA_PADOP:
+ return OPc_PADOP;
case OA_PVOP_OR_SVOP:
/*
@@ -155,10 +155,10 @@ cc_opclass(pTHX_ OP *o)
* return OPc_UNOP so that walkoptree can find our children. If
* OPf_KIDS is not set then we check OPf_REF. Without OPf_REF set
* (no argument to the operator) it's an OP; with OPf_REF set it's
- * a GVOP (and op_gv is the GV for the filehandle argument).
+ * an SVOP (and op_sv is the GV for the filehandle argument).
*/
return ((o->op_flags & OPf_KIDS) ? OPc_UNOP :
- (o->op_flags & OPf_REF) ? OPc_GVOP : OPc_BASEOP);
+ (o->op_flags & OPf_REF) ? OPc_SVOP : OPc_BASEOP);
case OA_LOOPEXOP:
/*
@@ -345,7 +345,7 @@ typedef LOGOP *B__LOGOP;
typedef LISTOP *B__LISTOP;
typedef PMOP *B__PMOP;
typedef SVOP *B__SVOP;
-typedef GVOP *B__GVOP;
+typedef PADOP *B__PADOP;
typedef PVOP *B__PVOP;
typedef LOOP *B__LOOP;
typedef COP *B__COP;
@@ -575,7 +575,7 @@ char *
OP_desc(o)
B::OP o
-U16
+PADOFFSET
OP_targ(o)
B::OP o
@@ -680,22 +680,38 @@ PMOP_precomp(o)
sv_setpvn(ST(0), rx->precomp, rx->prelen);
#define SVOP_sv(o) o->op_sv
+#define SVOP_gv(o) ((SvTYPE(o->op_sv) == SVt_PVGV) \
+ ? (GV*)o->op_sv : Nullgv)
MODULE = B PACKAGE = B::SVOP PREFIX = SVOP_
-
B::SV
SVOP_sv(o)
B::SVOP o
-#define GVOP_gv(o) o->op_gv
+B::GV
+SVOP_gv(o)
+ B::SVOP o
-MODULE = B PACKAGE = B::GVOP PREFIX = GVOP_
+#define PADOP_padix(o) o->op_padix
+#define PADOP_sv(o) (o->op_padix ? PL_curpad[o->op_padix] : Nullsv)
+#define PADOP_gv(o) ((o->op_padix \
+ && SvTYPE(PL_curpad[o->op_padix]) == SVt_PVGV) \
+ ? (GV*)PL_curpad[o->op_padix] : Nullgv)
+MODULE = B PACKAGE = B::PADOP PREFIX = PADOP_
+
+PADOFFSET
+PADOP_padix(o)
+ B::PADOP o
+
+B::SV
+PADOP_sv(o)
+ B::PADOP o
B::GV
-GVOP_gv(o)
- B::GVOP o
+PADOP_gv(o)
+ B::PADOP o
MODULE = B PACKAGE = B::PVOP PREFIX = PVOP_
@@ -1012,6 +1028,10 @@ U16
GvLINE(gv)
B::GV gv
+char *
+GvFILE(gv)
+ B::GV gv
+
B::GV
GvFILEGV(gv)
B::GV gv
@@ -1133,10 +1153,6 @@ B::GV
CvGV(cv)
B::CV cv
-B::GV
-CvFILEGV(cv)
- B::CV cv
-
long
CvDEPTH(cv)
B::CV cv
diff --git a/ext/B/B/Asmdata.pm b/ext/B/B/Asmdata.pm
index 1d0e7eddaa..58d07c47d4 100644
--- a/ext/B/B/Asmdata.pm
+++ b/ext/B/B/Asmdata.pm
@@ -14,7 +14,7 @@ use Exporter;
@EXPORT_OK = qw(%insn_data @insn_name @optype @specialsv_name);
use vars qw(%insn_data @insn_name @optype @specialsv_name);
-@optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP GVOP PVOP LOOP COP);
+@optype = qw(OP UNOP BINOP LOGOP LISTOP PMOP SVOP PADOP PVOP LOOP COP);
@specialsv_name = qw(Nullsv &PL_sv_undef &PL_sv_yes &PL_sv_no);
# XXX insn_data is initialised this way because with a large
@@ -68,76 +68,75 @@ $insn_data{xcv_stash} = [44, \&PUT_svindex, "GET_svindex"];
$insn_data{xcv_start} = [45, \&PUT_opindex, "GET_opindex"];
$insn_data{xcv_root} = [46, \&PUT_opindex, "GET_opindex"];
$insn_data{xcv_gv} = [47, \&PUT_svindex, "GET_svindex"];
-$insn_data{xcv_filegv} = [48, \&PUT_svindex, "GET_svindex"];
-$insn_data{xcv_depth} = [49, \&PUT_I32, "GET_I32"];
-$insn_data{xcv_padlist} = [50, \&PUT_svindex, "GET_svindex"];
-$insn_data{xcv_outside} = [51, \&PUT_svindex, "GET_svindex"];
-$insn_data{xcv_flags} = [52, \&PUT_U8, "GET_U8"];
-$insn_data{av_extend} = [53, \&PUT_I32, "GET_I32"];
-$insn_data{av_push} = [54, \&PUT_svindex, "GET_svindex"];
-$insn_data{xav_fill} = [55, \&PUT_I32, "GET_I32"];
-$insn_data{xav_max} = [56, \&PUT_I32, "GET_I32"];
-$insn_data{xav_flags} = [57, \&PUT_U8, "GET_U8"];
-$insn_data{xhv_riter} = [58, \&PUT_I32, "GET_I32"];
-$insn_data{xhv_name} = [59, \&PUT_pvcontents, "GET_pvcontents"];
-$insn_data{hv_store} = [60, \&PUT_svindex, "GET_svindex"];
-$insn_data{sv_magic} = [61, \&PUT_U8, "GET_U8"];
-$insn_data{mg_obj} = [62, \&PUT_svindex, "GET_svindex"];
-$insn_data{mg_private} = [63, \&PUT_U16, "GET_U16"];
-$insn_data{mg_flags} = [64, \&PUT_U8, "GET_U8"];
-$insn_data{mg_pv} = [65, \&PUT_pvcontents, "GET_pvcontents"];
-$insn_data{xmg_stash} = [66, \&PUT_svindex, "GET_svindex"];
-$insn_data{gv_fetchpv} = [67, \&PUT_strconst, "GET_strconst"];
-$insn_data{gv_stashpv} = [68, \&PUT_strconst, "GET_strconst"];
-$insn_data{gp_sv} = [69, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_refcnt} = [70, \&PUT_U32, "GET_U32"];
-$insn_data{gp_refcnt_add} = [71, \&PUT_I32, "GET_I32"];
-$insn_data{gp_av} = [72, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_hv} = [73, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_cv} = [74, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_filegv} = [75, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_io} = [76, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_form} = [77, \&PUT_svindex, "GET_svindex"];
-$insn_data{gp_cvgen} = [78, \&PUT_U32, "GET_U32"];
-$insn_data{gp_line} = [79, \&PUT_U16, "GET_U16"];
-$insn_data{gp_share} = [80, \&PUT_svindex, "GET_svindex"];
-$insn_data{xgv_flags} = [81, \&PUT_U8, "GET_U8"];
-$insn_data{op_next} = [82, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_sibling} = [83, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_ppaddr} = [84, \&PUT_strconst, "GET_strconst"];
-$insn_data{op_targ} = [85, \&PUT_U32, "GET_U32"];
-$insn_data{op_type} = [86, \&PUT_U16, "GET_U16"];
-$insn_data{op_seq} = [87, \&PUT_U16, "GET_U16"];
-$insn_data{op_flags} = [88, \&PUT_U8, "GET_U8"];
-$insn_data{op_private} = [89, \&PUT_U8, "GET_U8"];
-$insn_data{op_first} = [90, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_last} = [91, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_other} = [92, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_children} = [93, \&PUT_U32, "GET_U32"];
-$insn_data{op_pmreplroot} = [94, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_pmreplrootgv} = [95, \&PUT_svindex, "GET_svindex"];
-$insn_data{op_pmreplstart} = [96, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_pmnext} = [97, \&PUT_opindex, "GET_opindex"];
-$insn_data{pregcomp} = [98, \&PUT_pvcontents, "GET_pvcontents"];
-$insn_data{op_pmflags} = [99, \&PUT_U16, "GET_U16"];
-$insn_data{op_pmpermflags} = [100, \&PUT_U16, "GET_U16"];
-$insn_data{op_sv} = [101, \&PUT_svindex, "GET_svindex"];
-$insn_data{op_gv} = [102, \&PUT_svindex, "GET_svindex"];
-$insn_data{op_pv} = [103, \&PUT_pvcontents, "GET_pvcontents"];
-$insn_data{op_pv_tr} = [104, \&PUT_op_tr_array, "GET_op_tr_array"];
-$insn_data{op_redoop} = [105, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_nextop} = [106, \&PUT_opindex, "GET_opindex"];
-$insn_data{op_lastop} = [107, \&PUT_opindex, "GET_opindex"];
-$insn_data{cop_label} = [108, \&PUT_pvcontents, "GET_pvcontents"];
-$insn_data{cop_stash} = [109, \&PUT_svindex, "GET_svindex"];
-$insn_data{cop_filegv} = [110, \&PUT_svindex, "GET_svindex"];
-$insn_data{cop_seq} = [111, \&PUT_U32, "GET_U32"];
-$insn_data{cop_arybase} = [112, \&PUT_I32, "GET_I32"];
-$insn_data{cop_line} = [113, \&PUT_U16, "GET_U16"];
-$insn_data{cop_warnings} = [114, \&PUT_svindex, "GET_svindex"];
-$insn_data{main_start} = [115, \&PUT_opindex, "GET_opindex"];
-$insn_data{main_root} = [116, \&PUT_opindex, "GET_opindex"];
-$insn_data{curpad} = [117, \&PUT_svindex, "GET_svindex"];
+$insn_data{xcv_depth} = [48, \&PUT_I32, "GET_I32"];
+$insn_data{xcv_padlist} = [49, \&PUT_svindex, "GET_svindex"];
+$insn_data{xcv_outside} = [50, \&PUT_svindex, "GET_svindex"];
+$insn_data{xcv_flags} = [51, \&PUT_U8, "GET_U8"];
+$insn_data{av_extend} = [52, \&PUT_I32, "GET_I32"];
+$insn_data{av_push} = [53, \&PUT_svindex, "GET_svindex"];
+$insn_data{xav_fill} = [54, \&PUT_I32, "GET_I32"];
+$insn_data{xav_max} = [55, \&PUT_I32, "GET_I32"];
+$insn_data{xav_flags} = [56, \&PUT_U8, "GET_U8"];
+$insn_data{xhv_riter} = [57, \&PUT_I32, "GET_I32"];
+$insn_data{xhv_name} = [58, \&PUT_pvcontents, "GET_pvcontents"];
+$insn_data{hv_store} = [59, \&PUT_svindex, "GET_svindex"];
+$insn_data{sv_magic} = [60, \&PUT_U8, "GET_U8"];
+$insn_data{mg_obj} = [61, \&PUT_svindex, "GET_svindex"];
+$insn_data{mg_private} = [62, \&PUT_U16, "GET_U16"];
+$insn_data{mg_flags} = [63, \&PUT_U8, "GET_U8"];
+$insn_data{mg_pv} = [64, \&PUT_pvcontents, "GET_pvcontents"];
+$insn_data{xmg_stash} = [65, \&PUT_svindex, "GET_svindex"];
+$insn_data{gv_fetchpv} = [66, \&PUT_strconst, "GET_strconst"];
+$insn_data{gv_stashpv} = [67, \&PUT_strconst, "GET_strconst"];
+$insn_data{gp_sv} = [68, \&PUT_svindex, "GET_svindex"];
+$insn_data{gp_refcnt} = [69, \&PUT_U32, "GET_U32"];
+$insn_data{gp_refcnt_add} = [70, \&PUT_I32, "GET_I32"];
+$insn_data{gp_av} = [71, \&PUT_svindex, "GET_svindex"];
+$insn_data{gp_hv} = [72, \&PUT_svindex, "GET_svindex"];
+$insn_data{gp_cv} = [73, \&PUT_svindex, "GET_svindex"];
+$insn_data{gp_file} = [74, \&PUT_pvcontents, "GET_pvcontents"];
+$insn_data{gp_io} = [75, \&PUT_svindex, "GET_svindex"];
+$insn_data{gp_form} = [76, \&PUT_svindex, "GET_svindex"];
+$insn_data{gp_cvgen} = [77, \&PUT_U32, "GET_U32"];
+$insn_data{gp_line} = [78, \&PUT_U16, "GET_U16"];
+$insn_data{gp_share} = [79, \&PUT_svindex, "GET_svindex"];
+$insn_data{xgv_flags} = [80, \&PUT_U8, "GET_U8"];
+$insn_data{op_next} = [81, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_sibling} = [82, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_ppaddr} = [83, \&PUT_strconst, "GET_strconst"];
+$insn_data{op_targ} = [84, \&PUT_U32, "GET_U32"];
+$insn_data{op_type} = [85, \&PUT_U16, "GET_U16"];
+$insn_data{op_seq} = [86, \&PUT_U16, "GET_U16"];
+$insn_data{op_flags} = [87, \&PUT_U8, "GET_U8"];
+$insn_data{op_private} = [88, \&PUT_U8, "GET_U8"];
+$insn_data{op_first} = [89, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_last} = [90, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_other} = [91, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_children} = [92, \&PUT_U32, "GET_U32"];
+$insn_data{op_pmreplroot} = [93, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_pmreplrootgv} = [94, \&PUT_svindex, "GET_svindex"];
+$insn_data{op_pmreplstart} = [95, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_pmnext} = [96, \&PUT_opindex, "GET_opindex"];
+$insn_data{pregcomp} = [97, \&PUT_pvcontents, "GET_pvcontents"];
+$insn_data{op_pmflags} = [98, \&PUT_U16, "GET_U16"];
+$insn_data{op_pmpermflags} = [99, \&PUT_U16, "GET_U16"];
+$insn_data{op_sv} = [100, \&PUT_svindex, "GET_svindex"];
+$insn_data{op_padix} = [101, \&PUT_U32, "GET_U32"];
+$insn_data{op_pv} = [102, \&PUT_pvcontents, "GET_pvcontents"];
+$insn_data{op_pv_tr} = [103, \&PUT_op_tr_array, "GET_op_tr_array"];
+$insn_data{op_redoop} = [104, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_nextop} = [105, \&PUT_opindex, "GET_opindex"];
+$insn_data{op_lastop} = [106, \&PUT_opindex, "GET_opindex"];
+$insn_data{cop_label} = [107, \&PUT_pvcontents, "GET_pvcontents"];
+$insn_data{cop_stash} = [108, \&PUT_svindex, "GET_svindex"];
+$insn_data{cop_filegv} = [109, \&PUT_svindex, "GET_svindex"];
+$insn_data{cop_seq} = [110, \&PUT_U32, "GET_U32"];
+$insn_data{cop_arybase} = [111, \&PUT_I32, "GET_I32"];
+$insn_data{cop_line} = [112, \&PUT_U16, "GET_U16"];
+$insn_data{cop_warnings} = [113, \&PUT_svindex, "GET_svindex"];
+$insn_data{main_start} = [114, \&PUT_opindex, "GET_opindex"];
+$insn_data{main_root} = [115, \&PUT_opindex, "GET_opindex"];
+$insn_data{curpad} = [116, \&PUT_svindex, "GET_svindex"];
my ($insn_name, $insn_data);
while (($insn_name, $insn_data) = each %insn_data) {
diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm
index 56945316e8..9cad99b53c 100644
--- a/ext/B/B/Bytecode.pm
+++ b/ext/B/B/Bytecode.pm
@@ -226,13 +226,11 @@ sub B::SVOP::bytecode {
$sv->bytecode;
}
-sub B::GVOP::bytecode {
+sub B::PADOP::bytecode {
my $op = shift;
- my $gv = $op->gv;
- my $gvix = $gv->objix;
+ my $padix = $op->padix;
$op->B::OP::bytecode;
- print "op_gv $gvix\n";
- $gv->bytecode;
+ print "op_padix $padix\n";
}
sub B::PVOP::bytecode {
@@ -472,10 +470,11 @@ sub B::GV::bytecode {
my $egv = $gv->EGV;
my $egvix = $egv->objix;
ldsv($ix);
- printf <<"EOT", $gv->FLAGS, $gv->GvFLAGS, $gv->LINE;
+ printf <<"EOT", $gv->FLAGS, $gv->GvFLAGS, $gv->LINE, cstring($gv->FILE);
sv_flags 0x%x
xgv_flags 0x%x
gp_line %d
+gp_file %s
EOT
my $refcnt = $gv->REFCNT;
printf("sv_refcnt_add %d\n", $refcnt - 1) if $refcnt > 1;
@@ -486,7 +485,7 @@ EOT
} else {
if ($gvname !~ /^([^A-Za-z]|STDIN|STDOUT|STDERR|ARGV|SIG|ENV)$/) {
my $i;
- my @subfield_names = qw(SV AV HV CV FILEGV FORM IO);
+ my @subfield_names = qw(SV AV HV CV FORM IO);
my @subfields = map($gv->$_(), @subfield_names);
my @ixes = map($_->objix, @subfields);
# Reset sv register for $gv
@@ -569,7 +568,7 @@ sub B::CV::bytecode {
my $ix = $cv->objix;
$cv->B::PVMG::bytecode;
my $i;
- my @subfield_names = qw(ROOT START STASH GV FILEGV PADLIST OUTSIDE);
+ my @subfield_names = qw(ROOT START STASH GV PADLIST OUTSIDE);
my @subfields = map($cv->$_(), @subfield_names);
my @ixes = map($_->objix, @subfields);
# Save OP tree from CvROOT (first element of @subfields)
diff --git a/ext/B/B/C.pm b/ext/B/B/C.pm
index b57d1ad2b3..f3318212b8 100644
--- a/ext/B/B/C.pm
+++ b/ext/B/B/C.pm
@@ -83,7 +83,7 @@ BEGIN {
# Code sections
my ($init, $decl, $symsect, $binopsect, $condopsect, $copsect,
- $gvopsect, $listopsect, $logopsect, $loopsect, $opsect, $pmopsect,
+ $padopsect, $listopsect, $logopsect, $loopsect, $opsect, $pmopsect,
$pvopsect, $svopsect, $unopsect, $svsect, $xpvsect, $xpvavsect,
$xpvhvsect, $xpvcvsect, $xpvivsect, $xpvnvsect, $xpvmgsect, $xpvlvsect,
$xrvsect, $xpvbmsect, $xpviosect );
@@ -276,17 +276,17 @@ sub B::SVOP::save {
savesym($op, sprintf("(OP*)&svop_list[%d]", $svopsect->index));
}
-sub B::GVOP::save {
+sub B::PADOP::save {
my ($op, $level) = @_;
my $sym = objsym($op);
return $sym if defined $sym;
- my $gvsym = $op->gv->save;
- $gvopsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, Nullgv",
+ $padopsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, Nullgv",
${$op->next}, ${$op->sibling}, $op->ppaddr,
$op->targ, $op->type, $op_seq, $op->flags,
$op->private));
- $init->add(sprintf("gvop_list[%d].op_gv = %s;", $gvopsect->index, $gvsym));
- savesym($op, sprintf("(OP*)&gvop_list[%d]", $gvopsect->index));
+ $init->add(sprintf("padop_list[%d].op_padix = %ld;",
+ $padopsect->index, $op->padix));
+ savesym($op, sprintf("(OP*)&padop_list[%d]", $padopsect->index));
}
sub B::COP::save {
@@ -610,7 +610,7 @@ sub B::CV::save {
my $stashname = $egv->STASH->NAME;
if ($cvname eq "bootstrap")
{
- my $file = $cv->FILEGV->SV->PV;
+ my $file = $gv->FILE;
$decl->add("/* bootstrap $file */");
warn "Bootstrap $stashname $file\n";
$xsub{$stashname}='Dynamic';
@@ -700,13 +700,6 @@ sub B::CV::save {
warn sprintf("done saving GV 0x%x for CV 0x%x\n",
$$gv, $$cv) if $debug_cv;
}
- my $filegv = $cv->FILEGV;
- if ($$filegv) {
- $filegv->save;
- $init->add(sprintf("CvFILEGV(s\\_%x) = s\\_%x;", $$cv, $$filegv));
- warn sprintf("done saving FILEGV 0x%x for CV 0x%x\n",
- $$filegv, $$cv) if $debug_cv;
- }
my $stash = $cv->STASH;
if ($$stash) {
$stash->save;
@@ -793,12 +786,8 @@ sub B::GV::save {
# warn "GV::save &$name\n"; # debug
}
}
- my $gvfilegv = $gv->FILEGV;
- if ($$gvfilegv) {
- $gvfilegv->save;
- $init->add(sprintf("GvFILEGV($sym) = (GV*)s\\_%x;",$$gvfilegv));
-# warn "GV::save GvFILEGV(*$name)\n"; # debug
- }
+ $init->add(sprintf("GvFILE($sym) = %s;", cstring($gv->FILE)));
+# warn "GV::save GvFILE(*$name)\n"; # debug
my $gvform = $gv->FORM;
if ($$gvform) {
$gvform->save;
@@ -951,7 +940,7 @@ sub output_all {
my $init_name = shift;
my $section;
my @sections = ($opsect, $unopsect, $binopsect, $logopsect, $condopsect,
- $listopsect, $pmopsect, $svopsect, $gvopsect, $pvopsect,
+ $listopsect, $pmopsect, $svopsect, $padopsect, $pvopsect,
$loopsect, $copsect, $svsect, $xpvsect,
$xpvavsect, $xpvhvsect, $xpvcvsect, $xpvivsect, $xpvnvsect,
$xpvmgsect, $xpvlvsect, $xrvsect, $xpvbmsect, $xpviosect);
@@ -1022,8 +1011,10 @@ typedef struct {
void (*xcv_xsub) (CV*);
void * xcv_xsubany;
GV * xcv_gv;
- GV * xcv_filegv;
- long xcv_depth; /* >= 2 indicates recursive call */
+#if defined(PERL_BINCOMPAT_5005)
+ GV * xcv_filegv; /* XXX unused (and deprecated) */
+#endif
+ long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#ifdef USE_THREADS
@@ -1399,7 +1390,7 @@ sub save_main {
sub init_sections {
my @sections = (init => \$init, decl => \$decl, sym => \$symsect,
binop => \$binopsect, condop => \$condopsect,
- cop => \$copsect, gvop => \$gvopsect,
+ cop => \$copsect, padop => \$padopsect,
listop => \$listopsect, logop => \$logopsect,
loop => \$loopsect, op => \$opsect, pmop => \$pmopsect,
pvop => \$pvopsect, svop => \$svopsect, unop => \$unopsect,
diff --git a/ext/B/B/Debug.pm b/ext/B/B/Debug.pm
index 89100689a8..732169f630 100644
--- a/ext/B/B/Debug.pm
+++ b/ext/B/B/Debug.pm
@@ -86,11 +86,10 @@ sub B::PVOP::debug {
printf "\top_pv\t\t0x%x\n", $op->pv;
}
-sub B::GVOP::debug {
+sub B::PADOP::debug {
my ($op) = @_;
$op->B::OP::debug();
- printf "\top_gv\t\t0x%x\n", ${$op->gv};
- $op->gv->debug;
+ printf "\top_padix\t\t%ld\n", $op->padix;
}
sub B::CVOP::debug {
@@ -179,13 +178,11 @@ sub B::CV::debug {
my ($root) = $sv->ROOT;
my ($padlist) = $sv->PADLIST;
my ($gv) = $sv->GV;
- my ($filegv) = $sv->FILEGV;
- printf <<'EOT', $$stash, $$start, $$root, $$gv, $$filegv, $sv->DEPTH, $padlist, ${$sv->OUTSIDE};
+ printf <<'EOT', $$stash, $$start, $$root, $$gv, $sv->DEPTH, $padlist, ${$sv->OUTSIDE};
STASH 0x%x
START 0x%x
ROOT 0x%x
GV 0x%x
- FILEGV 0x%x
DEPTH %d
PADLIST 0x%x
OUTSIDE 0x%x
@@ -193,7 +190,6 @@ EOT
$start->debug if $start;
$root->debug if $root;
$gv->debug if $gv;
- $filegv->debug if $filegv;
$padlist->debug if $padlist;
}
@@ -220,7 +216,7 @@ sub B::GV::debug {
my ($av) = $gv->AV;
my ($cv) = $gv->CV;
$gv->B::SV::debug;
- printf <<'EOT', $gv->NAME, $gv->STASH->NAME, $gv->STASH, $$sv, $gv->GvREFCNT, $gv->FORM, $$av, ${$gv->HV}, ${$gv->EGV}, $$cv, $gv->CVGEN, $gv->LINE, $gv->FILEGV, $gv->GvFLAGS;
+ printf <<'EOT', $gv->NAME, $gv->STASH->NAME, $gv->STASH, $$sv, $gv->GvREFCNT, $gv->FORM, $$av, ${$gv->HV}, ${$gv->EGV}, $$cv, $gv->CVGEN, $gv->LINE, $gv->FILE, $gv->GvFLAGS;
NAME %s
STASH %s (0x%x)
SV 0x%x
@@ -232,7 +228,7 @@ sub B::GV::debug {
CV 0x%x
CVGEN %d
LINE %d
- FILEGV 0x%x
+ FILE %s
GvFLAGS 0x%x
EOT
$sv->debug if $sv;
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index ede68f5a8d..c5d3ce9504 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -1109,7 +1109,7 @@ sub ftst {
# Genuine `-X' filetests are exempt from the LLAFR, but not
# l?stat(); for the sake of clarity, give'em all parens
return $self->maybe_parens_unop($name, $op->first, $cx);
- } elsif (class($op) eq "GVOP") {
+ } elsif (class($op) eq "SVOP") {
return $self->maybe_parens_func($name, $self->pp_gv($op, 1), $cx, 16);
} else { # I don't think baseop filetests ever survive ck_ftst, but...
return $name;
diff --git a/ext/B/B/Lint.pm b/ext/B/B/Lint.pm
index 67abe3d145..3a4714226e 100644
--- a/ext/B/B/Lint.pm
+++ b/ext/B/B/Lint.pm
@@ -232,7 +232,7 @@ sub B::LOOP::lint {
}
}
-sub B::GVOP::lint {
+sub B::SVOP::lint {
my $op = shift;
if ($check{dollar_underscore} && $op->name eq "gvsv"
&& $op->gv->NAME eq "_")
@@ -241,11 +241,11 @@ sub B::GVOP::lint {
}
if ($check{private_names}) {
my $opname = $op->name;
- my $gv = $op->gv;
- if (($opname eq "gv" || $opname eq "gvsv")
- && $gv->NAME =~ /^_./ && $gv->STASH->NAME ne $curstash)
- {
- warning('Illegal reference to private name %s', $gv->NAME);
+ if (($opname eq "gv" || $opname eq "gvsv") {
+ my $gv = $op->gv;
+ if ($gv->NAME =~ /^_./ && $gv->STASH->NAME ne $curstash) {
+ warning('Illegal reference to private name %s', $gv->NAME);
+ }
}
}
if ($check{undefined_subs}) {
diff --git a/ext/B/B/Terse.pm b/ext/B/B/Terse.pm
index bc9d9434c9..66b5cfc2f2 100644
--- a/ext/B/B/Terse.pm
+++ b/ext/B/B/Terse.pm
@@ -54,10 +54,9 @@ sub B::SVOP::terse {
$op->sv->terse(0);
}
-sub B::GVOP::terse {
+sub B::PADOP::terse {
my ($op, $level) = @_;
- print indent($level), peekop($op), " ";
- $op->gv->terse(0);
+ print indent($level), peekop($op), " ", $op->padix, "\n";
}
sub B::PMOP::terse {
diff --git a/ext/B/B/Xref.pm b/ext/B/B/Xref.pm
index 06159a43c3..f7cd64926d 100644
--- a/ext/B/B/Xref.pm
+++ b/ext/B/B/Xref.pm
@@ -272,7 +272,7 @@ sub B::GV::xref {
my $cv = $gv->CV;
if ($$cv) {
#return if $done{$$cv}++;
- $file = $gv->FILEGV->SV->PV;
+ $file = $gv->FILE;
$line = $gv->LINE;
process([$gv->STASH->NAME, "&", $gv->NAME], "subdef");
push(@todo, $cv);
@@ -280,7 +280,7 @@ sub B::GV::xref {
my $form = $gv->FORM;
if ($$form) {
return if $done{$$form}++;
- $file = $gv->FILEGV->SV->PV;
+ $file = $gv->FILE;
$line = $gv->LINE;
process([$gv->STASH->NAME, "", $gv->NAME], "formdef");
}
diff --git a/ext/B/typemap b/ext/B/typemap
index febadf8d62..bafba1c8e4 100644
--- a/ext/B/typemap
+++ b/ext/B/typemap
@@ -7,7 +7,7 @@ B::LOGOP T_OP_OBJ
B::LISTOP T_OP_OBJ
B::PMOP T_OP_OBJ
B::SVOP T_OP_OBJ
-B::GVOP T_OP_OBJ
+B::PADOP T_OP_OBJ
B::PVOP T_OP_OBJ
B::CVOP T_OP_OBJ
B::LOOP T_OP_OBJ
@@ -30,6 +30,7 @@ B::IO T_SV_OBJ
B::MAGIC T_MG_OBJ
SSize_t T_IV
STRLEN T_IV
+PADOFFSET T_UV
INPUT
T_OP_OBJ
diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c
index 60dc98d3cc..264cb01e6a 100644
--- a/ext/ByteLoader/byterun.c
+++ b/ext/ByteLoader/byterun.c
@@ -34,7 +34,7 @@ static int optype_size[] = {
sizeof(LISTOP),
sizeof(PMOP),
sizeof(SVOP),
- sizeof(GVOP),
+ sizeof(PADOP),
sizeof(PVOP),
sizeof(LOOP),
sizeof(COP)
@@ -401,490 +401,483 @@ byterun(pTHXo_ struct bytestream bs)
*(SV**)&CvGV(bytecode_sv) = arg;
break;
}
- case INSN_XCV_FILEGV: /* 48 */
- {
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&CvFILEGV(bytecode_sv) = arg;
- break;
- }
- case INSN_XCV_DEPTH: /* 49 */
+ case INSN_XCV_DEPTH: /* 48 */
{
long arg;
BGET_I32(arg);
CvDEPTH(bytecode_sv) = arg;
break;
}
- case INSN_XCV_PADLIST: /* 50 */
+ case INSN_XCV_PADLIST: /* 49 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&CvPADLIST(bytecode_sv) = arg;
break;
}
- case INSN_XCV_OUTSIDE: /* 51 */
+ case INSN_XCV_OUTSIDE: /* 50 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&CvOUTSIDE(bytecode_sv) = arg;
break;
}
- case INSN_XCV_FLAGS: /* 52 */
+ case INSN_XCV_FLAGS: /* 51 */
{
U8 arg;
BGET_U8(arg);
CvFLAGS(bytecode_sv) = arg;
break;
}
- case INSN_AV_EXTEND: /* 53 */
+ case INSN_AV_EXTEND: /* 52 */
{
SSize_t arg;
BGET_I32(arg);
BSET_av_extend(bytecode_sv, arg);
break;
}
- case INSN_AV_PUSH: /* 54 */
+ case INSN_AV_PUSH: /* 53 */
{
svindex arg;
BGET_svindex(arg);
BSET_av_push(bytecode_sv, arg);
break;
}
- case INSN_XAV_FILL: /* 55 */
+ case INSN_XAV_FILL: /* 54 */
{
SSize_t arg;
BGET_I32(arg);
AvFILLp(bytecode_sv) = arg;
break;
}
- case INSN_XAV_MAX: /* 56 */
+ case INSN_XAV_MAX: /* 55 */
{
SSize_t arg;
BGET_I32(arg);
AvMAX(bytecode_sv) = arg;
break;
}
- case INSN_XAV_FLAGS: /* 57 */
+ case INSN_XAV_FLAGS: /* 56 */
{
U8 arg;
BGET_U8(arg);
AvFLAGS(bytecode_sv) = arg;
break;
}
- case INSN_XHV_RITER: /* 58 */
+ case INSN_XHV_RITER: /* 57 */
{
I32 arg;
BGET_I32(arg);
HvRITER(bytecode_sv) = arg;
break;
}
- case INSN_XHV_NAME: /* 59 */
+ case INSN_XHV_NAME: /* 58 */
{
pvcontents arg;
BGET_pvcontents(arg);
HvNAME(bytecode_sv) = arg;
break;
}
- case INSN_HV_STORE: /* 60 */
+ case INSN_HV_STORE: /* 59 */
{
svindex arg;
BGET_svindex(arg);
BSET_hv_store(bytecode_sv, arg);
break;
}
- case INSN_SV_MAGIC: /* 61 */
+ case INSN_SV_MAGIC: /* 60 */
{
char arg;
BGET_U8(arg);
BSET_sv_magic(bytecode_sv, arg);
break;
}
- case INSN_MG_OBJ: /* 62 */
+ case INSN_MG_OBJ: /* 61 */
{
svindex arg;
BGET_svindex(arg);
SvMAGIC(bytecode_sv)->mg_obj = arg;
break;
}
- case INSN_MG_PRIVATE: /* 63 */
+ case INSN_MG_PRIVATE: /* 62 */
{
U16 arg;
BGET_U16(arg);
SvMAGIC(bytecode_sv)->mg_private = arg;
break;
}
- case INSN_MG_FLAGS: /* 64 */
+ case INSN_MG_FLAGS: /* 63 */
{
U8 arg;
BGET_U8(arg);
SvMAGIC(bytecode_sv)->mg_flags = arg;
break;
}
- case INSN_MG_PV: /* 65 */
+ case INSN_MG_PV: /* 64 */
{
pvcontents arg;
BGET_pvcontents(arg);
BSET_mg_pv(SvMAGIC(bytecode_sv), arg);
break;
}
- case INSN_XMG_STASH: /* 66 */
+ case INSN_XMG_STASH: /* 65 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&SvSTASH(bytecode_sv) = arg;
break;
}
- case INSN_GV_FETCHPV: /* 67 */
+ case INSN_GV_FETCHPV: /* 66 */
{
strconst arg;
BGET_strconst(arg);
BSET_gv_fetchpv(bytecode_sv, arg);
break;
}
- case INSN_GV_STASHPV: /* 68 */
+ case INSN_GV_STASHPV: /* 67 */
{
strconst arg;
BGET_strconst(arg);
BSET_gv_stashpv(bytecode_sv, arg);
break;
}
- case INSN_GP_SV: /* 69 */
+ case INSN_GP_SV: /* 68 */
{
svindex arg;
BGET_svindex(arg);
GvSV(bytecode_sv) = arg;
break;
}
- case INSN_GP_REFCNT: /* 70 */
+ case INSN_GP_REFCNT: /* 69 */
{
U32 arg;
BGET_U32(arg);
GvREFCNT(bytecode_sv) = arg;
break;
}
- case INSN_GP_REFCNT_ADD: /* 71 */
+ case INSN_GP_REFCNT_ADD: /* 70 */
{
I32 arg;
BGET_I32(arg);
BSET_gp_refcnt_add(GvREFCNT(bytecode_sv), arg);
break;
}
- case INSN_GP_AV: /* 72 */
+ case INSN_GP_AV: /* 71 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvAV(bytecode_sv) = arg;
break;
}
- case INSN_GP_HV: /* 73 */
+ case INSN_GP_HV: /* 72 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvHV(bytecode_sv) = arg;
break;
}
- case INSN_GP_CV: /* 74 */
+ case INSN_GP_CV: /* 73 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvCV(bytecode_sv) = arg;
break;
}
- case INSN_GP_FILEGV: /* 75 */
+ case INSN_GP_FILE: /* 74 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&GvFILEGV(bytecode_sv) = arg;
+ pvcontents arg;
+ BGET_pvcontents(arg);
+ GvFILE(bytecode_sv) = arg;
break;
}
- case INSN_GP_IO: /* 76 */
+ case INSN_GP_IO: /* 75 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvIOp(bytecode_sv) = arg;
break;
}
- case INSN_GP_FORM: /* 77 */
+ case INSN_GP_FORM: /* 76 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvFORM(bytecode_sv) = arg;
break;
}
- case INSN_GP_CVGEN: /* 78 */
+ case INSN_GP_CVGEN: /* 77 */
{
U32 arg;
BGET_U32(arg);
GvCVGEN(bytecode_sv) = arg;
break;
}
- case INSN_GP_LINE: /* 79 */
+ case INSN_GP_LINE: /* 78 */
{
line_t arg;
BGET_U16(arg);
GvLINE(bytecode_sv) = arg;
break;
}
- case INSN_GP_SHARE: /* 80 */
+ case INSN_GP_SHARE: /* 79 */
{
svindex arg;
BGET_svindex(arg);
BSET_gp_share(bytecode_sv, arg);
break;
}
- case INSN_XGV_FLAGS: /* 81 */
+ case INSN_XGV_FLAGS: /* 80 */
{
U8 arg;
BGET_U8(arg);
GvFLAGS(bytecode_sv) = arg;
break;
}
- case INSN_OP_NEXT: /* 82 */
+ case INSN_OP_NEXT: /* 81 */
{
opindex arg;
BGET_opindex(arg);
PL_op->op_next = arg;
break;
}
- case INSN_OP_SIBLING: /* 83 */
+ case INSN_OP_SIBLING: /* 82 */
{
opindex arg;
BGET_opindex(arg);
PL_op->op_sibling = arg;
break;
}
- case INSN_OP_PPADDR: /* 84 */
+ case INSN_OP_PPADDR: /* 83 */
{
strconst arg;
BGET_strconst(arg);
BSET_op_ppaddr(PL_op->op_ppaddr, arg);
break;
}
- case INSN_OP_TARG: /* 85 */
+ case INSN_OP_TARG: /* 84 */
{
PADOFFSET arg;
BGET_U32(arg);
PL_op->op_targ = arg;
break;
}
- case INSN_OP_TYPE: /* 86 */
+ case INSN_OP_TYPE: /* 85 */
{
OPCODE arg;
BGET_U16(arg);
BSET_op_type(PL_op, arg);
break;
}
- case INSN_OP_SEQ: /* 87 */
+ case INSN_OP_SEQ: /* 86 */
{
U16 arg;
BGET_U16(arg);
PL_op->op_seq = arg;
break;
}
- case INSN_OP_FLAGS: /* 88 */
+ case INSN_OP_FLAGS: /* 87 */
{
U8 arg;
BGET_U8(arg);
PL_op->op_flags = arg;
break;
}
- case INSN_OP_PRIVATE: /* 89 */
+ case INSN_OP_PRIVATE: /* 88 */
{
U8 arg;
BGET_U8(arg);
PL_op->op_private = arg;
break;
}
- case INSN_OP_FIRST: /* 90 */
+ case INSN_OP_FIRST: /* 89 */
{
opindex arg;
BGET_opindex(arg);
cUNOP->op_first = arg;
break;
}
- case INSN_OP_LAST: /* 91 */
+ case INSN_OP_LAST: /* 90 */
{
opindex arg;
BGET_opindex(arg);
cBINOP->op_last = arg;
break;
}
- case INSN_OP_OTHER: /* 92 */
+ case INSN_OP_OTHER: /* 91 */
{
opindex arg;
BGET_opindex(arg);
cLOGOP->op_other = arg;
break;
}
- case INSN_OP_CHILDREN: /* 93 */
+ case INSN_OP_CHILDREN: /* 92 */
{
U32 arg;
BGET_U32(arg);
cLISTOP->op_children = arg;
break;
}
- case INSN_OP_PMREPLROOT: /* 94 */
+ case INSN_OP_PMREPLROOT: /* 93 */
{
opindex arg;
BGET_opindex(arg);
cPMOP->op_pmreplroot = arg;
break;
}
- case INSN_OP_PMREPLROOTGV: /* 95 */
+ case INSN_OP_PMREPLROOTGV: /* 94 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&cPMOP->op_pmreplroot = arg;
break;
}
- case INSN_OP_PMREPLSTART: /* 96 */
+ case INSN_OP_PMREPLSTART: /* 95 */
{
opindex arg;
BGET_opindex(arg);
cPMOP->op_pmreplstart = arg;
break;
}
- case INSN_OP_PMNEXT: /* 97 */
+ case INSN_OP_PMNEXT: /* 96 */
{
opindex arg;
BGET_opindex(arg);
*(OP**)&cPMOP->op_pmnext = arg;
break;
}
- case INSN_PREGCOMP: /* 98 */
+ case INSN_PREGCOMP: /* 97 */
{
pvcontents arg;
BGET_pvcontents(arg);
BSET_pregcomp(PL_op, arg);
break;
}
- case INSN_OP_PMFLAGS: /* 99 */
+ case INSN_OP_PMFLAGS: /* 98 */
{
U16 arg;
BGET_U16(arg);
cPMOP->op_pmflags = arg;
break;
}
- case INSN_OP_PMPERMFLAGS: /* 100 */
+ case INSN_OP_PMPERMFLAGS: /* 99 */
{
U16 arg;
BGET_U16(arg);
cPMOP->op_pmpermflags = arg;
break;
}
- case INSN_OP_SV: /* 101 */
+ case INSN_OP_SV: /* 100 */
{
svindex arg;
BGET_svindex(arg);
cSVOP->op_sv = arg;
break;
}
- case INSN_OP_GV: /* 102 */
+ case INSN_OP_PADIX: /* 101 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&cGVOP->op_gv = arg;
+ PADOFFSET arg;
+ BGET_U32(arg);
+ cPADOP->op_padix = arg;
break;
}
- case INSN_OP_PV: /* 103 */
+ case INSN_OP_PV: /* 102 */
{
pvcontents arg;
BGET_pvcontents(arg);
cPVOP->op_pv = arg;
break;
}
- case INSN_OP_PV_TR: /* 104 */
+ case INSN_OP_PV_TR: /* 103 */
{
op_tr_array arg;
BGET_op_tr_array(arg);
cPVOP->op_pv = arg;
break;
}
- case INSN_OP_REDOOP: /* 105 */
+ case INSN_OP_REDOOP: /* 104 */
{
opindex arg;
BGET_opindex(arg);
cLOOP->op_redoop = arg;
break;
}
- case INSN_OP_NEXTOP: /* 106 */
+ case INSN_OP_NEXTOP: /* 105 */
{
opindex arg;
BGET_opindex(arg);
cLOOP->op_nextop = arg;
break;
}
- case INSN_OP_LASTOP: /* 107 */
+ case INSN_OP_LASTOP: /* 106 */
{
opindex arg;
BGET_opindex(arg);
cLOOP->op_lastop = arg;
break;
}
- case INSN_COP_LABEL: /* 108 */
+ case INSN_COP_LABEL: /* 107 */
{
pvcontents arg;
BGET_pvcontents(arg);
cCOP->cop_label = arg;
break;
}
- case INSN_COP_STASH: /* 109 */
+ case INSN_COP_STASH: /* 108 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&cCOP->cop_stash = arg;
break;
}
- case INSN_COP_FILEGV: /* 110 */
+ case INSN_COP_FILEGV: /* 109 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&cCOP->cop_filegv = arg;
break;
}
- case INSN_COP_SEQ: /* 111 */
+ case INSN_COP_SEQ: /* 110 */
{
U32 arg;
BGET_U32(arg);
cCOP->cop_seq = arg;
break;
}
- case INSN_COP_ARYBASE: /* 112 */
+ case INSN_COP_ARYBASE: /* 111 */
{
I32 arg;
BGET_I32(arg);
cCOP->cop_arybase = arg;
break;
}
- case INSN_COP_LINE: /* 113 */
+ case INSN_COP_LINE: /* 112 */
{
line_t arg;
BGET_U16(arg);
cCOP->cop_line = arg;
break;
}
- case INSN_COP_WARNINGS: /* 114 */
+ case INSN_COP_WARNINGS: /* 113 */
{
svindex arg;
BGET_svindex(arg);
cCOP->cop_warnings = arg;
break;
}
- case INSN_MAIN_START: /* 115 */
+ case INSN_MAIN_START: /* 114 */
{
opindex arg;
BGET_opindex(arg);
PL_main_start = arg;
break;
}
- case INSN_MAIN_ROOT: /* 116 */
+ case INSN_MAIN_ROOT: /* 115 */
{
opindex arg;
BGET_opindex(arg);
PL_main_root = arg;
break;
}
- case INSN_CURPAD: /* 117 */
+ case INSN_CURPAD: /* 116 */
{
svindex arg;
BGET_svindex(arg);
diff --git a/ext/ByteLoader/byterun.h b/ext/ByteLoader/byterun.h
index 3b8f77642c..306df9cbd4 100644
--- a/ext/ByteLoader/byterun.h
+++ b/ext/ByteLoader/byterun.h
@@ -64,77 +64,76 @@ enum {
INSN_XCV_START, /* 45 */
INSN_XCV_ROOT, /* 46 */
INSN_XCV_GV, /* 47 */
- INSN_XCV_FILEGV, /* 48 */
- INSN_XCV_DEPTH, /* 49 */
- INSN_XCV_PADLIST, /* 50 */
- INSN_XCV_OUTSIDE, /* 51 */
- INSN_XCV_FLAGS, /* 52 */
- INSN_AV_EXTEND, /* 53 */
- INSN_AV_PUSH, /* 54 */
- INSN_XAV_FILL, /* 55 */
- INSN_XAV_MAX, /* 56 */
- INSN_XAV_FLAGS, /* 57 */
- INSN_XHV_RITER, /* 58 */
- INSN_XHV_NAME, /* 59 */
- INSN_HV_STORE, /* 60 */
- INSN_SV_MAGIC, /* 61 */
- INSN_MG_OBJ, /* 62 */
- INSN_MG_PRIVATE, /* 63 */
- INSN_MG_FLAGS, /* 64 */
- INSN_MG_PV, /* 65 */
- INSN_XMG_STASH, /* 66 */
- INSN_GV_FETCHPV, /* 67 */
- INSN_GV_STASHPV, /* 68 */
- INSN_GP_SV, /* 69 */
- INSN_GP_REFCNT, /* 70 */
- INSN_GP_REFCNT_ADD, /* 71 */
- INSN_GP_AV, /* 72 */
- INSN_GP_HV, /* 73 */
- INSN_GP_CV, /* 74 */
- INSN_GP_FILEGV, /* 75 */
- INSN_GP_IO, /* 76 */
- INSN_GP_FORM, /* 77 */
- INSN_GP_CVGEN, /* 78 */
- INSN_GP_LINE, /* 79 */
- INSN_GP_SHARE, /* 80 */
- INSN_XGV_FLAGS, /* 81 */
- INSN_OP_NEXT, /* 82 */
- INSN_OP_SIBLING, /* 83 */
- INSN_OP_PPADDR, /* 84 */
- INSN_OP_TARG, /* 85 */
- INSN_OP_TYPE, /* 86 */
- INSN_OP_SEQ, /* 87 */
- INSN_OP_FLAGS, /* 88 */
- INSN_OP_PRIVATE, /* 89 */
- INSN_OP_FIRST, /* 90 */
- INSN_OP_LAST, /* 91 */
- INSN_OP_OTHER, /* 92 */
- INSN_OP_CHILDREN, /* 93 */
- INSN_OP_PMREPLROOT, /* 94 */
- INSN_OP_PMREPLROOTGV, /* 95 */
- INSN_OP_PMREPLSTART, /* 96 */
- INSN_OP_PMNEXT, /* 97 */
- INSN_PREGCOMP, /* 98 */
- INSN_OP_PMFLAGS, /* 99 */
- INSN_OP_PMPERMFLAGS, /* 100 */
- INSN_OP_SV, /* 101 */
- INSN_OP_GV, /* 102 */
- INSN_OP_PV, /* 103 */
- INSN_OP_PV_TR, /* 104 */
- INSN_OP_REDOOP, /* 105 */
- INSN_OP_NEXTOP, /* 106 */
- INSN_OP_LASTOP, /* 107 */
- INSN_COP_LABEL, /* 108 */
- INSN_COP_STASH, /* 109 */
- INSN_COP_FILEGV, /* 110 */
- INSN_COP_SEQ, /* 111 */
- INSN_COP_ARYBASE, /* 112 */
- INSN_COP_LINE, /* 113 */
- INSN_COP_WARNINGS, /* 114 */
- INSN_MAIN_START, /* 115 */
- INSN_MAIN_ROOT, /* 116 */
- INSN_CURPAD, /* 117 */
- MAX_INSN = 117
+ INSN_XCV_DEPTH, /* 48 */
+ INSN_XCV_PADLIST, /* 49 */
+ INSN_XCV_OUTSIDE, /* 50 */
+ INSN_XCV_FLAGS, /* 51 */
+ INSN_AV_EXTEND, /* 52 */
+ INSN_AV_PUSH, /* 53 */
+ INSN_XAV_FILL, /* 54 */
+ INSN_XAV_MAX, /* 55 */
+ INSN_XAV_FLAGS, /* 56 */
+ INSN_XHV_RITER, /* 57 */
+ INSN_XHV_NAME, /* 58 */
+ INSN_HV_STORE, /* 59 */
+ INSN_SV_MAGIC, /* 60 */
+ INSN_MG_OBJ, /* 61 */
+ INSN_MG_PRIVATE, /* 62 */
+ INSN_MG_FLAGS, /* 63 */
+ INSN_MG_PV, /* 64 */
+ INSN_XMG_STASH, /* 65 */
+ INSN_GV_FETCHPV, /* 66 */
+ INSN_GV_STASHPV, /* 67 */
+ INSN_GP_SV, /* 68 */
+ INSN_GP_REFCNT, /* 69 */
+ INSN_GP_REFCNT_ADD, /* 70 */
+ INSN_GP_AV, /* 71 */
+ INSN_GP_HV, /* 72 */
+ INSN_GP_CV, /* 73 */
+ INSN_GP_FILE, /* 74 */
+ INSN_GP_IO, /* 75 */
+ INSN_GP_FORM, /* 76 */
+ INSN_GP_CVGEN, /* 77 */
+ INSN_GP_LINE, /* 78 */
+ INSN_GP_SHARE, /* 79 */
+ INSN_XGV_FLAGS, /* 80 */
+ INSN_OP_NEXT, /* 81 */
+ INSN_OP_SIBLING, /* 82 */
+ INSN_OP_PPADDR, /* 83 */
+ INSN_OP_TARG, /* 84 */
+ INSN_OP_TYPE, /* 85 */
+ INSN_OP_SEQ, /* 86 */
+ INSN_OP_FLAGS, /* 87 */
+ INSN_OP_PRIVATE, /* 88 */
+ INSN_OP_FIRST, /* 89 */
+ INSN_OP_LAST, /* 90 */
+ INSN_OP_OTHER, /* 91 */
+ INSN_OP_CHILDREN, /* 92 */
+ INSN_OP_PMREPLROOT, /* 93 */
+ INSN_OP_PMREPLROOTGV, /* 94 */
+ INSN_OP_PMREPLSTART, /* 95 */
+ INSN_OP_PMNEXT, /* 96 */
+ INSN_PREGCOMP, /* 97 */
+ INSN_OP_PMFLAGS, /* 98 */
+ INSN_OP_PMPERMFLAGS, /* 99 */
+ INSN_OP_SV, /* 100 */
+ INSN_OP_PADIX, /* 101 */
+ INSN_OP_PV, /* 102 */
+ INSN_OP_PV_TR, /* 103 */
+ INSN_OP_REDOOP, /* 104 */
+ INSN_OP_NEXTOP, /* 105 */
+ INSN_OP_LASTOP, /* 106 */
+ INSN_COP_LABEL, /* 107 */
+ INSN_COP_STASH, /* 108 */
+ INSN_COP_FILEGV, /* 109 */
+ INSN_COP_SEQ, /* 110 */
+ INSN_COP_ARYBASE, /* 111 */
+ INSN_COP_LINE, /* 112 */
+ INSN_COP_WARNINGS, /* 113 */
+ INSN_MAIN_START, /* 114 */
+ INSN_MAIN_ROOT, /* 115 */
+ INSN_CURPAD, /* 116 */
+ MAX_INSN = 116
};
enum {
@@ -145,7 +144,7 @@ enum {
OPt_LISTOP, /* 4 */
OPt_PMOP, /* 5 */
OPt_SVOP, /* 6 */
- OPt_GVOP, /* 7 */
+ OPt_PADOP, /* 7 */
OPt_PVOP, /* 8 */
OPt_LOOP, /* 9 */
OPt_COP /* 10 */
diff --git a/ext/Devel/Peek/Peek.pm b/ext/Devel/Peek/Peek.pm
index 7b3cf749a0..4bac55fd31 100644
--- a/ext/Devel/Peek/Peek.pm
+++ b/ext/Devel/Peek/Peek.pm
@@ -364,7 +364,6 @@ Looks like this:
XSUB = 0x0
XSUBANY = 0
GVGV::GV = 0x1d44e8 "MY" :: "top_targets"
- FILEGV = 0x1fab74 "_<(eval 5)"
DEPTH = 0
PADLIST = 0x1c9338
diff --git a/gv.c b/gv.c
index 0688fef0c9..aa4a6499e4 100644
--- a/gv.c
+++ b/gv.c
@@ -68,15 +68,16 @@ Perl_gv_fetchfile(pTHX_ const char *name)
tmpbuf[1] = '<';
strcpy(tmpbuf + 2, name);
gv = *(GV**)hv_fetch(PL_defstash, tmpbuf, tmplen, TRUE);
- if (!isGV(gv))
+ if (!isGV(gv)) {
gv_init(gv, PL_defstash, tmpbuf, tmplen, FALSE);
+ sv_setpv(GvSV(gv), name);
+ if (*name == '/' && (instr(name, "/lib/") || instr(name, ".pm")))
+ GvMULTI_on(gv);
+ if (PERLDB_LINE)
+ hv_magic(GvHVn(gv_AVadd(gv)), gv, 'L');
+ }
if (tmpbuf != smallbuf)
Safefree(tmpbuf);
- sv_setpv(GvSV(gv), name);
- if (*name == '/' && (instr(name, "/lib/") || instr(name, ".pm")))
- GvMULTI_on(gv);
- if (PERLDB_LINE)
- hv_magic(GvHVn(gv_AVadd(gv)), gv, 'L');
return gv;
}
@@ -101,7 +102,7 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi)
GvGP(gv) = gp_ref(gp);
GvSV(gv) = NEWSV(72,0);
GvLINE(gv) = PL_curcop->cop_line;
- GvFILEGV(gv) = PL_curcop->cop_filegv;
+ GvFILE(gv) = PL_curcop->cop_filegv ? SvPVX(GvSV(PL_curcop->cop_filegv)) : "";
GvCVGEN(gv) = 0;
GvEGV(gv) = gv;
sv_magic((SV*)gv, (SV*)gv, '*', name, len);
@@ -120,7 +121,6 @@ Perl_gv_init(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len, int multi)
PL_sub_generation++;
CvGV(GvCV(gv)) = (GV*)SvREFCNT_inc(gv);
- CvFILEGV(GvCV(gv)) = PL_curcop->cop_filegv;
CvSTASH(GvCV(gv)) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(GvCV(gv)) = 0;
@@ -896,7 +896,7 @@ Perl_gv_check(pTHX_ HV *stash)
if (SvTYPE(gv) != SVt_PVGV || GvMULTI(gv))
continue;
PL_curcop->cop_line = GvLINE(gv);
- filegv = GvFILEGV(gv);
+ filegv = GvFILEGV(gv); /* XXX could be made faster */
PL_curcop->cop_filegv = filegv;
if (filegv && GvMULTI(filegv)) /* Filename began with slash */
continue;
diff --git a/gv.h b/gv.h
index 620cbc3345..99d534eeba 100644
--- a/gv.h
+++ b/gv.h
@@ -19,7 +19,7 @@ struct gp {
U32 gp_cvgen; /* generational validity of cached gv_cv */
U32 gp_flags; /* XXX unused */
line_t gp_line; /* line first declared at (for -w) */
- GV * gp_filegv; /* file first declared in (for -w) */
+ char * gp_file; /* file first declared in (for -w) */
};
#if defined(CRIPPLED_CC) && (defined(iAPX286) || defined(M_I286) || defined(I80286))
@@ -70,7 +70,8 @@ HV *GvHVn();
#define GvGPFLAGS(gv) (GvGP(gv)->gp_flags)
#define GvLINE(gv) (GvGP(gv)->gp_line)
-#define GvFILEGV(gv) (GvGP(gv)->gp_filegv)
+#define GvFILE(gv) (GvGP(gv)->gp_file)
+#define GvFILEGV(gv) (gv_fetchfile(GvGP(gv)->gp_file))
#define GvEGV(gv) (GvGP(gv)->gp_egv)
#define GvENAME(gv) GvNAME(GvEGV(gv) ? GvEGV(gv) : gv)
diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm
index 7a10d98ba7..8cb6a96f5f 100644
--- a/lib/Time/Local.pm
+++ b/lib/Time/Local.pm
@@ -5,17 +5,6 @@ use Carp;
@ISA = qw( Exporter );
@EXPORT = qw( timegm timelocal );
-@EXPORT_OK = qw( $no_range_check );
-
-sub import {
- my $package = shift;
- my @args;
- for (@_) {
- $no_range_check = 1, next if $_ eq 'no_range_check';
- push @args, $_;
- }
- Time::Local->export_to_level(1, $package, @args);
-}
# Set up constants
$SEC = 1;
@@ -151,21 +140,23 @@ This is consistent with the values returned from localtime() and gmtime().
Also worth noting is the ability to disable the range checking that
would normally occur on the input $sec, $min, $hours, $mday, and $mon
-values. You can do this by setting $Time::Local::no_range_check = 1,
-or by invoking the module with C<use Time::Local 'no_range_check'>.
-This enables you to abuse the terminology somewhat and gain the
-flexibilty to do things like:
+values. You can do this by localizing $Time::Local::no_range_check
+to 1.
- use Time::Local qw( no_range_check );
+ use Time::Local;
+
+ {
+ local $Time::Local::no_range_check = 1;
- # The 365th day of 1999
- print scalar localtime timelocal 0,0,0,365,0,99;
+ # The 365th day of 1999
+ print scalar localtime timelocal 0,0,0,365,0,99;
- # The twenty thousandth day since 1970
- print scalar localtime timelocal 0,0,0,20000,0,70;
+ # The twenty thousandth day since 1970
+ print scalar localtime timelocal 0,0,0,20000,0,70;
- # And even the 10,000,000th second since 1999!
- print scalar localtime timelocal 10000000,0,0,1,0,99;
+ # And even the 10,000,000th second since 1999!
+ print scalar localtime timelocal 10000000,0,0,1,0,99;
+ }
Your mileage may vary when trying this trick with minutes and hours,
and it doesn't work at all for months.
diff --git a/op.c b/op.c
index b8006a1670..bacfb9db55 100644
--- a/op.c
+++ b/op.c
@@ -21,7 +21,13 @@
#include "keywords.h"
/* #define PL_OP_SLAB_ALLOC */
-
+
+/* XXXXXX testing */
+#define OP_REFCNT_LOCK NOOP
+#define OP_REFCNT_UNLOCK NOOP
+#define OpREFCNT_set(o,n) NOOP
+#define OpREFCNT_dec(o) 0
+
#ifdef PL_OP_SLAB_ALLOC
#define SLAB_SIZE 8192
static char *PL_OpPtr = NULL;
@@ -640,6 +646,26 @@ Perl_op_free(pTHX_ OP *o)
if (!o || o->op_seq == (U16)-1)
return;
+ if (o->op_private & OPpREFCOUNTED) {
+ switch (o->op_type) {
+ case OP_LEAVESUB:
+ case OP_LEAVESUBLV:
+ case OP_LEAVEEVAL:
+ case OP_LEAVE:
+ case OP_SCOPE:
+ case OP_LEAVEWRITE:
+ OP_REFCNT_LOCK;
+ if (OpREFCNT_dec(o)) {
+ OP_REFCNT_UNLOCK;
+ return;
+ }
+ OP_REFCNT_UNLOCK;
+ break;
+ default:
+ break;
+ }
+ }
+
if (o->op_flags & OPf_KIDS) {
for (kid = cUNOPo->op_first; kid; kid = nextkid) {
nextkid = kid->op_sibling; /* Get before next freeing kid */
@@ -691,8 +717,8 @@ S_op_clear(pTHX_ OP *o)
case OP_GVSV:
case OP_GV:
case OP_AELEMFAST:
- SvREFCNT_dec(cGVOPo->op_gv);
- cGVOPo->op_gv = Nullgv;
+ SvREFCNT_dec(cSVOPo->op_sv);
+ cSVOPo->op_sv = Nullsv;
break;
case OP_CONST:
SvREFCNT_dec(cSVOPo->op_sv);
@@ -1331,7 +1357,7 @@ Perl_mod(pTHX_ OP *o, I32 type)
break;
}
- cv = GvCV(kGVOP->op_gv);
+ cv = GvCV((GV*)kSVOP->op_sv);
if (!cv)
goto restore_2cv;
if (CvLVALUE(cv))
@@ -1957,6 +1983,8 @@ Perl_newPROG(pTHX_ OP *o)
((PL_in_eval & EVAL_KEEPERR)
? OPf_SPECIAL : 0), o);
PL_eval_start = linklist(PL_eval_root);
+ PL_eval_root->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(PL_eval_root, 1);
PL_eval_root->op_next = 0;
peep(PL_eval_start);
}
@@ -1966,6 +1994,8 @@ Perl_newPROG(pTHX_ OP *o)
PL_main_root = scope(sawparens(scalarvoid(o)));
PL_curcop = &PL_compiling;
PL_main_start = LINKLIST(PL_main_root);
+ PL_main_root->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(PL_main_root, 1);
PL_main_root->op_next = 0;
peep(PL_main_start);
PL_compcv = 0;
@@ -2785,7 +2815,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl)
}
#else
if (curop->op_type == OP_GV) {
- GV *gv = ((GVOP*)curop)->op_gv;
+ GV *gv = (GV*)((SVOP*)curop)->op_sv;
repl_has_vars = 1;
if (strchr("&`'123456789+", *GvENAME(gv)))
break;
@@ -2869,18 +2899,7 @@ OP *
Perl_newGVOP(pTHX_ I32 type, I32 flags, GV *gv)
{
dTHR;
- GVOP *gvop;
- NewOp(1101, gvop, 1, GVOP);
- gvop->op_type = type;
- gvop->op_ppaddr = PL_ppaddr[type];
- gvop->op_gv = (GV*)SvREFCNT_inc(gv);
- gvop->op_next = (OP*)gvop;
- gvop->op_flags = flags;
- if (PL_opargs[type] & OA_RETSCALAR)
- scalar((OP*)gvop);
- if (PL_opargs[type] & OA_TARGET)
- gvop->op_targ = pad_alloc(type, SVs_PADTMP);
- return CHECKOP(type, gvop);
+ return newSVOP(type, flags, SvREFCNT_inc(gv));
}
OP *
@@ -3119,7 +3138,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) {
if (PL_opargs[curop->op_type] & OA_DANGEROUS) {
if (curop->op_type == OP_GV) {
- GV *gv = ((GVOP*)curop)->op_gv;
+ GV *gv = (GV*)((SVOP*)curop)->op_sv;
if (gv == PL_defgv || SvCUR(gv) == PL_generation)
break;
SvCUR(gv) = PL_generation;
@@ -3171,7 +3190,7 @@ Perl_newASSIGNOP(pTHX_ I32 flags, OP *left, I32 optype, OP *right)
{
tmpop = ((UNOP*)left)->op_first;
if (tmpop->op_type == OP_GV && !pm->op_pmreplroot) {
- pm->op_pmreplroot = (OP*)((GVOP*)tmpop)->op_gv;
+ pm->op_pmreplroot = (OP*)((SVOP*)tmpop)->op_sv;
pm->op_pmflags |= PMf_ONCE;
tmpop = cUNOPo->op_first; /* to list (nulled) */
tmpop = ((UNOP*)tmpop)->op_first; /* to pushmark */
@@ -3922,7 +3941,6 @@ S_cv_clone2(pTHX_ CV *proto, CV *outside)
MUTEX_INIT(CvMUTEXP(cv));
CvOWNER(cv) = 0;
#endif /* USE_THREADS */
- CvFILEGV(cv) = CvFILEGV(proto);
CvGV(cv) = (GV*)SvREFCNT_inc(CvGV(proto));
CvSTASH(cv) = CvSTASH(proto);
CvROOT(cv) = CvROOT(proto);
@@ -4248,7 +4266,6 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
}
}
CvGV(cv) = (GV*)SvREFCNT_inc(gv);
- CvFILEGV(cv) = PL_curcop->cop_filegv;
CvSTASH(cv) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(cv) = 0;
@@ -4326,12 +4343,14 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
}
}
- if(CvLVALUE(cv)) {
+ if (CvLVALUE(cv)) {
CvROOT(cv) = newUNOP(OP_LEAVESUBLV, 0, scalarseq(block));
}
else {
CvROOT(cv) = newUNOP(OP_LEAVESUB, 0, scalarseq(block));
}
+ CvROOT(cv)->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(CvROOT(cv), 1);
CvSTART(cv) = LINKLIST(CvROOT(cv));
CvROOT(cv)->op_next = 0;
peep(CvSTART(cv));
@@ -4481,7 +4500,7 @@ Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename)
MUTEX_INIT(CvMUTEXP(cv));
CvOWNER(cv) = 0;
#endif /* USE_THREADS */
- CvFILEGV(cv) = gv_fetchfile(filename);
+ (void)gv_fetchfile(filename);
CvXSUB(cv) = subaddr;
if (name) {
@@ -4545,7 +4564,6 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block)
cv = PL_compcv;
GvFORM(gv) = cv;
CvGV(cv) = (GV*)SvREFCNT_inc(gv);
- CvFILEGV(cv) = PL_curcop->cop_filegv;
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
if (!SvPADMY(PL_curpad[ix]) && !SvIMMORTAL(PL_curpad[ix]))
@@ -4553,6 +4571,8 @@ Perl_newFORM(pTHX_ I32 floor, OP *o, OP *block)
}
CvROOT(cv) = newUNOP(OP_LEAVEWRITE, 0, scalarseq(block));
+ CvROOT(cv)->op_private |= OPpREFCOUNTED;
+ OpREFCNT_set(CvROOT(cv), 1);
CvSTART(cv) = LINKLIST(CvROOT(cv));
CvROOT(cv)->op_next = 0;
peep(CvSTART(cv));
@@ -5667,11 +5687,11 @@ S_simplify_sort(pTHX_ OP *o)
if (kUNOP->op_first->op_type != OP_GV)
return;
kid = kUNOP->op_first; /* get past rv2sv */
- if (GvSTASH(kGVOP->op_gv) != PL_curstash)
+ if (GvSTASH((GV*)kSVOP->op_sv) != PL_curstash)
return;
- if (strEQ(GvNAME(kGVOP->op_gv), "a"))
+ if (strEQ(GvNAME((GV*)kSVOP->op_sv), "a"))
reversed = 0;
- else if(strEQ(GvNAME(kGVOP->op_gv), "b"))
+ else if(strEQ(GvNAME((GV*)kSVOP->op_sv), "b"))
reversed = 1;
else
return;
@@ -5682,10 +5702,10 @@ S_simplify_sort(pTHX_ OP *o)
if (kUNOP->op_first->op_type != OP_GV)
return;
kid = kUNOP->op_first; /* get past rv2sv */
- if (GvSTASH(kGVOP->op_gv) != PL_curstash
+ if (GvSTASH((GV*)kSVOP->op_sv) != PL_curstash
|| ( reversed
- ? strNE(GvNAME(kGVOP->op_gv), "a")
- : strNE(GvNAME(kGVOP->op_gv), "b")))
+ ? strNE(GvNAME((GV*)kSVOP->op_sv), "a")
+ : strNE(GvNAME((GV*)kSVOP->op_sv), "b")))
return;
o->op_flags &= ~(OPf_STACKED | OPf_SPECIAL);
if (reversed)
@@ -6084,11 +6104,11 @@ Perl_peep(pTHX_ register OP *o)
o->op_type = OP_AELEMFAST;
o->op_ppaddr = PL_ppaddr[OP_AELEMFAST];
o->op_private = (U8)i;
- GvAVn(((GVOP*)o)->op_gv);
+ GvAVn((GV*)((SVOP*)o)->op_sv);
}
}
else if ((o->op_private & OPpEARLY_CV) && ckWARN(WARN_UNSAFE)) {
- GV *gv = cGVOPo->op_gv;
+ GV *gv = (GV*)cSVOPo->op_sv;
if (SvTYPE(gv) == SVt_PVGV && GvCV(gv) && SvPVX(GvCV(gv))) {
/* XXX could check prototype here instead of just carping */
SV *sv = sv_newmortal();
diff --git a/op.h b/op.h
index c6938c9a23..d34435bfa4 100644
--- a/op.h
+++ b/op.h
@@ -94,6 +94,9 @@ typedef U32 PADOFFSET;
/* Private for lvalues */
#define OPpLVAL_INTRO 128 /* Lvalue must be localized or lvalue sub */
+/* Private for OP_LEAVE, OP_LEAVESUB, OP_LEAVESUBLV and OP_LEAVEWRITE */
+#define OPpREFCOUNTED 64 /* op_targ carries a refcount */
+
/* Private for OP_AASSIGN */
#define OPpASSIGN_COMMON 64 /* Left & right have syms in common. */
@@ -235,9 +238,9 @@ struct svop {
SV * op_sv;
};
-struct gvop {
+struct padop {
BASEOP
- GV * op_gv;
+ PADOFFSET op_padix;
};
struct pvop {
@@ -261,7 +264,7 @@ struct loop {
#define cLOGOP ((LOGOP*)PL_op)
#define cPMOP ((PMOP*)PL_op)
#define cSVOP ((SVOP*)PL_op)
-#define cGVOP ((GVOP*)PL_op)
+#define cPADOP ((PADOP*)PL_op)
#define cPVOP ((PVOP*)PL_op)
#define cCOP ((COP*)PL_op)
#define cLOOP ((LOOP*)PL_op)
@@ -272,7 +275,7 @@ struct loop {
#define cLOGOPo ((LOGOP*)o)
#define cPMOPo ((PMOP*)o)
#define cSVOPo ((SVOP*)o)
-#define cGVOPo ((GVOP*)o)
+#define cPADOPo ((PADOP*)o)
#define cPVOPo ((PVOP*)o)
#define cCVOPo ((CVOP*)o)
#define cCOPo ((COP*)o)
@@ -284,7 +287,7 @@ struct loop {
#define kLOGOP ((LOGOP*)kid)
#define kPMOP ((PMOP*)kid)
#define kSVOP ((SVOP*)kid)
-#define kGVOP ((GVOP*)kid)
+#define kPADOP ((PADOP*)kid)
#define kPVOP ((PVOP*)kid)
#define kCOP ((COP*)kid)
#define kLOOP ((LOOP*)kid)
@@ -314,7 +317,7 @@ struct loop {
#define OA_LISTOP (4 << OCSHIFT)
#define OA_PMOP (5 << OCSHIFT)
#define OA_SVOP (6 << OCSHIFT)
-#define OA_GVOP (7 << OCSHIFT)
+#define OA_PADOP (7 << OCSHIFT)
#define OA_PVOP_OR_SVOP (8 << OCSHIFT)
#define OA_LOOP (9 << OCSHIFT)
#define OA_COP (10 << OCSHIFT)
diff --git a/opcode.h b/opcode.h
index 419dea7cf9..c2bb457dc5 100644
--- a/opcode.h
+++ b/opcode.h
@@ -1458,8 +1458,8 @@ EXT U32 PL_opargs[] = {
0x00000004, /* pushmark */
0x00000014, /* wantarray */
0x00000c04, /* const */
- 0x00000e44, /* gvsv */
- 0x00000e44, /* gv */
+ 0x00000c44, /* gvsv */
+ 0x00000c44, /* gv */
0x00022440, /* gelem */
0x00000044, /* padsv */
0x00000040, /* padav */
@@ -1578,7 +1578,7 @@ EXT U32 PL_opargs[] = {
0x0001368e, /* lc */
0x0001378e, /* quotemeta */
0x00000248, /* rv2av */
- 0x00026e04, /* aelemfast */
+ 0x00026c04, /* aelemfast */
0x00026404, /* aelem */
0x00046801, /* aslice */
0x00009600, /* each */
diff --git a/opcode.pl b/opcode.pl
index 0b91f3c752..c9174f2c91 100755
--- a/opcode.pl
+++ b/opcode.pl
@@ -184,7 +184,7 @@ END
'@', 4, # listop
'/', 5, # pmop
'$', 6, # svop
- '*', 7, # gvop
+ '#', 7, # padop
'"', 8, # pvop_or_svop
'{', 9, # loop
';', 10, # cop
@@ -350,8 +350,8 @@ wantarray wantarray ck_null is0
const constant item ck_svconst s$
-gvsv scalar variable ck_null ds*
-gv glob value ck_null ds*
+gvsv scalar variable ck_null ds$
+gv glob value ck_null ds$
gelem glob elem ck_null d2 S S
padsv private variable ck_null ds0
padav private array ck_null d0
@@ -511,7 +511,7 @@ quotemeta quotemeta ck_fun fsTu% S?
# Arrays.
rv2av array dereference ck_rvconst dt1
-aelemfast constant array element ck_null s* A S
+aelemfast constant array element ck_null s$ A S
aelem array element ck_null s2 A S
aslice array slice ck_null m@ A L
diff --git a/perl.h b/perl.h
index d25345e9a8..c6eb7c9f81 100644
--- a/perl.h
+++ b/perl.h
@@ -1296,7 +1296,7 @@ typedef struct listop LISTOP;
typedef struct logop LOGOP;
typedef struct pmop PMOP;
typedef struct svop SVOP;
-typedef struct gvop GVOP;
+typedef struct padop PADOP;
typedef struct pvop PVOP;
typedef struct loop LOOP;
diff --git a/pp_hot.c b/pp_hot.c
index a7fd9dc142..6f9528a96a 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -58,9 +58,9 @@ PP(pp_gvsv)
djSP;
EXTEND(SP,1);
if (PL_op->op_private & OPpLVAL_INTRO)
- PUSHs(save_scalar(cGVOP->op_gv));
+ PUSHs(save_scalar((GV*)cSVOP->op_sv));
else
- PUSHs(GvSV(cGVOP->op_gv));
+ PUSHs(GvSV((GV*)cSVOP->op_sv));
RETURN;
}
@@ -95,7 +95,7 @@ PP(pp_stringify)
PP(pp_gv)
{
djSP;
- XPUSHs((SV*)cGVOP->op_gv);
+ XPUSHs(cSVOP->op_sv);
RETURN;
}
diff --git a/pp_sys.c b/pp_sys.c
index 271d0cae09..9c739801aa 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -411,7 +411,7 @@ PP(pp_indread)
PP(pp_rcatline)
{
- PL_last_in_gv = cGVOP->op_gv;
+ PL_last_in_gv = (GV*)cSVOP->op_sv;
return do_readline();
}
@@ -2412,7 +2412,7 @@ PP(pp_stat)
STRLEN n_a;
if (PL_op->op_flags & OPf_REF) {
- tmpgv = cGVOP->op_gv;
+ tmpgv = (GV*)cSVOP->op_sv;
do_fstat:
if (tmpgv != PL_defgv) {
PL_laststype = OP_STAT;
@@ -2857,7 +2857,7 @@ PP(pp_fttty)
STRLEN n_a;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP->op_gv;
+ gv = (GV*)cSVOP->op_sv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
@@ -2898,7 +2898,7 @@ PP(pp_fttext)
STRLEN n_a;
if (PL_op->op_flags & OPf_REF)
- gv = cGVOP->op_gv;
+ gv = (GV*)cSVOP->op_sv;
else if (isGV(TOPs))
gv = (GV*)POPs;
else if (SvROK(TOPs) && isGV(SvRV(TOPs)))
@@ -2949,7 +2949,7 @@ PP(pp_fttext)
else {
if (ckWARN(WARN_UNOPENED))
Perl_warner(aTHX_ WARN_UNOPENED, "Test on unopened file <%s>",
- GvENAME(cGVOP->op_gv));
+ GvENAME((GV*)cSVOP->op_sv));
SETERRNO(EBADF,RMS$_IFI);
RETPUSHUNDEF;
}
diff --git a/regexec.c b/regexec.c
index 2d965b0637..684e344c16 100644
--- a/regexec.c
+++ b/regexec.c
@@ -1404,7 +1404,7 @@ Perl_regexec_flags(pTHX_ register regexp *prog, char *stringarg, register char *
}
break;
default:
- croak("panic: unknown regstclass %d", (int)OP(c));
+ Perl_croak(aTHX_ "panic: unknown regstclass %d", (int)OP(c));
break;
}
}
diff --git a/run.c b/run.c
index 38c35e095b..a6391e9b9f 100644
--- a/run.c
+++ b/run.c
@@ -71,9 +71,9 @@ Perl_debop(pTHX_ OP *o)
break;
case OP_GVSV:
case OP_GV:
- if (cGVOPo->op_gv) {
+ if (cSVOPo->op_sv) {
sv = NEWSV(0,0);
- gv_fullname3(sv, cGVOPo->op_gv, Nullch);
+ gv_fullname3(sv, (GV*)cSVOPo->op_sv, Nullch);
PerlIO_printf(Perl_debug_log, "(%s)", SvPV(sv, n_a));
SvREFCNT_dec(sv);
}
diff --git a/sv.h b/sv.h
index e99891dd22..116f17828a 100644
--- a/sv.h
+++ b/sv.h
@@ -276,8 +276,10 @@ struct xpvfm {
void (*xcv_xsub)(pTHXo_ CV*);
ANY xcv_xsubany;
GV * xcv_gv;
- GV * xcv_filegv;
- long xcv_depth; /* >= 2 indicates recursive call */
+#if defined(PERL_BINCOMPAT_5005)
+ GV * xcv_filegv; /* XXX unused (and deprecated) */
+#endif
+ long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#ifdef USE_THREADS