diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-11 06:04:20 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-11 06:04:20 +0000 |
commit | 57843af05bc7863df9b9bfb6b37e3a29d08532a9 (patch) | |
tree | afce7f3f9e5ac7d38a7578c9d040f161c686fe6b /ext | |
parent | 743e66e61aecff1c9998bd0ff719a1d679b03e9f (diff) | |
download | perl-57843af05bc7863df9b9bfb6b37e3a29d08532a9.tar.gz |
another change towards a shareable optree: avoid pointer to filegv
in COP; revert parts of change#4485 and s/xcv_filegv/xcv_file/
(CvFILE() may yet come in handy somewhere); adjust compiler doodads
to suit
p4raw-link: @4485 on //depot/perl: b195d4879f55e1610299cb9b1b55356940c2a577
p4raw-id: //depot/perl@4545
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/B.pm | 4 | ||||
-rw-r--r-- | ext/B/B.xs | 12 | ||||
-rw-r--r-- | ext/B/B/Asmdata.pm | 139 | ||||
-rw-r--r-- | ext/B/B/Bytecode.pm | 12 | ||||
-rw-r--r-- | ext/B/B/C.pm | 10 | ||||
-rw-r--r-- | ext/B/B/CC.pm | 4 | ||||
-rw-r--r-- | ext/B/B/Debug.pm | 10 | ||||
-rw-r--r-- | ext/B/B/Deparse.pm | 2 | ||||
-rw-r--r-- | ext/B/B/Lint.pm | 2 | ||||
-rw-r--r-- | ext/B/B/Xref.pm | 2 | ||||
-rw-r--r-- | ext/ByteLoader/bytecode.h | 2 | ||||
-rw-r--r-- | ext/ByteLoader/byterun.c | 153 | ||||
-rw-r--r-- | ext/ByteLoader/byterun.h | 141 | ||||
-rw-r--r-- | ext/Devel/Peek/Peek.pm | 1 |
14 files changed, 255 insertions, 239 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 224354c850..cef9ecbf6a 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -747,10 +747,10 @@ LOOP_lastop(o) #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_ @@ -763,8 +763,8 @@ B::HV COP_stash(o) B::COP o -B::GV -COP_filegv(o) +char * +COP_file(o) B::COP o U32 @@ -1153,6 +1153,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..7d37616228 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_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) { diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm index da8808a217..382a591e99 100644 --- a/ext/B/B/Bytecode.pm +++ b/ext/B/B/Bytecode.pm @@ -280,26 +280,25 @@ sub B::COP::bytecode { 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; } @@ -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..192ecefd28 100644 --- a/ext/B/B/C.pm +++ b/ext/B/B/C.pm @@ -293,9 +293,8 @@ 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,7 +302,7 @@ 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), + $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]"); } @@ -700,6 +699,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 +1011,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..7623e9b249 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->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 { @@ -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..7509b96b19 100644 --- a/ext/B/B/Deparse.pm +++ b/ext/B/B/Deparse.pm @@ -777,7 +777,7 @@ sub pp_nextstate { } 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; } diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index 5ca0d1afc6..77d93b035d 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -137,6 +137,8 @@ typedef IV IV64; 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 ? \ diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c index 264cb01e6a..f55feb758a 100644 --- a/ext/ByteLoader/byterun.c +++ b/ext/ByteLoader/byterun.c @@ -401,483 +401,490 @@ byterun(pTHXo_ struct bytestream bs) *(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); diff --git a/ext/ByteLoader/byterun.h b/ext/ByteLoader/byterun.h index 306df9cbd4..17560c858b 100644 --- a/ext/ByteLoader/byterun.h +++ b/ext/ByteLoader/byterun.h @@ -64,76 +64,77 @@ enum { 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 { diff --git a/ext/Devel/Peek/Peek.pm b/ext/Devel/Peek/Peek.pm index 4bac55fd31..2e990b0a3a 100644 --- a/ext/Devel/Peek/Peek.pm +++ b/ext/Devel/Peek/Peek.pm @@ -364,6 +364,7 @@ Looks like this: XSUB = 0x0 XSUBANY = 0 GVGV::GV = 0x1d44e8 "MY" :: "top_targets" + FILE = "(eval 5)" DEPTH = 0 PADLIST = 0x1c9338 |