xcv_start CvSTART(bytecode_sv) opindex
xcv_root CvROOT(bytecode_sv) opindex
xcv_gv *(SV**)&CvGV(bytecode_sv) svindex
+xcv_file CvFILE(bytecode_sv) pvcontents
xcv_depth CvDEPTH(bytecode_sv) long
xcv_padlist *(SV**)&CvPADLIST(bytecode_sv) svindex
xcv_outside *(SV**)&CvOUTSIDE(bytecode_sv) svindex
op_lastop cLOOP->op_lastop opindex
cop_label cCOP->cop_label pvcontents
cop_stash *(SV**)&cCOP->cop_stash svindex
-cop_filegv *(SV**)&cCOP->cop_filegv svindex
+cop_file cCOP pvcontents x
cop_seq cCOP->cop_seq U32
cop_arybase cCOP->cop_arybase I32
-cop_line cCOP->cop_line line_t
+cop_line cCOP line_t x
cop_warnings cCOP->cop_warnings svindex
main_start PL_main_start opindex
main_root PL_main_root opindex
BASEOP
char * cop_label; /* label for this construct */
HV * cop_stash; /* package line was compiled in */
+#ifdef USE_ITHREADS
+ char * cop_file; /* file name the following line # is from */
+#else
GV * cop_filegv; /* file the following line # is from */
+#endif
U32 cop_seq; /* parse sequence number */
I32 cop_arybase; /* array base this line was compiled with */
line_t cop_line; /* line # of this command */
#define Nullcop Null(COP*)
-#define CopFILEGV(c) (c)->cop_filegv
-#define CopFILEGV_set(c,gv) ((c)->cop_filegv = gv)
-#define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
-#define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
-#define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
+#ifdef USE_ITHREADS
+# define CopFILE(c) ((c)->cop_file)
+# define CopFILEGV(c) (CopFILE(c) \
+ ? gv_fetchfile(CopFILE(c)) : Nullgv)
+# define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) /* XXX */
+# define CopFILESV(c) (CopFILE(c) \
+ ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
+# define CopFILEAV(c) (CopFILE(c) \
+ ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
+# define CopSTASH(c) (CopSTASHPV(c) \
+ ? gv_fetchstash(CopSTASHPV(c)) : Nullhv)
+# define CopSTASH_set(c,hv) ((c)->cop_stashpv = HvNAME(hv)) /* XXX */
+# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = pv)
+# define CopSTASHPV(c) ((c)->cop_stashpv)
+#else
+# define CopFILEGV(c) ((c)->cop_filegv)
+# define CopFILEGV_set(c,gv) ((c)->cop_filegv = gv)
+# define CopFILE_set(c,pv) ((c)->cop_filegv = gv_fetchfile(pv))
+# define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv)
+# define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav)
+# define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch)
+# define CopSTASH(c) ((c)->cop_stash)
+# define CopSTASH_set(c,hv) ((c)->cop_stash = hv)
+# define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
+#endif /* USE_ITHREADS */
+
#define CopLINE(c) ((c)->cop_line)
-#define CopLINE_set(c,l) ((c)->cop_line = (l))
+#define CopLINE_inc(c) (++CopLINE(c))
+#define CopLINE_dec(c) (--CopLINE(c))
+#define CopLINE_set(c,l) (CopLINE(c) = (l))
/*
* Here we have some enormously heavy (or at least ponderous) wizardry.
*
*/
-/* This structure much match the beginning of XPVFM */
+/* This structure much match XPVCV in B/C.pm and the beginning of XPVFM
+ * in sv.h */
struct xpvcv {
char * xpv_pv; /* pointer to malloced string */
void (*xcv_xsub) (pTHXo_ CV*);
ANY xcv_xsubany;
GV * xcv_gv;
-#if defined(PERL_BINCOMPAT_5005)
- GV * xcv_filegv; /* XXX unused (and deprecated) */
-#endif
+ char * xcv_file;
long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#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 CvFILE(sv) ((XPVCV*)SvANY(sv))->xcv_file
+#define CvFILEGV(sv) (gv_fetchfile(CvFILE(sv))
#define CvDEPTH(sv) ((XPVCV*)SvANY(sv))->xcv_depth
#define CvPADLIST(sv) ((XPVCV*)SvANY(sv))->xcv_padlist
#define CvOUTSIDE(sv) ((XPVCV*)SvANY(sv))->xcv_outside
case OP_SETSTATE:
case OP_NEXTSTATE:
case OP_DBSTATE:
- if (cCOPo->cop_line)
- Perl_dump_indent(aTHX_ level, file, "LINE = %d\n",cCOPo->cop_line);
+ if (CopLINE(cCOPo))
+ Perl_dump_indent(aTHX_ level, file, "LINE = %d\n",CopLINE(cCOPo));
if (cCOPo->cop_label)
Perl_dump_indent(aTHX_ level, file, "LABEL = \"%s\"\n",cCOPo->cop_label);
break;
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));
+ Perl_dump_indent(aTHX_ level, file, " FILE = \"%s\"\n", CvFILE(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)));
=item GV
+=item FILE
+
=item DEPTH
=item PADLIST
=item stash
-=item filegv
+=item file
=item cop_seq
#define COP_label(o) o->cop_label
#define COP_stash(o) o->cop_stash
-#define COP_filegv(o) o->cop_filegv
+#define COP_file(o) CopFILE(o)
#define COP_cop_seq(o) o->cop_seq
#define COP_arybase(o) o->cop_arybase
-#define COP_line(o) o->cop_line
+#define COP_line(o) CopLINE(o)
#define COP_warnings(o) o->cop_warnings
MODULE = B PACKAGE = B::COP PREFIX = COP_
COP_stash(o)
B::COP o
-B::GV
-COP_filegv(o)
+char *
+COP_file(o)
B::COP o
U32
CvGV(cv)
B::CV cv
+char *
+CvFILE(cv)
+ B::CV cv
+
long
CvDEPTH(cv)
B::CV cv
$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_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"];
+$insn_data{xcv_file} = [48, \&PUT_pvcontents, "GET_pvcontents"];
+$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_file} = [75, \&PUT_pvcontents, "GET_pvcontents"];
+$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_padix} = [102, \&PUT_U32, "GET_U32"];
+$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_file} = [110, \&PUT_pvcontents, "GET_pvcontents"];
+$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"];
my ($insn_name, $insn_data);
while (($insn_name, $insn_data) = each %insn_data) {
my $op = shift;
my $stash = $op->stash;
my $stashix = $stash->objix;
- my $filegv = $op->filegv;
- my $filegvix = $filegv->objix;
+ my $file = $op->file;
my $line = $op->line;
my $warnings = $op->warnings;
my $warningsix = $warnings->objix;
if ($debug_bc) {
- printf "# line %s:%d\n", $filegv->SV->PV, $line;
+ printf "# line %s:%d\n", $file, $line;
}
$op->B::OP::bytecode;
- printf <<"EOT", pvstring($op->label), $op->cop_seq, $op->arybase;
+ printf <<"EOT", pvstring($op->label), $op->cop_seq, pvstring($file), $op->arybase;
newpv %s
cop_label
cop_stash $stashix
cop_seq %d
-cop_filegv $filegvix
+newpv %s
+cop_file
cop_arybase %d
cop_line $line
cop_warnings $warningsix
EOT
- $filegv->bytecode;
$stash->bytecode;
}
printf "xcv_%s %d\n", lc($subfield_names[$i]), $ixes[$i];
}
printf "xcv_depth %d\nxcv_flags 0x%x\n", $cv->DEPTH, $cv->FLAGS;
+ printf "newpv %s\nxcv_file\n", pvstring($cv->FILE);
# Now save all the subfields (except for CvROOT which was handled
# above) and CvSTART (now the initial element of @subfields).
shift @subfields; # bye-bye CvSTART
my ($op, $level) = @_;
my $sym = objsym($op);
return $sym if defined $sym;
- my $gvsym = $op->filegv->save;
my $stashsym = $op->stash->save;
- warn sprintf("COP: line %d file %s\n", $op->line, $op->filegv->SV->PV)
+ warn sprintf("COP: line %d file %s\n", $op->line, $op->file)
if $debug_cops;
$copsect->add(sprintf("s\\_%x, s\\_%x, %s,$handle_VC_problem %u, %u, %u, 0x%x, 0x%x, %s, Nullhv, Nullgv, %u, %d, %u",
${$op->next}, ${$op->sibling}, $op->ppaddr,
$op->private, cstring($op->label), $op->cop_seq,
$op->arybase, $op->line));
my $copix = $copsect->index;
- $init->add(sprintf("cop_list[%d].cop_filegv = %s;", $copix, $gvsym),
+ $init->add(sprintf("CopFILE_set(&cop_list[%d], %s);", $copix, cstring($op->file)),
sprintf("cop_list[%d].cop_stash = %s;", $copix, $stashsym));
savesym($op, "(OP*)&cop_list[$copix]");
}
warn sprintf("done saving GV 0x%x for CV 0x%x\n",
$$gv, $$cv) if $debug_cv;
}
+ $init->add(sprintf("CvFILE($sym) = %s;", cstring($cv->FILE)));
my $stash = $cv->STASH;
if ($$stash) {
$stash->save;
void (*xcv_xsub) (CV*);
void * xcv_xsubany;
GV * xcv_gv;
-#if defined(PERL_BINCOMPAT_5005)
- GV * xcv_filegv; /* XXX unused (and deprecated) */
-#endif
+ char * xcv_file;
long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
sub error {
my $format = shift;
- my $file = $curcop->[0]->filegv->SV->PV;
+ my $file = $curcop->[0]->file;
my $line = $curcop->[0]->line;
$errors++;
if (@_) {
my $op = shift;
$curcop->load($op);
@stack = ();
- debug(sprintf("%s:%d\n", $op->filegv->SV->PV, $op->line)) if $debug_lineno;
+ debug(sprintf("%s:%d\n", $op->file, $op->line)) if $debug_lineno;
runtime("TAINT_NOT;") unless $omit_taint;
runtime("sp = PL_stack_base + cxstack[cxstack_ix].blk_oldsp;");
if ($freetmps_each_bblock || $freetmps_each_loop) {
sub B::COP::debug {
my ($op) = @_;
$op->B::OP::debug();
- my ($filegv) = $op->filegv;
- printf <<'EOT', $op->label, ${$op->stash}, $$filegv, $op->seq, $op->arybase, $op->line, ${$op->warnings};
+ printf <<'EOT', $op->label, ${$op->stash}, $op->file, $op->seq, $op->arybase, $op->line, ${$op->warnings};
cop_label %s
cop_stash 0x%x
- cop_filegv 0x%x
+ cop_file %s
cop_seq %d
cop_arybase %d
cop_line %d
cop_warnings 0x%x
EOT
- $filegv->debug;
}
sub B::SVOP::debug {
my ($start) = $sv->START;
my ($root) = $sv->ROOT;
my ($padlist) = $sv->PADLIST;
+ my ($file) = $sv->FILE;
my ($gv) = $sv->GV;
- printf <<'EOT', $$stash, $$start, $$root, $$gv, $sv->DEPTH, $padlist, ${$sv->OUTSIDE};
+ printf <<'EOT', $$stash, $$start, $$root, $$gv, $file, $sv->DEPTH, $padlist, ${$sv->OUTSIDE};
STASH 0x%x
START 0x%x
ROOT 0x%x
GV 0x%x
+ FILE %s
DEPTH %d
PADLIST 0x%x
OUTSIDE 0x%x
}
if ($self->{'linenums'}) {
push @text, "\f#line " . $op->line .
- ' "' . substr($op->filegv->NAME, 2), qq'"\n';
+ ' "' . $op->file, qq'"\n';
}
return join("", @text);
}
sub B::COP::lint {
my $op = shift;
if ($op->name eq "nextstate") {
- $file = $op->filegv->SV->PV;
+ $file = $op->file;
$line = $op->line;
$curstash = $op->stash->NAME;
}
sub pp_nextstate {
my $op = shift;
- $file = $op->filegv->SV->PV;
+ $file = $op->file;
$line = $op->line;
$top = UNKNOWN;
}
PL_comppad = (AV *)arg; \
pad = AvARRAY(arg); \
} STMT_END
+#define BSET_cop_file(cop, arg) CopFILE_set(cop,arg)
+#define BSET_cop_line(cop, arg) CopLINE_set(cop,arg)
#define BSET_OBJ_STORE(obj, ix) \
(I32)ix > bytecode_obj_list_fill ? \
*(SV**)&CvGV(bytecode_sv) = arg;
break;
}
- case INSN_XCV_DEPTH: /* 48 */
+ case INSN_XCV_FILE: /* 48 */
+ {
+ pvcontents arg;
+ BGET_pvcontents(arg);
+ CvFILE(bytecode_sv) = arg;
+ break;
+ }
+ case INSN_XCV_DEPTH: /* 49 */
{
long arg;
BGET_I32(arg);
CvDEPTH(bytecode_sv) = arg;
break;
}
- case INSN_XCV_PADLIST: /* 49 */
+ case INSN_XCV_PADLIST: /* 50 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&CvPADLIST(bytecode_sv) = arg;
break;
}
- case INSN_XCV_OUTSIDE: /* 50 */
+ case INSN_XCV_OUTSIDE: /* 51 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&CvOUTSIDE(bytecode_sv) = arg;
break;
}
- case INSN_XCV_FLAGS: /* 51 */
+ case INSN_XCV_FLAGS: /* 52 */
{
U8 arg;
BGET_U8(arg);
CvFLAGS(bytecode_sv) = arg;
break;
}
- case INSN_AV_EXTEND: /* 52 */
+ case INSN_AV_EXTEND: /* 53 */
{
SSize_t arg;
BGET_I32(arg);
BSET_av_extend(bytecode_sv, arg);
break;
}
- case INSN_AV_PUSH: /* 53 */
+ case INSN_AV_PUSH: /* 54 */
{
svindex arg;
BGET_svindex(arg);
BSET_av_push(bytecode_sv, arg);
break;
}
- case INSN_XAV_FILL: /* 54 */
+ case INSN_XAV_FILL: /* 55 */
{
SSize_t arg;
BGET_I32(arg);
AvFILLp(bytecode_sv) = arg;
break;
}
- case INSN_XAV_MAX: /* 55 */
+ case INSN_XAV_MAX: /* 56 */
{
SSize_t arg;
BGET_I32(arg);
AvMAX(bytecode_sv) = arg;
break;
}
- case INSN_XAV_FLAGS: /* 56 */
+ case INSN_XAV_FLAGS: /* 57 */
{
U8 arg;
BGET_U8(arg);
AvFLAGS(bytecode_sv) = arg;
break;
}
- case INSN_XHV_RITER: /* 57 */
+ case INSN_XHV_RITER: /* 58 */
{
I32 arg;
BGET_I32(arg);
HvRITER(bytecode_sv) = arg;
break;
}
- case INSN_XHV_NAME: /* 58 */
+ case INSN_XHV_NAME: /* 59 */
{
pvcontents arg;
BGET_pvcontents(arg);
HvNAME(bytecode_sv) = arg;
break;
}
- case INSN_HV_STORE: /* 59 */
+ case INSN_HV_STORE: /* 60 */
{
svindex arg;
BGET_svindex(arg);
BSET_hv_store(bytecode_sv, arg);
break;
}
- case INSN_SV_MAGIC: /* 60 */
+ case INSN_SV_MAGIC: /* 61 */
{
char arg;
BGET_U8(arg);
BSET_sv_magic(bytecode_sv, arg);
break;
}
- case INSN_MG_OBJ: /* 61 */
+ case INSN_MG_OBJ: /* 62 */
{
svindex arg;
BGET_svindex(arg);
SvMAGIC(bytecode_sv)->mg_obj = arg;
break;
}
- case INSN_MG_PRIVATE: /* 62 */
+ case INSN_MG_PRIVATE: /* 63 */
{
U16 arg;
BGET_U16(arg);
SvMAGIC(bytecode_sv)->mg_private = arg;
break;
}
- case INSN_MG_FLAGS: /* 63 */
+ case INSN_MG_FLAGS: /* 64 */
{
U8 arg;
BGET_U8(arg);
SvMAGIC(bytecode_sv)->mg_flags = arg;
break;
}
- case INSN_MG_PV: /* 64 */
+ case INSN_MG_PV: /* 65 */
{
pvcontents arg;
BGET_pvcontents(arg);
BSET_mg_pv(SvMAGIC(bytecode_sv), arg);
break;
}
- case INSN_XMG_STASH: /* 65 */
+ case INSN_XMG_STASH: /* 66 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&SvSTASH(bytecode_sv) = arg;
break;
}
- case INSN_GV_FETCHPV: /* 66 */
+ case INSN_GV_FETCHPV: /* 67 */
{
strconst arg;
BGET_strconst(arg);
BSET_gv_fetchpv(bytecode_sv, arg);
break;
}
- case INSN_GV_STASHPV: /* 67 */
+ case INSN_GV_STASHPV: /* 68 */
{
strconst arg;
BGET_strconst(arg);
BSET_gv_stashpv(bytecode_sv, arg);
break;
}
- case INSN_GP_SV: /* 68 */
+ case INSN_GP_SV: /* 69 */
{
svindex arg;
BGET_svindex(arg);
GvSV(bytecode_sv) = arg;
break;
}
- case INSN_GP_REFCNT: /* 69 */
+ case INSN_GP_REFCNT: /* 70 */
{
U32 arg;
BGET_U32(arg);
GvREFCNT(bytecode_sv) = arg;
break;
}
- case INSN_GP_REFCNT_ADD: /* 70 */
+ case INSN_GP_REFCNT_ADD: /* 71 */
{
I32 arg;
BGET_I32(arg);
BSET_gp_refcnt_add(GvREFCNT(bytecode_sv), arg);
break;
}
- case INSN_GP_AV: /* 71 */
+ case INSN_GP_AV: /* 72 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvAV(bytecode_sv) = arg;
break;
}
- case INSN_GP_HV: /* 72 */
+ case INSN_GP_HV: /* 73 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvHV(bytecode_sv) = arg;
break;
}
- case INSN_GP_CV: /* 73 */
+ case INSN_GP_CV: /* 74 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvCV(bytecode_sv) = arg;
break;
}
- case INSN_GP_FILE: /* 74 */
+ case INSN_GP_FILE: /* 75 */
{
pvcontents arg;
BGET_pvcontents(arg);
GvFILE(bytecode_sv) = arg;
break;
}
- case INSN_GP_IO: /* 75 */
+ case INSN_GP_IO: /* 76 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvIOp(bytecode_sv) = arg;
break;
}
- case INSN_GP_FORM: /* 76 */
+ case INSN_GP_FORM: /* 77 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&GvFORM(bytecode_sv) = arg;
break;
}
- case INSN_GP_CVGEN: /* 77 */
+ case INSN_GP_CVGEN: /* 78 */
{
U32 arg;
BGET_U32(arg);
GvCVGEN(bytecode_sv) = arg;
break;
}
- case INSN_GP_LINE: /* 78 */
+ case INSN_GP_LINE: /* 79 */
{
line_t arg;
BGET_U16(arg);
GvLINE(bytecode_sv) = arg;
break;
}
- case INSN_GP_SHARE: /* 79 */
+ case INSN_GP_SHARE: /* 80 */
{
svindex arg;
BGET_svindex(arg);
BSET_gp_share(bytecode_sv, arg);
break;
}
- case INSN_XGV_FLAGS: /* 80 */
+ case INSN_XGV_FLAGS: /* 81 */
{
U8 arg;
BGET_U8(arg);
GvFLAGS(bytecode_sv) = arg;
break;
}
- case INSN_OP_NEXT: /* 81 */
+ case INSN_OP_NEXT: /* 82 */
{
opindex arg;
BGET_opindex(arg);
PL_op->op_next = arg;
break;
}
- case INSN_OP_SIBLING: /* 82 */
+ case INSN_OP_SIBLING: /* 83 */
{
opindex arg;
BGET_opindex(arg);
PL_op->op_sibling = arg;
break;
}
- case INSN_OP_PPADDR: /* 83 */
+ case INSN_OP_PPADDR: /* 84 */
{
strconst arg;
BGET_strconst(arg);
BSET_op_ppaddr(PL_op->op_ppaddr, arg);
break;
}
- case INSN_OP_TARG: /* 84 */
+ case INSN_OP_TARG: /* 85 */
{
PADOFFSET arg;
BGET_U32(arg);
PL_op->op_targ = arg;
break;
}
- case INSN_OP_TYPE: /* 85 */
+ case INSN_OP_TYPE: /* 86 */
{
OPCODE arg;
BGET_U16(arg);
BSET_op_type(PL_op, arg);
break;
}
- case INSN_OP_SEQ: /* 86 */
+ case INSN_OP_SEQ: /* 87 */
{
U16 arg;
BGET_U16(arg);
PL_op->op_seq = arg;
break;
}
- case INSN_OP_FLAGS: /* 87 */
+ case INSN_OP_FLAGS: /* 88 */
{
U8 arg;
BGET_U8(arg);
PL_op->op_flags = arg;
break;
}
- case INSN_OP_PRIVATE: /* 88 */
+ case INSN_OP_PRIVATE: /* 89 */
{
U8 arg;
BGET_U8(arg);
PL_op->op_private = arg;
break;
}
- case INSN_OP_FIRST: /* 89 */
+ case INSN_OP_FIRST: /* 90 */
{
opindex arg;
BGET_opindex(arg);
cUNOP->op_first = arg;
break;
}
- case INSN_OP_LAST: /* 90 */
+ case INSN_OP_LAST: /* 91 */
{
opindex arg;
BGET_opindex(arg);
cBINOP->op_last = arg;
break;
}
- case INSN_OP_OTHER: /* 91 */
+ case INSN_OP_OTHER: /* 92 */
{
opindex arg;
BGET_opindex(arg);
cLOGOP->op_other = arg;
break;
}
- case INSN_OP_CHILDREN: /* 92 */
+ case INSN_OP_CHILDREN: /* 93 */
{
U32 arg;
BGET_U32(arg);
cLISTOP->op_children = arg;
break;
}
- case INSN_OP_PMREPLROOT: /* 93 */
+ case INSN_OP_PMREPLROOT: /* 94 */
{
opindex arg;
BGET_opindex(arg);
cPMOP->op_pmreplroot = arg;
break;
}
- case INSN_OP_PMREPLROOTGV: /* 94 */
+ case INSN_OP_PMREPLROOTGV: /* 95 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&cPMOP->op_pmreplroot = arg;
break;
}
- case INSN_OP_PMREPLSTART: /* 95 */
+ case INSN_OP_PMREPLSTART: /* 96 */
{
opindex arg;
BGET_opindex(arg);
cPMOP->op_pmreplstart = arg;
break;
}
- case INSN_OP_PMNEXT: /* 96 */
+ case INSN_OP_PMNEXT: /* 97 */
{
opindex arg;
BGET_opindex(arg);
*(OP**)&cPMOP->op_pmnext = arg;
break;
}
- case INSN_PREGCOMP: /* 97 */
+ case INSN_PREGCOMP: /* 98 */
{
pvcontents arg;
BGET_pvcontents(arg);
BSET_pregcomp(PL_op, arg);
break;
}
- case INSN_OP_PMFLAGS: /* 98 */
+ case INSN_OP_PMFLAGS: /* 99 */
{
U16 arg;
BGET_U16(arg);
cPMOP->op_pmflags = arg;
break;
}
- case INSN_OP_PMPERMFLAGS: /* 99 */
+ case INSN_OP_PMPERMFLAGS: /* 100 */
{
U16 arg;
BGET_U16(arg);
cPMOP->op_pmpermflags = arg;
break;
}
- case INSN_OP_SV: /* 100 */
+ case INSN_OP_SV: /* 101 */
{
svindex arg;
BGET_svindex(arg);
cSVOP->op_sv = arg;
break;
}
- case INSN_OP_PADIX: /* 101 */
+ case INSN_OP_PADIX: /* 102 */
{
PADOFFSET arg;
BGET_U32(arg);
cPADOP->op_padix = arg;
break;
}
- case INSN_OP_PV: /* 102 */
+ case INSN_OP_PV: /* 103 */
{
pvcontents arg;
BGET_pvcontents(arg);
cPVOP->op_pv = arg;
break;
}
- case INSN_OP_PV_TR: /* 103 */
+ case INSN_OP_PV_TR: /* 104 */
{
op_tr_array arg;
BGET_op_tr_array(arg);
cPVOP->op_pv = arg;
break;
}
- case INSN_OP_REDOOP: /* 104 */
+ case INSN_OP_REDOOP: /* 105 */
{
opindex arg;
BGET_opindex(arg);
cLOOP->op_redoop = arg;
break;
}
- case INSN_OP_NEXTOP: /* 105 */
+ case INSN_OP_NEXTOP: /* 106 */
{
opindex arg;
BGET_opindex(arg);
cLOOP->op_nextop = arg;
break;
}
- case INSN_OP_LASTOP: /* 106 */
+ case INSN_OP_LASTOP: /* 107 */
{
opindex arg;
BGET_opindex(arg);
cLOOP->op_lastop = arg;
break;
}
- case INSN_COP_LABEL: /* 107 */
+ case INSN_COP_LABEL: /* 108 */
{
pvcontents arg;
BGET_pvcontents(arg);
cCOP->cop_label = arg;
break;
}
- case INSN_COP_STASH: /* 108 */
+ case INSN_COP_STASH: /* 109 */
{
svindex arg;
BGET_svindex(arg);
*(SV**)&cCOP->cop_stash = arg;
break;
}
- case INSN_COP_FILEGV: /* 109 */
+ case INSN_COP_FILE: /* 110 */
{
- svindex arg;
- BGET_svindex(arg);
- *(SV**)&cCOP->cop_filegv = arg;
+ pvcontents arg;
+ BGET_pvcontents(arg);
+ BSET_cop_file(cCOP, arg);
break;
}
- case INSN_COP_SEQ: /* 110 */
+ case INSN_COP_SEQ: /* 111 */
{
U32 arg;
BGET_U32(arg);
cCOP->cop_seq = arg;
break;
}
- case INSN_COP_ARYBASE: /* 111 */
+ case INSN_COP_ARYBASE: /* 112 */
{
I32 arg;
BGET_I32(arg);
cCOP->cop_arybase = arg;
break;
}
- case INSN_COP_LINE: /* 112 */
+ case INSN_COP_LINE: /* 113 */
{
line_t arg;
BGET_U16(arg);
- cCOP->cop_line = arg;
+ BSET_cop_line(cCOP, arg);
break;
}
- case INSN_COP_WARNINGS: /* 113 */
+ case INSN_COP_WARNINGS: /* 114 */
{
svindex arg;
BGET_svindex(arg);
cCOP->cop_warnings = arg;
break;
}
- case INSN_MAIN_START: /* 114 */
+ case INSN_MAIN_START: /* 115 */
{
opindex arg;
BGET_opindex(arg);
PL_main_start = arg;
break;
}
- case INSN_MAIN_ROOT: /* 115 */
+ case INSN_MAIN_ROOT: /* 116 */
{
opindex arg;
BGET_opindex(arg);
PL_main_root = arg;
break;
}
- case INSN_CURPAD: /* 116 */
+ case INSN_CURPAD: /* 117 */
{
svindex arg;
BGET_svindex(arg);
INSN_XCV_START, /* 45 */
INSN_XCV_ROOT, /* 46 */
INSN_XCV_GV, /* 47 */
- 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
+ INSN_XCV_FILE, /* 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_FILE, /* 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_PADIX, /* 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_FILE, /* 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
};
enum {
XSUB = 0x0
XSUBANY = 0
GVGV::GV = 0x1d44e8 "MY" :: "top_targets"
+ FILE = "(eval 5)"
DEPTH = 0
PADLIST = 0x1c9338
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');
}
PL_sub_generation++;
CvGV(GvCV(gv)) = (GV*)SvREFCNT_inc(gv);
+ CvFILE(GvCV(gv)) = CopFILE(PL_curcop);
CvSTASH(GvCV(gv)) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(GvCV(gv)) = 0;
register I32 i;
register GV *gv;
HV *hv;
- GV *filegv;
if (!HvARRAY(stash))
return;
gv_check(hv); /* nested package */
}
else if (isALPHA(*HeKEY(entry))) {
+ char *file;
gv = (GV*)HeVAL(entry);
if (SvTYPE(gv) != SVt_PVGV || GvMULTI(gv))
continue;
- CopLINE_set(PL_curcop, GvLINE(gv));
- filegv = GvFILEGV(gv); /* XXX could be made faster */
- CopFILEGV_set(PL_curcop, filegv);
- if (filegv && GvMULTI(filegv)) /* Filename began with slash */
+ file = GvFILE(gv);
+ /* performance hack: if filename is absolute and it's a standard
+ * module, don't bother warning */
+ if (file
+ && PERL_FILE_IS_ABSOLUTE(file)
+ && (instr(file, "/lib/") || instr(file, ".pm")))
+ {
continue;
+ }
+ CopLINE_set(PL_curcop, GvLINE(gv));
+#ifdef USE_ITHREADS
+ CopFILE(PL_curcop) = file; /* set for warning */
+#else
+ CopFILEGV(PL_curcop) = gv_fetchfile(file);
+#endif
Perl_warner(aTHX_ WARN_ONCE,
"Name \"%s::%s\" used only once: possible typo",
HvNAME(stash), GvNAME(gv));
#define GvLINE(gv) (GvGP(gv)->gp_line)
#define GvFILE(gv) (GvGP(gv)->gp_file)
-#define GvFILEGV(gv) (gv_fetchfile(GvGP(gv)->gp_file))
+#define GvFILEGV(gv) (gv_fetchfile(GvFILE(gv)))
#define GvEGV(gv) (GvGP(gv)->gp_egv)
#define GvENAME(gv) GvNAME(GvEGV(gv) ? GvEGV(gv) : gv)
S_cop_free(pTHX_ COP* cop)
{
Safefree(cop->cop_label);
+#ifdef USE_ITHREADS
+ Safefree(CopFILE(cop)); /* XXXXX share in a pvtable? */
+#else
SvREFCNT_dec(CopFILEGV(cop));
+#endif
if (! specialWARN(cop->cop_warnings))
SvREFCNT_dec(cop->cop_warnings);
}
if (o->op_type == OP_SASSIGN && cBINOPo->op_first->op_type == OP_CONST) {
dTHR;
if (ckWARN(WARN_SYNTAX)) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
- PL_curcop->cop_line = PL_copline;
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_SYNTAX, "Found = in conditional, should be ==");
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
}
return scalar(o);
OP *curop;
if (pm->op_pmflags & PMf_EVAL) {
curop = 0;
- if (PL_curcop->cop_line < PL_multi_end)
- PL_curcop->cop_line = PL_multi_end;
+ if (CopLINE(PL_curcop) < PL_multi_end)
+ CopLINE_set(PL_curcop, PL_multi_end);
}
#ifdef USE_THREADS
else if (repl->op_type == OP_THREADSV
register COP *cop;
NewOp(1101, cop, 1, COP);
- if (PERLDB_LINE && PL_curcop->cop_line && PL_curstash != PL_debstash) {
+ if (PERLDB_LINE && CopLINE(PL_curcop) && PL_curstash != PL_debstash) {
cop->op_type = OP_DBSTATE;
cop->op_ppaddr = PL_ppaddr[ OP_DBSTATE ];
}
if (PL_copline == NOLINE)
- cop->cop_line = PL_curcop->cop_line;
+ CopLINE_set(cop, CopLINE(PL_curcop));
else {
- cop->cop_line = PL_copline;
+ CopLINE_set(cop, PL_copline);
PL_copline = NOLINE;
}
+#ifdef USE_ITHREADS
+ CopFILE_set(cop, CopFILE(PL_curcop)); /* XXXXX share in a pvtable? */
+#else
CopFILEGV_set(cop, (GV*)SvREFCNT_inc(CopFILEGV(PL_curcop)));
+#endif
cop->cop_stash = PL_curstash;
if (PERLDB_LINE && PL_curstash != PL_debstash) {
break;
}
if (warnop) {
- line_t oldline = PL_curcop->cop_line;
- PL_curcop->cop_line = PL_copline;
+ line_t oldline = CopLINE(PL_curcop);
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_UNSAFE,
"Value of %s%s can be \"0\"; test with defined()",
PL_op_desc[warnop],
((warnop == OP_READLINE || warnop == OP_GLOB)
? " construct" : "() operator"));
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
}
MUTEX_INIT(CvMUTEXP(cv));
CvOWNER(cv) = 0;
#endif /* USE_THREADS */
+ CvFILE(cv) = CvFILE(proto);
CvGV(cv) = (GV*)SvREFCNT_inc(CvGV(proto));
CvSTASH(cv) = CvSTASH(proto);
CvROOT(cv) = CvROOT(proto);
&& HvNAME(GvSTASH(CvGV(cv)))
&& strEQ(HvNAME(GvSTASH(CvGV(cv))),
"autouse"))) {
- line_t oldline = PL_curcop->cop_line;
- PL_curcop->cop_line = PL_copline;
+ line_t oldline = CopLINE(PL_curcop);
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_REDEFINE,
const_sv ? "Constant subroutine %s redefined"
: "Subroutine %s redefined", name);
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
cv = Nullcv;
}
}
CvGV(cv) = (GV*)SvREFCNT_inc(gv);
+ CvFILE(cv) = CopFILE(PL_curcop);
CvSTASH(cv) = PL_curstash;
#ifdef USE_THREADS
CvOWNER(cv) = 0;
if (strEQ(s, "BEGIN")) {
I32 oldscope = PL_scopestack_ix;
ENTER;
- SAVESPTR(CopFILEGV(&PL_compiling));
- SAVEI16(PL_compiling.cop_line);
+ SAVECOPFILE(&PL_compiling);
+ SAVECOPLINE(&PL_compiling);
save_svref(&PL_rs);
sv_setsv(PL_rs, PL_nrs);
U32 oldhints = PL_hints;
HV *old_cop_stash = PL_curcop->cop_stash;
HV *old_curstash = PL_curstash;
- line_t oldline = PL_curcop->cop_line;
- PL_curcop->cop_line = PL_copline;
+ line_t oldline = CopLINE(PL_curcop);
+ CopLINE_set(PL_curcop, PL_copline);
PL_hints &= ~HINT_BLOCK_SCOPE;
if(stash)
PL_hints = oldhints;
PL_curcop->cop_stash = old_cop_stash;
PL_curstash = old_curstash;
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
CV *
if (ckWARN(WARN_REDEFINE) && !(CvGV(cv) && GvSTASH(CvGV(cv))
&& HvNAME(GvSTASH(CvGV(cv)))
&& strEQ(HvNAME(GvSTASH(CvGV(cv))), "autouse"))) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
if (PL_copline != NOLINE)
- PL_curcop->cop_line = PL_copline;
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_REDEFINE, "Subroutine %s redefined",name);
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
cv = 0;
CvOWNER(cv) = 0;
#endif /* USE_THREADS */
(void)gv_fetchfile(filename);
+ CvFILE(cv) = filename; /* NOTE: not copied, as it is expected to be
+ an external constant string */
CvXSUB(cv) = subaddr;
if (name) {
GvMULTI_on(gv);
if (cv = GvFORM(gv)) {
if (ckWARN(WARN_REDEFINE)) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
- PL_curcop->cop_line = PL_copline;
+ CopLINE_set(PL_curcop, PL_copline);
Perl_warner(aTHX_ WARN_REDEFINE, "Format %s redefined",name);
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
SvREFCNT_dec(cv);
}
cv = PL_compcv;
GvFORM(gv) = cv;
CvGV(cv) = (GV*)SvREFCNT_inc(gv);
+ CvFILE(cv) = CopFILE(PL_curcop);
for (ix = AvFILLp(PL_comppad); ix > 0; ix--) {
if (!SvPADMY(PL_curpad[ix]) && !SvIMMORTAL(PL_curpad[ix]))
o->op_next->op_sibling->op_type != OP_EXIT &&
o->op_next->op_sibling->op_type != OP_WARN &&
o->op_next->op_sibling->op_type != OP_DIE) {
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
- PL_curcop->cop_line = ((COP*)o->op_next)->cop_line;
+ CopLINE_set(PL_curcop, CopLINE((COP*)o->op_next));
Perl_warner(aTHX_ WARN_SYNTAX, "Statement unlikely to be reached");
Perl_warner(aTHX_ WARN_SYNTAX, "(Maybe you meant system() when you said exec()?)\n");
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
}
}
break;
PL_origfilename);
}
}
- PL_curcop->cop_line = 0;
+ CopLINE_set(PL_curcop, 0);
PL_curstash = PL_defstash;
PL_preprocess = FALSE;
if (PL_e_script) {
if (PL_do_undump)
my_unexec();
- if (isWARN_ONCE)
+ if (isWARN_ONCE) {
+ SAVECOPFILE(PL_curcop);
+ SAVECOPLINE(PL_curcop);
gv_check(PL_defstash);
+ }
LEAVE;
FREETMPS;
}
}
- CopFILEGV_set(PL_curcop, gv_fetchfile(PL_origfilename));
+ CopFILE_set(PL_curcop, PL_origfilename);
if (strEQ(PL_origfilename,"-"))
scriptname = "";
if (*fdscript >= 0) {
if (PL_statbuf.st_mode & S_IWOTH)
Perl_croak(aTHX_ "Setuid/gid script is writable by world");
PL_doswitches = FALSE; /* -s is insecure in suid */
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
if (sv_gets(PL_linestr, PL_rsfp, 0) == Nullch ||
strnNE(SvPV(PL_linestr,n_a),"#!",2) ) /* required even on Sys V */
Perl_croak(aTHX_ "No #! line");
{
dTHR;
SV *atsv = ERRSV;
- line_t oldline = PL_curcop->cop_line;
+ line_t oldline = CopLINE(PL_curcop);
CV *cv;
STRLEN len;
int ret;
(void)SvPV(atsv, len);
if (len) {
PL_curcop = &PL_compiling;
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
if (paramList == PL_beginav)
sv_catpv(atsv, "BEGIN failed--compilation aborted");
else
FREETMPS;
PL_curstash = PL_defstash;
PL_curcop = &PL_compiling;
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
if (PL_statusvalue) {
if (paramList == PL_beginav)
Perl_croak(aTHX_ "BEGIN failed--compilation aborted");
case 3:
if (PL_restartop) {
PL_curcop = &PL_compiling;
- PL_curcop->cop_line = oldline;
+ CopLINE_set(PL_curcop, oldline);
JMPENV_JUMP(3);
}
PerlIO_printf(Perl_error_log, "panic: restartop\n");
Newz(602, gp, 1, GP);
GvGP(sv) = gp_ref(gp);
GvSV(sv) = NEWSV(72,0);
- GvLINE(sv) = PL_curcop->cop_line;
+ GvLINE(sv) = CopLINE(PL_curcop);
GvEGV(sv) = (GV*)sv;
GvMULTI_on(sv);
}
else
PUSHs(sv_2mortal(newSVpv(HvNAME(hv), 0)));
PUSHs(sv_2mortal(newSVsv(CopFILESV(cx->blk_oldcop))));
- PUSHs(sv_2mortal(newSViv((I32)cx->blk_oldcop->cop_line)));
+ PUSHs(sv_2mortal(newSViv((I32)CopLINE(cx->blk_oldcop))));
if (!MAXARG)
RETURN;
if (CxTYPE(cx) == CXt_SUB) { /* So is ccstack[dbcxix]. */
SAVESPTR(PL_compiling.cop_stash);
PL_compiling.cop_stash = PL_curstash;
}
- SAVESPTR(CopFILEGV(&PL_compiling));
- SAVEI16(PL_compiling.cop_line);
+ SAVECOPFILE(&PL_compiling);
+ SAVECOPLINE(&PL_compiling);
sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq);
- CopFILEGV_set(&PL_compiling, gv_fetchfile(tmpbuf+2));
- PL_compiling.cop_line = 1;
+ CopFILE_set(&PL_compiling, tmpbuf+2);
+ CopLINE_set(&PL_compiling, 1);
/* XXX For C<eval "...">s within BEGIN {} blocks, this ends up
deleting the eval's FILEGV from the stash before gv_check() runs
(i.e. before run-time proper). To work around the coredump that
}
SvREFCNT_dec(PL_rs);
PL_rs = SvREFCNT_inc(PL_nrs);
- PL_compiling.cop_line = 0;
+ CopLINE_set(&PL_compiling, 0);
if (startop) {
*startop = PL_eval_root;
SvREFCNT_dec(CvOUTSIDE(PL_compcv));
/* prepare to compile file */
- if (*name == '/' ||
- (*name == '.' &&
- (name[1] == '/' ||
- (name[1] == '.' && name[2] == '/')))
-#ifdef DOSISH
- || (name[0] && name[1] == ':')
-#endif
-#ifdef WIN32
- || (name[0] == '\\' && name[1] == '\\') /* UNC path */
-#endif
-#ifdef VMS
- || (strchr(name,':') || ((*name == '[' || *name == '<') &&
- (isALNUM(name[1]) || strchr("$-_]>",name[1]))))
-#endif
- )
+ if (PERL_FILE_IS_ABSOLUTE(name)
+ || (*name == '.' && (name[1] == '/' ||
+ (name[1] == '.' && name[2] == '/'))))
{
tryname = name;
tryrsfp = doopen_pmc(name,PERL_SCRIPT_MODE);
}
}
}
- SAVESPTR(CopFILEGV(&PL_compiling));
- CopFILEGV_set(&PL_compiling, gv_fetchfile(tryrsfp ? tryname : name));
+ SAVECOPFILE(&PL_compiling);
+ CopFILE_set(&PL_compiling, tryrsfp ? tryname : name);
SvREFCNT_dec(namesv);
if (!tryrsfp) {
if (PL_op->op_type == OP_REQUIRE) {
PUSHBLOCK(cx, CXt_EVAL, SP);
PUSHEVAL(cx, name, Nullgv);
- SAVEI16(PL_compiling.cop_line);
- PL_compiling.cop_line = 0;
+ SAVECOPLINE(&PL_compiling);
+ CopLINE_set(&PL_compiling, 0);
PUTBACK;
#ifdef USE_THREADS
/* switch to eval mode */
- SAVESPTR(CopFILEGV(&PL_compiling));
+ SAVECOPFILE(&PL_compiling);
sprintf(tmpbuf, "_<(eval %lu)", (unsigned long)++PL_evalseq);
- CopFILEGV_set(&PL_compiling, gv_fetchfile(tmpbuf+2));
- PL_compiling.cop_line = 1;
+ CopFILE_set(&PL_compiling, tmpbuf+2);
+ CopLINE_set(&PL_compiling, 1);
/* XXX For C<eval "...">s within BEGIN {} blocks, this ends up
deleting the eval's FILEGV from the stash before gv_check() runs
(i.e. before run-time proper). To work around the coredump that
GV *gv = gv_fetchmethod(stash, "PROPAGATE");
if (gv) {
SV *file = sv_2mortal(newSVsv(CopFILESV(PL_curcop)));
- SV *line = sv_2mortal(newSViv(PL_curcop->cop_line));
+ SV *line = sv_2mortal(newSViv(CopLINE(PL_curcop)));
EXTEND(SP, 3);
PUSHMARK(SP);
PUSHs(error);
}
GvGP(gv) = gp_ref(gp);
GvSV(gv) = NEWSV(72,0);
- GvLINE(gv) = PL_curcop->cop_line;
+ GvLINE(gv) = CopLINE(PL_curcop);
GvEGV(gv) = gv;
}
else {
} \
} STMT_END
+#ifdef USE_ITHREADS
+# define SAVECOPFILE(cop) SAVEPPTR(CopFILE(cop))
+#else
+# define SAVECOPFILE(cop) SAVESPTR(CopFILEGV(cop))
+#endif
+
+#define SAVECOPLINE(cop) SAVEI16(CopLINE(cop))
+
/* SSNEW() temporarily allocates a specified number of bytes of data on the
* savestack. It returns an integer index into the savestack, because a
* pointer would get broken if the savestack is moved on reallocation.
Newz(602,gp, 1, GP);
GvGP(dstr) = gp_ref(gp);
GvSV(dstr) = NEWSV(72,0);
- GvLINE(dstr) = PL_curcop->cop_line;
+ GvLINE(dstr) = CopLINE(PL_curcop);
GvEGV(dstr) = (GV*)dstr;
}
GvMULTI_on(dstr);
PL_compiling = proto_perl->Icompiling;
PL_compiling.cop_stash = hv_dup(PL_compiling.cop_stash);
- PL_compiling.cop_filegv = gv_dup(PL_compiling.cop_filegv);
+ PL_compiling.cop_file = SAVEPV(PL_compiling.cop_file);
PL_compiling.cop_warnings = sv_dup_inc(PL_compiling.cop_warnings);
if (proto_perl->Tcurcop == &proto_perl->Icompiling)
PL_curcop = &PL_compiling;
U8 xbm_rare; /* rarest character in string */
};
-/* This structure much match XPVCV */
+/* This structure much match XPVCV in cv.h */
typedef U16 cv_flags_t;
void (*xcv_xsub)(pTHXo_ CV*);
ANY xcv_xsubany;
GV * xcv_gv;
-#if defined(PERL_BINCOMPAT_5005)
- GV * xcv_filegv; /* XXX unused (and deprecated) */
-#endif
+ char * xcv_file;
long xcv_depth; /* >= 2 indicates recursive call */
AV * xcv_padlist;
CV * xcv_outside;
#ifdef CLINE
#undef CLINE
#endif
-#define CLINE (PL_copline = (PL_curcop->cop_line < PL_copline ? PL_curcop->cop_line : PL_copline))
+#define CLINE (PL_copline = (CopLINE(PL_curcop) < PL_copline ? CopLINE(PL_curcop) : PL_copline))
/*
* Convenience functions to return different tokens and prime the
SAVEI32(PL_lex_state);
SAVESPTR(PL_lex_inpat);
SAVEI32(PL_lex_inwhat);
- SAVEI16(PL_curcop->cop_line);
+ SAVECOPLINE(PL_curcop);
SAVEPPTR(PL_bufptr);
SAVEPPTR(PL_bufend);
SAVEPPTR(PL_oldbufptr);
* S_incline
* This subroutine has nothing to do with tilting, whether at windmills
* or pinball tables. Its name is short for "increment line". It
- * increments the current line number in PL_curcop->cop_line and checks
+ * increments the current line number in CopLINE(PL_curcop) and checks
* to see whether the line starts with a comment of the form
* # line 500 "foo.pm"
* If so, it sets the current line number and file to the values in the comment.
char ch;
int sawline = 0;
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
if (*s++ != '#')
return;
while (*s == ' ' || *s == '\t') s++;
ch = *t;
*t = '\0';
if (t - s > 0)
- CopFILEGV_set(PL_curcop, gv_fetchfile(s));
+ CopFILE_set(PL_curcop, s);
else
- CopFILEGV_set(PL_curcop, gv_fetchfile(PL_origfilename));
+ CopFILE_set(PL_curcop, PL_origfilename);
*t = ch;
- PL_curcop->cop_line = atoi(n)-1;
+ CopLINE_set(PL_curcop, atoi(n)-1);
}
/*
sv_upgrade(sv, SVt_PVMG);
sv_setpvn(sv,PL_bufptr,PL_bufend-PL_bufptr);
- av_store(CopFILEAV(PL_curcop),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
}
}
}
SAVEI32(PL_lex_state);
SAVESPTR(PL_lex_inpat);
SAVEI32(PL_lex_inwhat);
- SAVEI16(PL_curcop->cop_line);
+ SAVECOPLINE(PL_curcop);
SAVEPPTR(PL_bufptr);
SAVEPPTR(PL_oldbufptr);
SAVEPPTR(PL_oldoldbufptr);
*PL_lex_casestack = '\0';
PL_lex_starts = 0;
PL_lex_state = LEX_INTERPCONCAT;
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
PL_lex_inwhat = PL_sublex_info.sub_inwhat;
if (PL_lex_inwhat == OP_MATCH || PL_lex_inwhat == OP_QR || PL_lex_inwhat == OP_SUBST)
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(CopFILEAV(PL_curcop),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
}
goto retry;
}
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(CopFILEAV(PL_curcop),(I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop),(I32)CopLINE(PL_curcop),sv);
}
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
- if (PL_curcop->cop_line == 1) {
+ if (CopLINE(PL_curcop) == 1) {
while (s < PL_bufend && isSPACE(*s))
s++;
if (*s == ':' && s[1] != ':') /* for csh execing sh scripts */
PL_expect = XTERM;
TOKEN('(');
case ';':
- if (PL_curcop->cop_line < PL_copline)
- PL_copline = PL_curcop->cop_line;
+ if (CopLINE(PL_curcop) < PL_copline)
+ PL_copline = CopLINE(PL_curcop);
tmp = *s++;
OPERATOR(tmp);
case ')':
}
break;
}
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
if (isSPACE(*s) || *s == '#')
PL_copline = NOLINE; /* invalidate current command line number */
TOKEN('{');
s--;
if (PL_expect == XOPERATOR) {
if (ckWARN(WARN_SEMICOLON) && isIDFIRST_lazy(s) && PL_bufptr == PL_linestart) {
- PL_curcop->cop_line--;
+ CopLINE_dec(PL_curcop);
Perl_warner(aTHX_ WARN_SEMICOLON, PL_warn_nosemi);
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
BAop(OP_BIT_AND);
}
if (PL_expect == XOPERATOR) {
if (PL_bufptr == PL_linestart) {
- PL_curcop->cop_line--;
+ CopLINE_dec(PL_curcop);
Perl_warner(aTHX_ WARN_SEMICOLON, PL_warn_nosemi);
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
else
no_op("Bareword",s);
case KEY___LINE__:
yylval.opval = (OP*)newSVOP(OP_CONST, 0,
- Perl_newSVpvf(aTHX_ "%"IVdf, (IV)PL_curcop->cop_line));
+ Perl_newSVpvf(aTHX_ "%"IVdf, (IV)CopLINE(PL_curcop)));
TERM(THING);
case KEY___PACKAGE__:
PREBLOCK(ELSE);
case KEY_elsif:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(ELSIF);
case KEY_eq:
case KEY_for:
case KEY_foreach:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
s = skipspace(s);
if (PL_expect == XSTATE && isIDFIRST_lazy(s)) {
char *p = s;
UNI(OP_HEX);
case KEY_if:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(IF);
case KEY_index:
UNI(OP_UNTIE);
case KEY_until:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(UNTIL);
case KEY_unless:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(UNLESS);
case KEY_unlink:
LOP(OP_VEC,XTERM);
case KEY_while:
- yylval.ival = PL_curcop->cop_line;
+ yylval.ival = CopLINE(PL_curcop);
OPERATOR(WHILE);
case KEY_warn:
}
CLINE;
- PL_multi_start = PL_curcop->cop_line;
+ PL_multi_start = CopLINE(PL_curcop);
PL_multi_open = PL_multi_close = '<';
term = *PL_tokenbuf;
if (PL_lex_inwhat == OP_SUBST && PL_in_eval && !PL_rsfp) {
while (s < bufend &&
(*s != term || memNE(s,PL_tokenbuf,len)) ) {
if (*s++ == '\n')
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
if (s >= bufend) {
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(herewas,bufptr,d-bufptr+1);
while (s < PL_bufend &&
(*s != term || memNE(s,PL_tokenbuf,len)) ) {
if (*s++ == '\n')
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
}
if (s >= PL_bufend) {
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
missingterm(PL_tokenbuf);
}
sv_setpvn(tmpstr,d+1,s-d);
s += len - 1;
- PL_curcop->cop_line++; /* the preceding stmt passes a newline */
+ CopLINE_inc(PL_curcop); /* the preceding stmt passes a newline */
sv_catpvn(herewas,s,PL_bufend-s);
sv_setsv(PL_linestr,herewas);
while (s >= PL_bufend) { /* multiple line string? */
if (!outer ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
missingterm(PL_tokenbuf);
}
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
PL_bufend = SvPVX(PL_linestr) + SvCUR(PL_linestr);
#ifndef PERL_STRICT_CR
if (PL_bufend - PL_linestart >= 2) {
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(CopFILEAV(PL_curcop), (I32)PL_curcop->cop_line,sv);
+ av_store(CopFILEAV(PL_curcop), (I32)CopLINE(PL_curcop),sv);
}
if (*s == term && memEQ(s,PL_tokenbuf,len)) {
s = PL_bufend - 1;
}
s++;
retval:
- PL_multi_end = PL_curcop->cop_line;
+ PL_multi_end = CopLINE(PL_curcop);
if (SvCUR(tmpstr) + 5 < SvLEN(tmpstr)) {
SvLEN_set(tmpstr, SvCUR(tmpstr) + 1);
Renew(SvPVX(tmpstr), SvLEN(tmpstr), char);
/* after skipping whitespace, the next character is the terminator */
term = *s;
/* mark where we are */
- PL_multi_start = PL_curcop->cop_line;
+ PL_multi_start = CopLINE(PL_curcop);
PL_multi_open = term;
/* find corresponding closing delimiter */
for (; s < PL_bufend; s++,to++) {
/* embedded newlines increment the current line number */
if (*s == '\n' && !PL_rsfp)
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
/* handle quoted delimiters */
if (*s == '\\' && s+1 < PL_bufend && term != '\\') {
if (!keep_quoted && s[1] == term)
for (; s < PL_bufend; s++,to++) {
/* embedded newlines increment the line count */
if (*s == '\n' && !PL_rsfp)
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
/* backslashes can escape the open or closing characters */
if (*s == '\\' && s+1 < PL_bufend) {
if (!keep_quoted &&
if (!PL_rsfp ||
!(PL_oldoldbufptr = PL_oldbufptr = s = PL_linestart = filter_gets(PL_linestr, PL_rsfp, 0))) {
sv_free(sv);
- PL_curcop->cop_line = PL_multi_start;
+ CopLINE_set(PL_curcop, PL_multi_start);
return Nullch;
}
/* we read a line, so increment our line counter */
- PL_curcop->cop_line++;
+ CopLINE_inc(PL_curcop);
/* update debugger info */
if (PERLDB_LINE && PL_curstash != PL_debstash) {
sv_upgrade(sv, SVt_PVMG);
sv_setsv(sv,PL_linestr);
- av_store(CopFILEAV(PL_curcop), (I32)PL_curcop->cop_line, sv);
+ av_store(CopFILEAV(PL_curcop), (I32)CopLINE(PL_curcop), sv);
}
/* having changed the buffer, we must update PL_bufend */
if (keep_delims)
sv_catpvn(sv, s, 1);
- PL_multi_end = PL_curcop->cop_line;
+ PL_multi_end = CopLINE(PL_curcop);
s++;
/* if we allocated too much space, give some back */
PL_comppad_name_fill = 0;
PL_min_intro_pending = 0;
PL_padix = 0;
- PL_subline = PL_curcop->cop_line;
+ PL_subline = CopLINE(PL_curcop);
#ifdef USE_THREADS
av_store(PL_comppad_name, 0, newSVpvn("@_", 2));
PL_curpad[0] = (SV*)newAV();
}
msg = sv_2mortal(newSVpv(s, 0));
Perl_sv_catpvf(aTHX_ msg, " at %_ line %"IVdf", ",
- CopFILESV(PL_curcop), (IV)PL_curcop->cop_line);
+ CopFILESV(PL_curcop), (IV)CopLINE(PL_curcop));
if (context)
Perl_sv_catpvf(aTHX_ msg, "near \"%.*s\"\n", contlen, context);
else
Perl_sv_catpvf(aTHX_ msg, "%s\n", where);
- if (PL_multi_start < PL_multi_end && (U32)(PL_curcop->cop_line - PL_multi_end) <= 1) {
+ if (PL_multi_start < PL_multi_end && (U32)(CopLINE(PL_curcop) - PL_multi_end) <= 1) {
Perl_sv_catpvf(aTHX_ msg,
" (Might be a runaway multi-line %c%c string starting on line %"IVdf")\n",
(int)PL_multi_open,(int)PL_multi_close,(IV)PL_multi_start);
sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*));
if (!SvCUR(sv) || *(SvEND(sv) - 1) != '\n') {
dTHR;
- if (PL_curcop->cop_line)
+ if (CopLINE(PL_curcop))
Perl_sv_catpvf(aTHX_ sv, " at %_ line %"IVdf,
- CopFILESV(PL_curcop), (IV)PL_curcop->cop_line);
+ CopFILESV(PL_curcop), (IV)CopLINE(PL_curcop));
if (GvIO(PL_last_in_gv) && IoLINES(GvIOp(PL_last_in_gv))) {
bool line_mode = (RsSIMPLE(PL_rs) &&
SvCUR(PL_rs) == 1 && *SvPVX(PL_rs) == '\n');
* License or the Artistic License, as specified in the README file.
*
*/
+
+#ifdef VMS
+# define PERL_FILE_IS_ABSOLUTE(f) \
+ (*(f) == '/' \
+ || (strchr(f,':') \
+ || ((*(f) == '[' || *(f) == '<') \
+ && (isALNUM((f)[1]) || strchr("$-_]>",(f)[1])))))
+
+#else /* !VMS */
+# ifdef WIN32
+# define PERL_FILE_IS_ABSOLUTE(f) \
+ (*(f) == '/' \
+ || ((f)[0] && (f)[1] == ':') /* drive name */ \
+ || ((f)[0] == '\\' && (f)[1] == '\\')) /* UNC path */
+# else /* !WIN32 */
+# ifdef DOSISH
+# define PERL_FILE_IS_ABSOLUTE(f) \
+ (*(f) == '/' \
+ || ((f)[0] && (f)[1] == ':')) /* drive name */
+# else /* !DOSISH */
+# define PERL_FILE_IS_ABSOLUTE(f) (*(f) == '/')
+# endif /* DOSISH */
+# endif /* WIN32 */
+#endif /* VMS */
exitstatus = perl_parse(my_perl, xs_init, argc, argv, env);
if (!exitstatus) {
-#ifdef USE_ITHREADS /* XXXXXX testing */
+#if 0 /* def USE_ITHREADS */ /* XXXXXX testing */
extern PerlInterpreter * perl_clone(pTHXx_ IV flags);
PerlInterpreter *new_perl = perl_clone(my_perl, 0);