summaryrefslogtreecommitdiff
path: root/ext/B
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>1999-11-11 19:48:21 +0000
committerJarkko Hietaniemi <jhi@iki.fi>1999-11-11 19:48:21 +0000
commit8a12f161a3a8b8cc9c866a9f342b9476fb0b9b95 (patch)
treef7d97a5034e7bcae78537a54f77a0067f572f6aa /ext/B
parent887d29384f0bc4b6197573ce19ff42abfe67fa51 (diff)
parent11faa288e292c27cb2ddc4ccdc483b523d26ce19 (diff)
downloadperl-8a12f161a3a8b8cc9c866a9f342b9476fb0b9b95.tar.gz
Integrate with Sarathy.
p4raw-id: //depot/cfgperl@4549
Diffstat (limited to 'ext/B')
-rw-r--r--ext/B/B.pm4
-rw-r--r--ext/B/B.xs19
-rw-r--r--ext/B/B/Asmdata.pm139
-rw-r--r--ext/B/B/Bytecode.pm18
-rw-r--r--ext/B/B/C.pm13
-rw-r--r--ext/B/B/CC.pm4
-rw-r--r--ext/B/B/Debug.pm12
-rw-r--r--ext/B/B/Deparse.pm4
-rw-r--r--ext/B/B/Lint.pm2
-rw-r--r--ext/B/B/Xref.pm2
10 files changed, 113 insertions, 104 deletions
diff --git a/ext/B/B.pm b/ext/B/B.pm
index bc6d6cbe69..6661ebac93 100644
--- a/ext/B/B.pm
+++ b/ext/B/B.pm
@@ -512,6 +512,8 @@ C<REFCNT> (corresponding to the C function C<SvREFCNT>).
=item GV
+=item FILE
+
=item DEPTH
=item PADLIST
@@ -688,7 +690,7 @@ This returns the op description from the global C PL_op_desc array
=item stash
-=item filegv
+=item file
=item cop_seq
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 731ae950dd..7d0fc742fc 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -746,11 +746,12 @@ LOOP_lastop(o)
B::LOOP o
#define COP_label(o) o->cop_label
-#define COP_stash(o) o->cop_stash
-#define COP_filegv(o) o->cop_filegv
+#define COP_stashpv(o) CopSTASHPV(o)
+#define COP_stash(o) CopSTASH(o)
+#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_
@@ -759,12 +760,16 @@ char *
COP_label(o)
B::COP o
+char *
+COP_stashpv(o)
+ B::COP o
+
B::HV
COP_stash(o)
B::COP o
-B::GV
-COP_filegv(o)
+char *
+COP_file(o)
B::COP o
U32
@@ -1153,6 +1158,10 @@ B::GV
CvGV(cv)
B::CV cv
+char *
+CvFILE(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 58d07c47d4..a7dbbe2026 100644
--- a/ext/B/B/Asmdata.pm
+++ b/ext/B/B/Asmdata.pm
@@ -68,75 +68,76 @@ $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_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_stashpv} = [109, \&PUT_pvcontents, "GET_pvcontents"];
+$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) {
diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm
index da8808a217..8764a0d588 100644
--- a/ext/B/B/Bytecode.pm
+++ b/ext/B/B/Bytecode.pm
@@ -278,28 +278,27 @@ sub B::LOOP::bytecode {
sub B::COP::bytecode {
my $op = shift;
- my $stash = $op->stash;
- my $stashix = $stash->objix;
- my $filegv = $op->filegv;
- my $filegvix = $filegv->objix;
+ my $stashpv = $op->stashpv;
+ 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), pvstring($stashpv), $op->cop_seq, pvstring($file), $op->arybase;
newpv %s
cop_label
-cop_stash $stashix
+newpv %s
+cop_stashpv
cop_seq %d
-cop_filegv $filegvix
+newpv %s
+cop_file
cop_arybase %d
cop_line $line
cop_warnings $warningsix
EOT
- $filegv->bytecode;
$stash->bytecode;
}
@@ -583,6 +582,7 @@ sub B::CV::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
diff --git a/ext/B/B/C.pm b/ext/B/B/C.pm
index f3318212b8..f8607444f4 100644
--- a/ext/B/B/C.pm
+++ b/ext/B/B/C.pm
@@ -293,9 +293,7 @@ sub B::COP::save {
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,
@@ -303,8 +301,8 @@ sub B::COP::save {
$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),
- sprintf("cop_list[%d].cop_stash = %s;", $copix, $stashsym));
+ $init->add(sprintf("CopFILE_set(&cop_list[%d], %s);", $copix, cstring($op->file)),
+ sprintf("CopSTASHPV_set(&cop_list[%d], %s);", $copix, cstring($op->stashpv));
savesym($op, "(OP*)&cop_list[$copix]");
}
@@ -700,6 +698,7 @@ sub B::CV::save {
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;
@@ -1011,9 +1010,7 @@ typedef struct {
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;
diff --git a/ext/B/B/CC.pm b/ext/B/B/CC.pm
index 1c31599dea..0fe5e7d8d5 100644
--- a/ext/B/B/CC.pm
+++ b/ext/B/B/CC.pm
@@ -374,7 +374,7 @@ sub dopoptolabel {
sub error {
my $format = shift;
- my $file = $curcop->[0]->filegv->SV->PV;
+ my $file = $curcop->[0]->file;
my $line = $curcop->[0]->line;
$errors++;
if (@_) {
@@ -598,7 +598,7 @@ sub pp_nextstate {
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) {
diff --git a/ext/B/B/Debug.pm b/ext/B/B/Debug.pm
index 732169f630..ae7a9733bc 100644
--- a/ext/B/B/Debug.pm
+++ b/ext/B/B/Debug.pm
@@ -60,17 +60,15 @@ sub B::PMOP::debug {
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->stashpv, $op->file, $op->seq, $op->arybase, $op->line, ${$op->warnings};
cop_label %s
- cop_stash 0x%x
- cop_filegv 0x%x
+ cop_stashpv %s
+ cop_file %s
cop_seq %d
cop_arybase %d
cop_line %d
cop_warnings 0x%x
EOT
- $filegv->debug;
}
sub B::SVOP::debug {
@@ -177,12 +175,14 @@ sub B::CV::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
diff --git a/ext/B/B/Deparse.pm b/ext/B/B/Deparse.pm
index c5d3ce9504..be7088e768 100644
--- a/ext/B/B/Deparse.pm
+++ b/ext/B/B/Deparse.pm
@@ -770,14 +770,14 @@ sub pp_nextstate {
and $seq > $self->{'subs_todo'}[0][0]) {
push @text, $self->next_todo;
}
- my $stash = $op->stash->NAME;
+ my $stash = $op->stashpv;
if ($stash ne $self->{'curstash'}) {
push @text, "package $stash;\n";
$self->{'curstash'} = $stash;
}
if ($self->{'linenums'}) {
push @text, "\f#line " . $op->line .
- ' "' . substr($op->filegv->NAME, 2), qq'"\n';
+ ' "' . $op->file, qq'"\n';
}
return join("", @text);
}
diff --git a/ext/B/B/Lint.pm b/ext/B/B/Lint.pm
index 41d3c5ae22..ed0d07dfcb 100644
--- a/ext/B/B/Lint.pm
+++ b/ext/B/B/Lint.pm
@@ -172,7 +172,7 @@ sub B::OP::lint {}
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;
}
diff --git a/ext/B/B/Xref.pm b/ext/B/B/Xref.pm
index f7cd64926d..53b655c82e 100644
--- a/ext/B/B/Xref.pm
+++ b/ext/B/B/Xref.pm
@@ -201,7 +201,7 @@ sub xref_main {
sub pp_nextstate {
my $op = shift;
- $file = $op->filegv->SV->PV;
+ $file = $op->file;
$line = $op->line;
$top = UNKNOWN;
}