diff options
-rw-r--r-- | bytecode.pl | 7 | ||||
-rw-r--r-- | ext/B/B/Asmdata.pm | 279 | ||||
-rw-r--r-- | ext/B/B/Assembler.pm | 3 | ||||
-rw-r--r-- | ext/B/B/Bytecode.pm | 211 | ||||
-rw-r--r-- | ext/B/B/Disassembler.pm | 7 | ||||
-rw-r--r-- | ext/B/defsubs_h.PL | 2 | ||||
-rw-r--r-- | ext/B/t/assembler.t | 5 | ||||
-rw-r--r-- | ext/ByteLoader/ByteLoader.pm | 2 | ||||
-rw-r--r-- | ext/ByteLoader/bytecode.h | 43 | ||||
-rw-r--r-- | ext/ByteLoader/byterun.c | 310 | ||||
-rw-r--r-- | ext/ByteLoader/byterun.h | 282 | ||||
-rwxr-xr-x | t/TEST | 8 |
12 files changed, 675 insertions, 484 deletions
diff --git a/bytecode.pl b/bytecode.pl index 1bcf95a6f6..1f30d9be3b 100644 --- a/bytecode.pl +++ b/bytecode.pl @@ -111,6 +111,7 @@ byterun(pTHX_ register struct byteloader_state *bstate) New(666, bstate->bs_obj_list, 32, void*); /* set op objlist */ bstate->bs_obj_list_fill = 31; bstate->bs_obj_list[0] = NULL; /* first is always Null */ + bstate->bs_ix = 1; EOT @@ -205,6 +206,7 @@ struct byteloader_state { SV *bs_sv; void **bs_obj_list; int bs_obj_list_fill; + int bs_ix; XPV bs_pv; int bs_iv_overflows; }; @@ -344,8 +346,11 @@ stsv bstate->bs_sv U32 s stop PL_op U32 s stpv bstate->bs_pv.xpv_pv U32 x ldspecsv bstate->bs_sv U8 x +ldspecsvx bstate->bs_sv U8 x newsv bstate->bs_sv U8 x +newsvx bstate->bs_sv U32 x newop PL_op U8 x +newopx PL_op U16 x newopn PL_op U8 x newpv none PV pv_cur bstate->bs_pv.xpv_cur STRLEN @@ -410,7 +415,9 @@ mg_name SvMAGIC(bstate->bs_sv) pvcontents x mg_namex SvMAGIC(bstate->bs_sv) svindex x xmg_stash *(SV**)&SvSTASH(bstate->bs_sv) svindex gv_fetchpv bstate->bs_sv strconst x +gv_fetchpvx bstate->bs_sv strconst x gv_stashpv bstate->bs_sv strconst x +gv_stashpvx bstate->bs_sv strconst x gp_sv GvSV(bstate->bs_sv) svindex gp_refcnt GvREFCNT(bstate->bs_sv) U32 gp_refcnt_add GvREFCNT(bstate->bs_sv) I32 x diff --git a/ext/B/B/Asmdata.pm b/ext/B/B/Asmdata.pm index a5ff59e22a..21b3364152 100644 --- a/ext/B/B/Asmdata.pm +++ b/ext/B/B/Asmdata.pm @@ -32,143 +32,148 @@ $insn_data{stsv} = [3, \&PUT_U32, "GET_U32"]; $insn_data{stop} = [4, \&PUT_U32, "GET_U32"]; $insn_data{stpv} = [5, \&PUT_U32, "GET_U32"]; $insn_data{ldspecsv} = [6, \&PUT_U8, "GET_U8"]; -$insn_data{newsv} = [7, \&PUT_U8, "GET_U8"]; -$insn_data{newop} = [8, \&PUT_U8, "GET_U8"]; -$insn_data{newopn} = [9, \&PUT_U8, "GET_U8"]; -$insn_data{newpv} = [11, \&PUT_PV, "GET_PV"]; -$insn_data{pv_cur} = [12, \&PUT_U32, "GET_U32"]; -$insn_data{pv_free} = [13, \&PUT_none, "GET_none"]; -$insn_data{sv_upgrade} = [14, \&PUT_U8, "GET_U8"]; -$insn_data{sv_refcnt} = [15, \&PUT_U32, "GET_U32"]; -$insn_data{sv_refcnt_add} = [16, \&PUT_I32, "GET_I32"]; -$insn_data{sv_flags} = [17, \&PUT_U32, "GET_U32"]; -$insn_data{xrv} = [18, \&PUT_svindex, "GET_svindex"]; -$insn_data{xpv} = [19, \&PUT_none, "GET_none"]; -$insn_data{xpv_cur} = [20, \&PUT_U32, "GET_U32"]; -$insn_data{xpv_len} = [21, \&PUT_U32, "GET_U32"]; -$insn_data{xiv} = [22, \&PUT_IV, "GET_IV"]; -$insn_data{xnv} = [23, \&PUT_NV, "GET_NV"]; -$insn_data{xlv_targoff} = [24, \&PUT_U32, "GET_U32"]; -$insn_data{xlv_targlen} = [25, \&PUT_U32, "GET_U32"]; -$insn_data{xlv_targ} = [26, \&PUT_svindex, "GET_svindex"]; -$insn_data{xlv_type} = [27, \&PUT_U8, "GET_U8"]; -$insn_data{xbm_useful} = [28, \&PUT_I32, "GET_I32"]; -$insn_data{xbm_previous} = [29, \&PUT_U16, "GET_U16"]; -$insn_data{xbm_rare} = [30, \&PUT_U8, "GET_U8"]; -$insn_data{xfm_lines} = [31, \&PUT_IV, "GET_IV"]; -$insn_data{xio_lines} = [32, \&PUT_IV, "GET_IV"]; -$insn_data{xio_page} = [33, \&PUT_IV, "GET_IV"]; -$insn_data{xio_page_len} = [34, \&PUT_IV, "GET_IV"]; -$insn_data{xio_lines_left} = [36, \&PUT_IV, "GET_IV"]; -$insn_data{xio_top_name} = [37, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{xio_top_gv} = [38, \&PUT_svindex, "GET_svindex"]; -$insn_data{xio_fmt_name} = [39, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{xio_fmt_gv} = [40, \&PUT_svindex, "GET_svindex"]; -$insn_data{xio_bottom_name} = [41, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{xio_bottom_gv} = [42, \&PUT_svindex, "GET_svindex"]; -$insn_data{xio_subprocess} = [43, \&PUT_U16, "GET_U16"]; -$insn_data{xio_type} = [44, \&PUT_U8, "GET_U8"]; -$insn_data{xio_flags} = [45, \&PUT_U8, "GET_U8"]; -$insn_data{xcv_xsubany} = [46, \&PUT_svindex, "GET_svindex"]; -$insn_data{xcv_stash} = [47, \&PUT_svindex, "GET_svindex"]; -$insn_data{xcv_start} = [48, \&PUT_opindex, "GET_opindex"]; -$insn_data{xcv_root} = [49, \&PUT_opindex, "GET_opindex"]; -$insn_data{xcv_gv} = [50, \&PUT_svindex, "GET_svindex"]; -$insn_data{xcv_file} = [51, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{xcv_depth} = [52, \&PUT_I32, "GET_I32"]; -$insn_data{xcv_padlist} = [53, \&PUT_svindex, "GET_svindex"]; -$insn_data{xcv_outside} = [54, \&PUT_svindex, "GET_svindex"]; -$insn_data{xcv_outside_seq} = [55, \&PUT_U32, "GET_U32"]; -$insn_data{xcv_flags} = [56, \&PUT_U16, "GET_U16"]; -$insn_data{av_extend} = [57, \&PUT_I32, "GET_I32"]; -$insn_data{av_pushx} = [58, \&PUT_svindex, "GET_svindex"]; -$insn_data{av_push} = [59, \&PUT_svindex, "GET_svindex"]; -$insn_data{xav_fill} = [60, \&PUT_I32, "GET_I32"]; -$insn_data{xav_max} = [61, \&PUT_I32, "GET_I32"]; -$insn_data{xav_flags} = [62, \&PUT_U8, "GET_U8"]; -$insn_data{xhv_riter} = [63, \&PUT_I32, "GET_I32"]; -$insn_data{xhv_name} = [64, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{xhv_pmroot} = [65, \&PUT_opindex, "GET_opindex"]; -$insn_data{hv_store} = [66, \&PUT_svindex, "GET_svindex"]; -$insn_data{sv_magic} = [67, \&PUT_U8, "GET_U8"]; -$insn_data{mg_obj} = [68, \&PUT_svindex, "GET_svindex"]; -$insn_data{mg_private} = [69, \&PUT_U16, "GET_U16"]; -$insn_data{mg_flags} = [70, \&PUT_U8, "GET_U8"]; -$insn_data{mg_name} = [71, \&PUT_pvcontents, "GET_pvcontents"]; -$insn_data{mg_namex} = [72, \&PUT_svindex, "GET_svindex"]; -$insn_data{xmg_stash} = [73, \&PUT_svindex, "GET_svindex"]; -$insn_data{gv_fetchpv} = [74, \&PUT_strconst, "GET_strconst"]; -$insn_data{gv_stashpv} = [75, \&PUT_strconst, "GET_strconst"]; -$insn_data{gp_sv} = [76, \&PUT_svindex, "GET_svindex"]; -$insn_data{gp_refcnt} = [77, \&PUT_U32, "GET_U32"]; -$insn_data{gp_refcnt_add} = [78, \&PUT_I32, "GET_I32"]; -$insn_data{gp_av} = [79, \&PUT_svindex, "GET_svindex"]; -$insn_data{gp_hv} = [80, \&PUT_svindex, "GET_svindex"]; -$insn_data{gp_cv} = [81, \&PUT_svindex, "GET_svindex"]; -$insn_data{gp_file} = [82, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{gp_io} = [83, \&PUT_svindex, "GET_svindex"]; -$insn_data{gp_form} = [84, \&PUT_svindex, "GET_svindex"]; -$insn_data{gp_cvgen} = [85, \&PUT_U32, "GET_U32"]; -$insn_data{gp_line} = [86, \&PUT_U32, "GET_U32"]; -$insn_data{gp_share} = [87, \&PUT_svindex, "GET_svindex"]; -$insn_data{xgv_flags} = [88, \&PUT_U8, "GET_U8"]; -$insn_data{op_next} = [89, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_sibling} = [90, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_ppaddr} = [91, \&PUT_strconst, "GET_strconst"]; -$insn_data{op_targ} = [92, \&PUT_U32, "GET_U32"]; -$insn_data{op_type} = [93, \&PUT_U16, "GET_U16"]; -$insn_data{op_seq} = [94, \&PUT_U16, "GET_U16"]; -$insn_data{op_flags} = [95, \&PUT_U8, "GET_U8"]; -$insn_data{op_private} = [96, \&PUT_U8, "GET_U8"]; -$insn_data{op_first} = [97, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_last} = [98, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_other} = [99, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_pmreplroot} = [100, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_pmreplstart} = [101, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_pmnext} = [102, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_pmstashpv} = [103, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{op_pmreplrootpo} = [104, \&PUT_U32, "GET_U32"]; -$insn_data{op_pmstash} = [105, \&PUT_svindex, "GET_svindex"]; -$insn_data{op_pmreplrootgv} = [106, \&PUT_svindex, "GET_svindex"]; -$insn_data{pregcomp} = [107, \&PUT_pvcontents, "GET_pvcontents"]; -$insn_data{op_pmflags} = [108, \&PUT_U16, "GET_U16"]; -$insn_data{op_pmpermflags} = [109, \&PUT_U16, "GET_U16"]; -$insn_data{op_pmdynflags} = [110, \&PUT_U8, "GET_U8"]; -$insn_data{op_sv} = [111, \&PUT_svindex, "GET_svindex"]; -$insn_data{op_padix} = [112, \&PUT_U32, "GET_U32"]; -$insn_data{op_pv} = [113, \&PUT_pvcontents, "GET_pvcontents"]; -$insn_data{op_pv_tr} = [114, \&PUT_op_tr_array, "GET_op_tr_array"]; -$insn_data{op_redoop} = [115, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_nextop} = [116, \&PUT_opindex, "GET_opindex"]; -$insn_data{op_lastop} = [117, \&PUT_opindex, "GET_opindex"]; -$insn_data{cop_label} = [118, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{cop_stashpv} = [119, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{cop_file} = [120, \&PUT_pvindex, "GET_pvindex"]; -$insn_data{cop_stash} = [121, \&PUT_svindex, "GET_svindex"]; -$insn_data{cop_filegv} = [122, \&PUT_svindex, "GET_svindex"]; -$insn_data{cop_seq} = [123, \&PUT_U32, "GET_U32"]; -$insn_data{cop_arybase} = [124, \&PUT_I32, "GET_I32"]; -$insn_data{cop_line} = [125, \&PUT_U32, "GET_U32"]; -$insn_data{cop_io} = [126, \&PUT_svindex, "GET_svindex"]; -$insn_data{cop_warnings} = [127, \&PUT_svindex, "GET_svindex"]; -$insn_data{main_start} = [128, \&PUT_opindex, "GET_opindex"]; -$insn_data{main_root} = [129, \&PUT_opindex, "GET_opindex"]; -$insn_data{main_cv} = [130, \&PUT_svindex, "GET_svindex"]; -$insn_data{curpad} = [131, \&PUT_svindex, "GET_svindex"]; -$insn_data{push_begin} = [132, \&PUT_svindex, "GET_svindex"]; -$insn_data{push_init} = [133, \&PUT_svindex, "GET_svindex"]; -$insn_data{push_end} = [134, \&PUT_svindex, "GET_svindex"]; -$insn_data{curstash} = [135, \&PUT_svindex, "GET_svindex"]; -$insn_data{defstash} = [136, \&PUT_svindex, "GET_svindex"]; -$insn_data{data} = [137, \&PUT_U8, "GET_U8"]; -$insn_data{incav} = [138, \&PUT_svindex, "GET_svindex"]; -$insn_data{load_glob} = [139, \&PUT_svindex, "GET_svindex"]; -$insn_data{regex_padav} = [140, \&PUT_svindex, "GET_svindex"]; -$insn_data{dowarn} = [141, \&PUT_U8, "GET_U8"]; -$insn_data{comppad_name} = [142, \&PUT_svindex, "GET_svindex"]; -$insn_data{xgv_stash} = [143, \&PUT_svindex, "GET_svindex"]; -$insn_data{signal} = [144, \&PUT_strconst, "GET_strconst"]; -$insn_data{formfeed} = [145, \&PUT_svindex, "GET_svindex"]; +$insn_data{ldspecsvx} = [7, \&PUT_U8, "GET_U8"]; +$insn_data{newsv} = [8, \&PUT_U8, "GET_U8"]; +$insn_data{newsvx} = [9, \&PUT_U32, "GET_U32"]; +$insn_data{newop} = [11, \&PUT_U8, "GET_U8"]; +$insn_data{newopx} = [12, \&PUT_U16, "GET_U16"]; +$insn_data{newopn} = [13, \&PUT_U8, "GET_U8"]; +$insn_data{newpv} = [14, \&PUT_PV, "GET_PV"]; +$insn_data{pv_cur} = [15, \&PUT_U32, "GET_U32"]; +$insn_data{pv_free} = [16, \&PUT_none, "GET_none"]; +$insn_data{sv_upgrade} = [17, \&PUT_U8, "GET_U8"]; +$insn_data{sv_refcnt} = [18, \&PUT_U32, "GET_U32"]; +$insn_data{sv_refcnt_add} = [19, \&PUT_I32, "GET_I32"]; +$insn_data{sv_flags} = [20, \&PUT_U32, "GET_U32"]; +$insn_data{xrv} = [21, \&PUT_svindex, "GET_svindex"]; +$insn_data{xpv} = [22, \&PUT_none, "GET_none"]; +$insn_data{xpv_cur} = [23, \&PUT_U32, "GET_U32"]; +$insn_data{xpv_len} = [24, \&PUT_U32, "GET_U32"]; +$insn_data{xiv} = [25, \&PUT_IV, "GET_IV"]; +$insn_data{xnv} = [26, \&PUT_NV, "GET_NV"]; +$insn_data{xlv_targoff} = [27, \&PUT_U32, "GET_U32"]; +$insn_data{xlv_targlen} = [28, \&PUT_U32, "GET_U32"]; +$insn_data{xlv_targ} = [29, \&PUT_svindex, "GET_svindex"]; +$insn_data{xlv_type} = [30, \&PUT_U8, "GET_U8"]; +$insn_data{xbm_useful} = [31, \&PUT_I32, "GET_I32"]; +$insn_data{xbm_previous} = [32, \&PUT_U16, "GET_U16"]; +$insn_data{xbm_rare} = [33, \&PUT_U8, "GET_U8"]; +$insn_data{xfm_lines} = [34, \&PUT_IV, "GET_IV"]; +$insn_data{xio_lines} = [36, \&PUT_IV, "GET_IV"]; +$insn_data{xio_page} = [37, \&PUT_IV, "GET_IV"]; +$insn_data{xio_page_len} = [38, \&PUT_IV, "GET_IV"]; +$insn_data{xio_lines_left} = [39, \&PUT_IV, "GET_IV"]; +$insn_data{xio_top_name} = [40, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{xio_top_gv} = [41, \&PUT_svindex, "GET_svindex"]; +$insn_data{xio_fmt_name} = [42, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{xio_fmt_gv} = [43, \&PUT_svindex, "GET_svindex"]; +$insn_data{xio_bottom_name} = [44, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{xio_bottom_gv} = [45, \&PUT_svindex, "GET_svindex"]; +$insn_data{xio_subprocess} = [46, \&PUT_U16, "GET_U16"]; +$insn_data{xio_type} = [47, \&PUT_U8, "GET_U8"]; +$insn_data{xio_flags} = [48, \&PUT_U8, "GET_U8"]; +$insn_data{xcv_xsubany} = [49, \&PUT_svindex, "GET_svindex"]; +$insn_data{xcv_stash} = [50, \&PUT_svindex, "GET_svindex"]; +$insn_data{xcv_start} = [51, \&PUT_opindex, "GET_opindex"]; +$insn_data{xcv_root} = [52, \&PUT_opindex, "GET_opindex"]; +$insn_data{xcv_gv} = [53, \&PUT_svindex, "GET_svindex"]; +$insn_data{xcv_file} = [54, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{xcv_depth} = [55, \&PUT_I32, "GET_I32"]; +$insn_data{xcv_padlist} = [56, \&PUT_svindex, "GET_svindex"]; +$insn_data{xcv_outside} = [57, \&PUT_svindex, "GET_svindex"]; +$insn_data{xcv_outside_seq} = [58, \&PUT_U32, "GET_U32"]; +$insn_data{xcv_flags} = [59, \&PUT_U16, "GET_U16"]; +$insn_data{av_extend} = [60, \&PUT_I32, "GET_I32"]; +$insn_data{av_pushx} = [61, \&PUT_svindex, "GET_svindex"]; +$insn_data{av_push} = [62, \&PUT_svindex, "GET_svindex"]; +$insn_data{xav_fill} = [63, \&PUT_I32, "GET_I32"]; +$insn_data{xav_max} = [64, \&PUT_I32, "GET_I32"]; +$insn_data{xav_flags} = [65, \&PUT_U8, "GET_U8"]; +$insn_data{xhv_riter} = [66, \&PUT_I32, "GET_I32"]; +$insn_data{xhv_name} = [67, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{xhv_pmroot} = [68, \&PUT_opindex, "GET_opindex"]; +$insn_data{hv_store} = [69, \&PUT_svindex, "GET_svindex"]; +$insn_data{sv_magic} = [70, \&PUT_U8, "GET_U8"]; +$insn_data{mg_obj} = [71, \&PUT_svindex, "GET_svindex"]; +$insn_data{mg_private} = [72, \&PUT_U16, "GET_U16"]; +$insn_data{mg_flags} = [73, \&PUT_U8, "GET_U8"]; +$insn_data{mg_name} = [74, \&PUT_pvcontents, "GET_pvcontents"]; +$insn_data{mg_namex} = [75, \&PUT_svindex, "GET_svindex"]; +$insn_data{xmg_stash} = [76, \&PUT_svindex, "GET_svindex"]; +$insn_data{gv_fetchpv} = [77, \&PUT_strconst, "GET_strconst"]; +$insn_data{gv_fetchpvx} = [78, \&PUT_strconst, "GET_strconst"]; +$insn_data{gv_stashpv} = [79, \&PUT_strconst, "GET_strconst"]; +$insn_data{gv_stashpvx} = [80, \&PUT_strconst, "GET_strconst"]; +$insn_data{gp_sv} = [81, \&PUT_svindex, "GET_svindex"]; +$insn_data{gp_refcnt} = [82, \&PUT_U32, "GET_U32"]; +$insn_data{gp_refcnt_add} = [83, \&PUT_I32, "GET_I32"]; +$insn_data{gp_av} = [84, \&PUT_svindex, "GET_svindex"]; +$insn_data{gp_hv} = [85, \&PUT_svindex, "GET_svindex"]; +$insn_data{gp_cv} = [86, \&PUT_svindex, "GET_svindex"]; +$insn_data{gp_file} = [87, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{gp_io} = [88, \&PUT_svindex, "GET_svindex"]; +$insn_data{gp_form} = [89, \&PUT_svindex, "GET_svindex"]; +$insn_data{gp_cvgen} = [90, \&PUT_U32, "GET_U32"]; +$insn_data{gp_line} = [91, \&PUT_U32, "GET_U32"]; +$insn_data{gp_share} = [92, \&PUT_svindex, "GET_svindex"]; +$insn_data{xgv_flags} = [93, \&PUT_U8, "GET_U8"]; +$insn_data{op_next} = [94, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_sibling} = [95, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_ppaddr} = [96, \&PUT_strconst, "GET_strconst"]; +$insn_data{op_targ} = [97, \&PUT_U32, "GET_U32"]; +$insn_data{op_type} = [98, \&PUT_U16, "GET_U16"]; +$insn_data{op_seq} = [99, \&PUT_U16, "GET_U16"]; +$insn_data{op_flags} = [100, \&PUT_U8, "GET_U8"]; +$insn_data{op_private} = [101, \&PUT_U8, "GET_U8"]; +$insn_data{op_first} = [102, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_last} = [103, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_other} = [104, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_pmreplroot} = [105, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_pmreplstart} = [106, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_pmnext} = [107, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_pmstashpv} = [108, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{op_pmreplrootpo} = [109, \&PUT_U32, "GET_U32"]; +$insn_data{op_pmstash} = [110, \&PUT_svindex, "GET_svindex"]; +$insn_data{op_pmreplrootgv} = [111, \&PUT_svindex, "GET_svindex"]; +$insn_data{pregcomp} = [112, \&PUT_pvcontents, "GET_pvcontents"]; +$insn_data{op_pmflags} = [113, \&PUT_U16, "GET_U16"]; +$insn_data{op_pmpermflags} = [114, \&PUT_U16, "GET_U16"]; +$insn_data{op_pmdynflags} = [115, \&PUT_U8, "GET_U8"]; +$insn_data{op_sv} = [116, \&PUT_svindex, "GET_svindex"]; +$insn_data{op_padix} = [117, \&PUT_U32, "GET_U32"]; +$insn_data{op_pv} = [118, \&PUT_pvcontents, "GET_pvcontents"]; +$insn_data{op_pv_tr} = [119, \&PUT_op_tr_array, "GET_op_tr_array"]; +$insn_data{op_redoop} = [120, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_nextop} = [121, \&PUT_opindex, "GET_opindex"]; +$insn_data{op_lastop} = [122, \&PUT_opindex, "GET_opindex"]; +$insn_data{cop_label} = [123, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{cop_stashpv} = [124, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{cop_file} = [125, \&PUT_pvindex, "GET_pvindex"]; +$insn_data{cop_stash} = [126, \&PUT_svindex, "GET_svindex"]; +$insn_data{cop_filegv} = [127, \&PUT_svindex, "GET_svindex"]; +$insn_data{cop_seq} = [128, \&PUT_U32, "GET_U32"]; +$insn_data{cop_arybase} = [129, \&PUT_I32, "GET_I32"]; +$insn_data{cop_line} = [130, \&PUT_U32, "GET_U32"]; +$insn_data{cop_io} = [131, \&PUT_svindex, "GET_svindex"]; +$insn_data{cop_warnings} = [132, \&PUT_svindex, "GET_svindex"]; +$insn_data{main_start} = [133, \&PUT_opindex, "GET_opindex"]; +$insn_data{main_root} = [134, \&PUT_opindex, "GET_opindex"]; +$insn_data{main_cv} = [135, \&PUT_svindex, "GET_svindex"]; +$insn_data{curpad} = [136, \&PUT_svindex, "GET_svindex"]; +$insn_data{push_begin} = [137, \&PUT_svindex, "GET_svindex"]; +$insn_data{push_init} = [138, \&PUT_svindex, "GET_svindex"]; +$insn_data{push_end} = [139, \&PUT_svindex, "GET_svindex"]; +$insn_data{curstash} = [140, \&PUT_svindex, "GET_svindex"]; +$insn_data{defstash} = [141, \&PUT_svindex, "GET_svindex"]; +$insn_data{data} = [142, \&PUT_U8, "GET_U8"]; +$insn_data{incav} = [143, \&PUT_svindex, "GET_svindex"]; +$insn_data{load_glob} = [144, \&PUT_svindex, "GET_svindex"]; +$insn_data{regex_padav} = [145, \&PUT_svindex, "GET_svindex"]; +$insn_data{dowarn} = [146, \&PUT_U8, "GET_U8"]; +$insn_data{comppad_name} = [147, \&PUT_svindex, "GET_svindex"]; +$insn_data{xgv_stash} = [148, \&PUT_svindex, "GET_svindex"]; +$insn_data{signal} = [149, \&PUT_strconst, "GET_strconst"]; +$insn_data{formfeed} = [150, \&PUT_svindex, "GET_svindex"]; my ($insn_name, $insn_data); while (($insn_name, $insn_data) = each %insn_data) { diff --git a/ext/B/B/Assembler.pm b/ext/B/B/Assembler.pm index 504f880a8b..218a6e740d 100644 --- a/ext/B/B/Assembler.pm +++ b/ext/B/B/Assembler.pm @@ -285,10 +285,9 @@ sub assemble { sub asm { return if $_[0] =~ /\s*\W/; if (defined $_[1]) { - return if $_[1] eq "0" and $_[0] !~ /^(?:newsv|av_pushx?|xav_flags)$/; + return if $_[1] eq "0" and $_[0] !~ /^(?:newsvx?|av_pushx?|xav_flags)$/; return if $_[1] eq "1" and $_[0] =~ /^(?:sv_refcnt)$/; } - # warn "@_\n"; assemble "@_"; } diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm index 164c10f0f9..c1fdb69fd4 100644 --- a/ext/B/B/Bytecode.pm +++ b/ext/B/B/Bytecode.pm @@ -54,8 +54,8 @@ sub B::OP::ix { my $ix = $optab{$$op}; defined($ix) ? $ix : do { nice '['.$op->name.']'; - asm "newop", $op->size; - asm "stop", $optab{$$op} = $opix = $ix = $tix++; + asm "newopx", $op->size | $op->type <<7; + $optab{$$op} = $opix = $ix = $tix++; $op->bsave($ix); $ix; } @@ -66,9 +66,8 @@ sub B::SPECIAL::ix { my $ix = $spectab{$$spec}; defined($ix) ? $ix : do { nice '['.$specialsv_name[$$spec].']'; - asm "ldspecsv", $$spec; - asm "stsv", $spectab{$$spec} = $varix = $tix; - $tix++; + asm "ldspecsvx", $$spec; + $spectab{$$spec} = $varix = $tix++; } } @@ -77,8 +76,8 @@ sub B::SV::ix { my $ix = $svtab{$$sv}; defined($ix) ? $ix : do { nice '['.class($sv).']'; - asm "newsv", $sv->SvTYPE; - asm "stsv", $svtab{$$sv} = $varix = $ix = $tix++; + asm "newsvx", $sv->FLAGS; + $svtab{$$sv} = $varix = $ix = $tix++; $sv->bsave($ix); $ix; } @@ -92,8 +91,8 @@ sub B::GV::ix { my ($svix, $avix, $hvix, $cvix, $ioix, $formix); nice "[GV]"; my $name = $gv->STASH->NAME . "::" . $gv->NAME; - asm "gv_fetchpv", cstring $name; - asm "stsv", $svtab{$$gv} = $varix = $ix = $tix++; + asm "gv_fetchpvx", cstring $name; + $svtab{$$gv} = $varix = $ix = $tix++; asm "sv_flags", $gv->FLAGS; asm "sv_refcnt", $gv->REFCNT; asm "xgv_flags", $gv->GvFLAGS; @@ -106,13 +105,14 @@ sub B::GV::ix { $avix = $gv->AV->ix; $hvix = $gv->HV->ix; - # TODO: kludge + # XXX {{{{ my $cv = $gv->CV; $cvix = $$cv && defined $files{$cv->FILE} ? $cv->ix : 0; my $form = $gv->FORM; $formix = $$form && defined $files{$form->FILE} ? $form->ix : 0; - $ioix = $name !~ /STDOUT$/ ? $gv->IO->ix : 0; # XXX + $ioix = $name !~ /STDOUT$/ ? $gv->IO->ix : 0; + # }}}} XXX nice "-GV-", asm "ldsv", $varix = $ix unless $ix == $varix; @@ -128,8 +128,8 @@ sub B::GV::ix { asm "formfeed", $svix if $name eq "main::\cL"; } else { nice "[GV]"; - asm "newsv", SVt_PVGV; - asm "stsv", $svtab{$$gv} = $varix = $ix = $tix++; + asm "newsvx", $gv->FLAGS; + $svtab{$$gv} = $varix = $ix = $tix++; my $stashix = $gv->STASH->ix; $gv->B::PVMG::bsave($ix); asm "xgv_flags", $gv->GvFLAGS; @@ -147,16 +147,17 @@ sub B::HV::ix { my $name = $hv->NAME; if ($name) { nice "[STASH]"; - asm "gv_stashpv", cstring $name; - asm "stsv", $svtab{$$hv} = $varix = $ix = $tix++; + asm "gv_stashpvx", cstring $name; + asm "sv_flags", $hv->FLAGS; + $svtab{$$hv} = $varix = $ix = $tix++; asm "xhv_name", pvix $name; # my $pmrootix = $hv->PMROOT->ix; # XXX asm "ldsv", $varix = $ix unless $ix == $varix; # asm "xhv_pmroot", $pmrootix; # XXX } else { nice "[HV]"; - asm "newsv", SVt_PVHV; - asm "stsv", $svtab{$$hv} = $varix = $ix = $tix++; + asm "newsvx", $hv->FLAGS; + $svtab{$$hv} = $varix = $ix = $tix++; my $stashix = $hv->SvSTASH->ix; for (@array = $hv->ARRAY) { next if $i = not $i; @@ -170,7 +171,6 @@ sub B::HV::ix { asm "xmg_stash", $stashix; } asm "sv_refcnt", $hv->REFCNT; - asm "sv_flags", $hv->FLAGS; $ix; } } @@ -190,7 +190,6 @@ sub B::NULL::bsave { nice '-'.class($sv).'-', asm "ldsv", $varix = $ix unless $ix == $varix; asm "sv_refcnt", $sv->REFCNT; - asm "sv_flags", $sv->FLAGS; } sub B::SV::bsave; @@ -316,12 +315,12 @@ sub B::IO::bsave { sub B::CV::bsave { my ($cv,$ix) = @_; my $stashix = $cv->STASH->ix; - my $startix = $cv->START->opwalk; - my $rootix = $cv->ROOT->ix; my $gvix = $cv->GV->ix; my $padlistix = $cv->PADLIST->ix; my $outsideix = $cv->OUTSIDE->ix; my $constix = $cv->CONST ? $cv->XSUBANY->ix : 0; + my $startix = $cv->START->opwalk; + my $rootix = $cv->ROOT->ix; $cv->B::PVMG::bsave($ix); asm "xcv_stash", $stashix; @@ -356,7 +355,6 @@ sub B::AV::bsave { asm "av_extend", $av->MAX; asm "av_pushx", $_ for @array; asm "sv_refcnt", $av->REFCNT; - asm "sv_flags", $av->FLAGS; asm "xav_flags", $av->AvFLAGS; asm "xmg_stash", $stashix; } @@ -382,9 +380,10 @@ sub B::HV::bwalk { $v->ix(1) if desired $v; } else { nice "[prototype]"; - asm "gv_fetchpv", cstring $hv->NAME . "::$k"; - asm "stsv", $svtab{$$v} = $varix = $tix; + asm "gv_fetchpvx", cstring $hv->NAME . "::$k"; + $svtab{$$v} = $varix = $tix; $v->bsave($tix++); + asm "sv_flags", $v->FLAGS; } } } @@ -401,7 +400,6 @@ sub B::OP::bsave_thin { nice '-'.$op->name.'-', asm "ldop", $opix = $ix; } - asm "op_type", $op->type; asm "op_next", $nextix; asm "op_targ", $op->targ if $op->type; # tricky asm "op_flags", $op->flags; @@ -419,7 +417,7 @@ sub B::UNOP::bsave { my $firstix = $name =~ /fl[io]p/ # that's just neat - || (!$ithreads && $name =~ /regcomp/) + || (!$ithreads && $name eq 'regcomp') # trick for /$a/o in pp_regcomp || $name eq 'rv2sv' && $op->flags & OPf_MOD @@ -432,8 +430,27 @@ sub B::UNOP::bsave { asm "op_first", $firstix; } -sub B::BINOP::bsave; - *B::BINOP::bsave = *B::OP::bsave; +sub B::BINOP::bsave { + my ($op, $ix) = @_; + if ($op->name eq 'aassign' && $op->private & B::OPpASSIGN_HASH()) { + my $last = $op->last; + my $lastix = do { + local *B::OP::bsave = *B::OP::bsave_fat; + local *B::UNOP::bsave = *B::UNOP::bsave_fat; + $last->ix; + }; + asm "ldop", $lastix unless $lastix == $opix; + asm "op_targ", $last->targ; + $op->B::OP::bsave($ix); + asm "op_last", $lastix; + } else { + $op->B::OP::bsave($ix); + } +} + +# not needed if no pseudohashes + +*B::BINOP::bsave = *B::OP::bsave if $] >= 5.009; # deal with sort / formline @@ -628,9 +645,16 @@ sub save_cq { } else { for ($av->ARRAY) { next unless $_->FILE eq $0; - # XXX BEGIN { exit while 1 } + # XXX BEGIN { goto A while 1; A: } for (my $op = $_->START; $$op; $op = $op->next) { - next unless $op->name =~ /require/; + next unless $op->name eq 'require' || + # this kludge needed for tests + $op->name eq 'gv' && do { + my $gv = class($op) eq 'SVOP' ? + $op->gv : + (($_->PADLIST->ARRAY)[1]->ARRAY)[$op->padix]; + $$gv && $gv->NAME =~ /use_ok|plan/ + }; asm "push_begin", $_->ix; last; } @@ -652,7 +676,7 @@ sub save_cq { } sub compile { - my ($head, $scan, $T_inhinc, $T_thatfile, $keep_syn); + my ($head, $scan, $T_inhinc, $keep_syn); my $cwd = ''; $files{$0} = 1; sub keep_syn { @@ -675,41 +699,36 @@ sub compile { } elsif (/^-k/) { keep_syn; } elsif (/^-o(.*)$/) { - my $ofile = $1; - open STDOUT, ">$ofile" or die "open $ofile: $!"; - *B::COP::file = sub { $ofile } if $T_thatfile; + open STDOUT, ">$1" or die "open $1: $!"; } elsif (/^-f(.*)$/) { $files{$1} = 1; - } elsif (/^-s/) { - $scan = 1; + } elsif (/^-s(.*)$/) { + $scan = length($1) ? $1 : $0; } elsif (/^-b/) { $savebegins = 1; - # these are here for the testsuite - } elsif (/^-TD(.*)/) { + # this is here for the testsuite + } elsif (/^-TI/) { $T_inhinc = 1; - $cwd = $1; - } elsif (/^-TF/) { - $T_thatfile = 1; + } elsif (/^-TF(.*)/) { + my $thatfile = $1; + *B::COP::file = sub { $thatfile }; } else { bwarn "Ignoring '$_' option"; } } if ($scan) { - for(keys %files) { - my $f; - # KLUDGE - open($f, $_) or open ($f, "$cwd/$_") - or bwarn("cannot rescan '$_'"), next; - while (<$f>) { - /^#\s*line\s+\d+\s+("?)(.*)\1/ and $files{$2} = 1; - /^#/ and next; - if (/\bgoto\b/ && !$keep_syn) { - bwarn "keeping the syntax tree: \"goto\" op found"; - keep_syn; - } + my $f; + open $f, $scan + or bwarn("cannot rescan '$_'"), next; + while (<$f>) { + /^#\s*line\s+\d+\s+("?)(.*)\1/ and $files{$2} = 1; + /^#/ and next; + if (/\bgoto\b/ && !$keep_syn) { + bwarn "keeping the syntax tree: \"goto\" op found"; + keep_syn; } - close $f; } + close $f; } binmode STDOUT; return sub { @@ -747,3 +766,87 @@ sub compile { } 1; + +=head1 NAME + +B::Bytecode - Perl compiler's bytecode backend + +=head1 SYNOPSIS + +B<perl -MO=Bytecode>[B<,-H>][B<,-o>I<script.plc>] I<script.pl> + +=head1 DESCRIPTION + +Compiles a Perl script into a bytecode format that could be loaded +later by the ByteLoader module and executed as a regular Perl script. + +=head1 EXAMPLE + + $ perl -MO=Bytecode,-H,-ohi -e 'print "hi!\n"' + $ perl hi + hi! + +=head1 OPTIONS + +=over 4 + +=item B<-b> + +Save all the BEGIN blocks. Normally only BEGIN blocks that C<require> +other files (ex. C<use Foo;>) are saved. + +=item B<-H> + +prepend a C<use ByteLoader VERSION;> line to the produced bytecode. + +=item B<-k> + +keep the syntax tree - it is stripped by default. + +=item B<-o>I<outfile> + +put the bytecode in <outfile> instead of dumping it to STDOUT. + +=item B<-s> + +scan the script for C<# line ..> directives and for <goto LABEL> +expressions. When gotos are found keep the syntax tree. + +=back + +=head1 KNOWN BUGS + +=over 4 + +=item * + +C<BEGIN { goto A: while 1; A: }> won't even compile. + +=item * + +C<?...?> and C<reset> do not work as expected. + +=item * + +variables in C<(?{ ... })> constructs are not properly scoped. + +=item * + +scripts that use source filters will fail miserably. + +=back + +=head1 NOTICE + +There are also undocumented bugs and options. + +THIS CODE IS HIGHLY EXPERIMENTAL. USE AT YOUR OWN RISK. + +=head1 AUTHORS + +Originally written by Malcolm Beattie <mbeattie@sable.ox.ac.uk> and +modified by Benjamin Stuhl <sho_pi@hotmail.com>. + +Rewritten by Enache Adrian <enache@rdslink.ro>, 2003 a.d. + +=cut diff --git a/ext/B/B/Disassembler.pm b/ext/B/B/Disassembler.pm index a563715371..fc115d498e 100644 --- a/ext/B/B/Disassembler.pm +++ b/ext/B/B/Disassembler.pm @@ -139,13 +139,14 @@ sub GET_op_tr_array { my $fh = shift; my $len = unpack "S", $fh->readn(2); my @ary = unpack "S*", $fh->readn($len*2); - return join(",", @ary); + return join(",", $len, @ary); } sub GET_IV64 { my $fh = shift; - my ($hi, $lo) = unpack("LL", $fh->readn(8)); - return sprintf("0x%x%08x", $hi, $lo); # cheat + my $str = $fh->readn(8); + croak "reached EOF while reading I32" unless length($str) == 8; + return sprintf "0x%09llx", unpack("q", $str); } sub GET_IV { diff --git a/ext/B/defsubs_h.PL b/ext/B/defsubs_h.PL index 81c1b49e73..4c6b4cbbd7 100644 --- a/ext/B/defsubs_h.PL +++ b/ext/B/defsubs_h.PL @@ -13,7 +13,7 @@ print OUT <<"END"; END foreach my $const (qw( - AVf_REAL + AVf_REAL HEf_SVKEY SVf_READONLY SVTYPEMASK GVf_IMPORTED_AV GVf_IMPORTED_HV diff --git a/ext/B/t/assembler.t b/ext/B/t/assembler.t index cd89232280..5e83f864be 100644 --- a/ext/B/t/assembler.t +++ b/ext/B/t/assembler.t @@ -159,7 +159,6 @@ BEGIN { print "1..0 # Skip -- Perl configured without ByteLoader module\n"; exit 0; } - print "1..0\n"; exit 0; } use B::Asmdata qw( %insn_data ); @@ -248,7 +247,7 @@ NV => [ 1.23456789E3 ], U16 => [ 0xffff, 0 ], pvcontents => [], strconst => [ '""', '"another string"' ], # no NUL -op_tr_array => [ join( ',', 0..255 ) ], +op_tr_array => [ join( ',', 256, 0..255 ) ], ); # Erronous operand values @@ -270,7 +269,7 @@ IV => $Config{ivsize} == 4 ? NV => undef, # PUT_NV accepts anything - it shouldn't, real-ly pvcontents => [ '"spurious arg"' ], strconst => [ 'no quote"', '"with NUL '."\0".' char"' ], # no NUL -op_tr_array => [ join( ',', 1..42 ) ], +op_tr_array => undef, # op_pv_tr is no longer exactly 256 shorts ); diff --git a/ext/ByteLoader/ByteLoader.pm b/ext/ByteLoader/ByteLoader.pm index 08a53a658e..fd16cf03f5 100644 --- a/ext/ByteLoader/ByteLoader.pm +++ b/ext/ByteLoader/ByteLoader.pm @@ -2,7 +2,7 @@ package ByteLoader; use XSLoader (); -our $VERSION = '0.04'; +our $VERSION = '0.05'; XSLoader::load 'ByteLoader', $VERSION; diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index 4602a68dc5..bd62b2848c 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -88,6 +88,11 @@ typedef char *pvindex; } STMT_END #define BSET_ldspecsv(sv, arg) sv = specialsv_list[arg] +#define BSET_ldspecsvx(sv, arg) STMT_START { \ + BSET_ldspecsv(sv, arg); \ + BSET_OBJ_STOREX(sv); \ + } STMT_END + #define BSET_stpv(pv, arg) STMT_START { \ BSET_OBJ_STORE(pv, arg); \ SAVEFREEPV(pv); \ @@ -101,7 +106,17 @@ typedef char *pvindex; } STMT_END #define BSET_gv_fetchpv(sv, arg) sv = (SV*)gv_fetchpv(arg, TRUE, SVt_PV) +#define BSET_gv_fetchpvx(sv, arg) STMT_START { \ + BSET_gv_fetchpv(sv, arg); \ + BSET_OBJ_STOREX(sv); \ + } STMT_END + #define BSET_gv_stashpv(sv, arg) sv = (SV*)gv_stashpv(arg, TRUE) +#define BSET_gv_stashpvx(sv, arg) STMT_START { \ + BSET_gv_stashpv(sv, arg); \ + BSET_OBJ_STOREX(sv); \ + } STMT_END + #define BSET_sv_magic(sv, arg) sv_magic(sv, Nullsv, arg, 0, 0) #define BSET_mg_name(mg, arg) mg->mg_ptr = arg; mg->mg_len = bstate->bs_pv.xpv_cur #define BSET_mg_namex(mg, arg) \ @@ -162,8 +177,24 @@ typedef char *pvindex; NEWSV(666,0)); \ SvUPGRADE(sv, arg); \ } STMT_END +#define BSET_newsvx(sv, arg) STMT_START { \ + BSET_newsv(sv, arg & SVTYPEMASK); \ + SvFLAGS(sv) = arg; \ + BSET_OBJ_STOREX(sv); \ + } STMT_END #define BSET_newop(o, arg) \ ((o = (OP*)safemalloc(arg)), memzero((char*)o,arg)) +#define BSET_newopx(o, arg) STMT_START { \ + register int sz = arg & 0x7f; \ + register OP* new = (OP*) safemalloc(sz);\ + memzero(new, sz); \ + /* new->op_next = o; XXX */ \ + o = new; \ + arg >>=7; \ + BSET_op_type(o, arg); \ + BSET_OBJ_STOREX(o); \ + } STMT_END + #define BSET_newopn(o, arg) STMT_START { \ OP *oldop = o; \ BSET_newop(o, arg); \ @@ -284,9 +315,15 @@ typedef char *pvindex; av_store(PL_endav, 0, cv); \ } STMT_END #define BSET_OBJ_STORE(obj, ix) \ - (I32)ix > bstate->bs_obj_list_fill ? \ - bset_obj_store(aTHX_ bstate, obj, (I32)ix) : \ - (bstate->bs_obj_list[ix] = obj) + ((I32)ix > bstate->bs_obj_list_fill ? \ + bset_obj_store(aTHX_ bstate, obj, (I32)ix) : \ + (bstate->bs_obj_list[ix] = obj), \ + bstate->bs_ix = ix+1) +#define BSET_OBJ_STOREX(obj) \ + (bstate->bs_ix > bstate->bs_obj_list_fill ? \ + bset_obj_store(aTHX_ bstate, obj, bstate->bs_ix) : \ + (bstate->bs_obj_list[bstate->bs_ix] = obj), \ + bstate->bs_ix++) #define BSET_signal(cv, name) \ mg_set(*hv_store(GvHV(gv_fetchpv("SIG", TRUE, SVt_PVHV)), \ diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c index d820ef8ec2..b29549e00f 100644 --- a/ext/ByteLoader/byterun.c +++ b/ext/ByteLoader/byterun.c @@ -55,6 +55,7 @@ byterun(pTHX_ register struct byteloader_state *bstate) New(666, bstate->bs_obj_list, 32, void*); /* set op objlist */ bstate->bs_obj_list_fill = 31; bstate->bs_obj_list[0] = NULL; /* first is always Null */ + bstate->bs_ix = 1; specialsv_list[0] = Nullsv; specialsv_list[1] = &PL_sv_undef; @@ -123,653 +124,688 @@ byterun(pTHX_ register struct byteloader_state *bstate) BSET_ldspecsv(bstate->bs_sv, arg); break; } - case INSN_NEWSV: /* 7 */ + case INSN_LDSPECSVX: /* 7 */ + { + U8 arg; + BGET_U8(arg); + BSET_ldspecsvx(bstate->bs_sv, arg); + break; + } + case INSN_NEWSV: /* 8 */ { U8 arg; BGET_U8(arg); BSET_newsv(bstate->bs_sv, arg); break; } - case INSN_NEWOP: /* 8 */ + case INSN_NEWSVX: /* 9 */ + { + U32 arg; + BGET_U32(arg); + BSET_newsvx(bstate->bs_sv, arg); + break; + } + case INSN_NEWOP: /* 11 */ { U8 arg; BGET_U8(arg); BSET_newop(PL_op, arg); break; } - case INSN_NEWOPN: /* 9 */ + case INSN_NEWOPX: /* 12 */ + { + U16 arg; + BGET_U16(arg); + BSET_newopx(PL_op, arg); + break; + } + case INSN_NEWOPN: /* 13 */ { U8 arg; BGET_U8(arg); BSET_newopn(PL_op, arg); break; } - case INSN_NEWPV: /* 11 */ + case INSN_NEWPV: /* 14 */ { PV arg; BGET_PV(arg); break; } - case INSN_PV_CUR: /* 12 */ + case INSN_PV_CUR: /* 15 */ { STRLEN arg; BGET_U32(arg); bstate->bs_pv.xpv_cur = arg; break; } - case INSN_PV_FREE: /* 13 */ + case INSN_PV_FREE: /* 16 */ { BSET_pv_free(bstate->bs_pv); break; } - case INSN_SV_UPGRADE: /* 14 */ + case INSN_SV_UPGRADE: /* 17 */ { U8 arg; BGET_U8(arg); BSET_sv_upgrade(bstate->bs_sv, arg); break; } - case INSN_SV_REFCNT: /* 15 */ + case INSN_SV_REFCNT: /* 18 */ { U32 arg; BGET_U32(arg); SvREFCNT(bstate->bs_sv) = arg; break; } - case INSN_SV_REFCNT_ADD: /* 16 */ + case INSN_SV_REFCNT_ADD: /* 19 */ { I32 arg; BGET_I32(arg); BSET_sv_refcnt_add(SvREFCNT(bstate->bs_sv), arg); break; } - case INSN_SV_FLAGS: /* 17 */ + case INSN_SV_FLAGS: /* 20 */ { U32 arg; BGET_U32(arg); SvFLAGS(bstate->bs_sv) = arg; break; } - case INSN_XRV: /* 18 */ + case INSN_XRV: /* 21 */ { svindex arg; BGET_svindex(arg); SvRV(bstate->bs_sv) = arg; break; } - case INSN_XPV: /* 19 */ + case INSN_XPV: /* 22 */ { BSET_xpv(bstate->bs_sv); break; } - case INSN_XPV_CUR: /* 20 */ + case INSN_XPV_CUR: /* 23 */ { STRLEN arg; BGET_U32(arg); SvCUR(bstate->bs_sv) = arg; break; } - case INSN_XPV_LEN: /* 21 */ + case INSN_XPV_LEN: /* 24 */ { STRLEN arg; BGET_U32(arg); SvLEN(bstate->bs_sv) = arg; break; } - case INSN_XIV: /* 22 */ + case INSN_XIV: /* 25 */ { IV arg; BGET_IV(arg); SvIVX(bstate->bs_sv) = arg; break; } - case INSN_XNV: /* 23 */ + case INSN_XNV: /* 26 */ { NV arg; BGET_NV(arg); SvNVX(bstate->bs_sv) = arg; break; } - case INSN_XLV_TARGOFF: /* 24 */ + case INSN_XLV_TARGOFF: /* 27 */ { STRLEN arg; BGET_U32(arg); LvTARGOFF(bstate->bs_sv) = arg; break; } - case INSN_XLV_TARGLEN: /* 25 */ + case INSN_XLV_TARGLEN: /* 28 */ { STRLEN arg; BGET_U32(arg); LvTARGLEN(bstate->bs_sv) = arg; break; } - case INSN_XLV_TARG: /* 26 */ + case INSN_XLV_TARG: /* 29 */ { svindex arg; BGET_svindex(arg); LvTARG(bstate->bs_sv) = arg; break; } - case INSN_XLV_TYPE: /* 27 */ + case INSN_XLV_TYPE: /* 30 */ { char arg; BGET_U8(arg); LvTYPE(bstate->bs_sv) = arg; break; } - case INSN_XBM_USEFUL: /* 28 */ + case INSN_XBM_USEFUL: /* 31 */ { I32 arg; BGET_I32(arg); BmUSEFUL(bstate->bs_sv) = arg; break; } - case INSN_XBM_PREVIOUS: /* 29 */ + case INSN_XBM_PREVIOUS: /* 32 */ { U16 arg; BGET_U16(arg); BmPREVIOUS(bstate->bs_sv) = arg; break; } - case INSN_XBM_RARE: /* 30 */ + case INSN_XBM_RARE: /* 33 */ { U8 arg; BGET_U8(arg); BmRARE(bstate->bs_sv) = arg; break; } - case INSN_XFM_LINES: /* 31 */ + case INSN_XFM_LINES: /* 34 */ { IV arg; BGET_IV(arg); FmLINES(bstate->bs_sv) = arg; break; } - case INSN_XIO_LINES: /* 32 */ + case INSN_XIO_LINES: /* 36 */ { IV arg; BGET_IV(arg); IoLINES(bstate->bs_sv) = arg; break; } - case INSN_XIO_PAGE: /* 33 */ + case INSN_XIO_PAGE: /* 37 */ { IV arg; BGET_IV(arg); IoPAGE(bstate->bs_sv) = arg; break; } - case INSN_XIO_PAGE_LEN: /* 34 */ + case INSN_XIO_PAGE_LEN: /* 38 */ { IV arg; BGET_IV(arg); IoPAGE_LEN(bstate->bs_sv) = arg; break; } - case INSN_XIO_LINES_LEFT: /* 36 */ + case INSN_XIO_LINES_LEFT: /* 39 */ { IV arg; BGET_IV(arg); IoLINES_LEFT(bstate->bs_sv) = arg; break; } - case INSN_XIO_TOP_NAME: /* 37 */ + case INSN_XIO_TOP_NAME: /* 40 */ { pvindex arg; BGET_pvindex(arg); IoTOP_NAME(bstate->bs_sv) = arg; break; } - case INSN_XIO_TOP_GV: /* 38 */ + case INSN_XIO_TOP_GV: /* 41 */ { svindex arg; BGET_svindex(arg); *(SV**)&IoTOP_GV(bstate->bs_sv) = arg; break; } - case INSN_XIO_FMT_NAME: /* 39 */ + case INSN_XIO_FMT_NAME: /* 42 */ { pvindex arg; BGET_pvindex(arg); IoFMT_NAME(bstate->bs_sv) = arg; break; } - case INSN_XIO_FMT_GV: /* 40 */ + case INSN_XIO_FMT_GV: /* 43 */ { svindex arg; BGET_svindex(arg); *(SV**)&IoFMT_GV(bstate->bs_sv) = arg; break; } - case INSN_XIO_BOTTOM_NAME: /* 41 */ + case INSN_XIO_BOTTOM_NAME: /* 44 */ { pvindex arg; BGET_pvindex(arg); IoBOTTOM_NAME(bstate->bs_sv) = arg; break; } - case INSN_XIO_BOTTOM_GV: /* 42 */ + case INSN_XIO_BOTTOM_GV: /* 45 */ { svindex arg; BGET_svindex(arg); *(SV**)&IoBOTTOM_GV(bstate->bs_sv) = arg; break; } - case INSN_XIO_SUBPROCESS: /* 43 */ + case INSN_XIO_SUBPROCESS: /* 46 */ { short arg; BGET_U16(arg); IoSUBPROCESS(bstate->bs_sv) = arg; break; } - case INSN_XIO_TYPE: /* 44 */ + case INSN_XIO_TYPE: /* 47 */ { char arg; BGET_U8(arg); IoTYPE(bstate->bs_sv) = arg; break; } - case INSN_XIO_FLAGS: /* 45 */ + case INSN_XIO_FLAGS: /* 48 */ { char arg; BGET_U8(arg); IoFLAGS(bstate->bs_sv) = arg; break; } - case INSN_XCV_XSUBANY: /* 46 */ + case INSN_XCV_XSUBANY: /* 49 */ { svindex arg; BGET_svindex(arg); *(SV**)&CvXSUBANY(bstate->bs_sv).any_ptr = arg; break; } - case INSN_XCV_STASH: /* 47 */ + case INSN_XCV_STASH: /* 50 */ { svindex arg; BGET_svindex(arg); *(SV**)&CvSTASH(bstate->bs_sv) = arg; break; } - case INSN_XCV_START: /* 48 */ + case INSN_XCV_START: /* 51 */ { opindex arg; BGET_opindex(arg); CvSTART(bstate->bs_sv) = arg; break; } - case INSN_XCV_ROOT: /* 49 */ + case INSN_XCV_ROOT: /* 52 */ { opindex arg; BGET_opindex(arg); CvROOT(bstate->bs_sv) = arg; break; } - case INSN_XCV_GV: /* 50 */ + case INSN_XCV_GV: /* 53 */ { svindex arg; BGET_svindex(arg); *(SV**)&CvGV(bstate->bs_sv) = arg; break; } - case INSN_XCV_FILE: /* 51 */ + case INSN_XCV_FILE: /* 54 */ { pvindex arg; BGET_pvindex(arg); CvFILE(bstate->bs_sv) = arg; break; } - case INSN_XCV_DEPTH: /* 52 */ + case INSN_XCV_DEPTH: /* 55 */ { long arg; BGET_I32(arg); CvDEPTH(bstate->bs_sv) = arg; break; } - case INSN_XCV_PADLIST: /* 53 */ + case INSN_XCV_PADLIST: /* 56 */ { svindex arg; BGET_svindex(arg); *(SV**)&CvPADLIST(bstate->bs_sv) = arg; break; } - case INSN_XCV_OUTSIDE: /* 54 */ + case INSN_XCV_OUTSIDE: /* 57 */ { svindex arg; BGET_svindex(arg); *(SV**)&CvOUTSIDE(bstate->bs_sv) = arg; break; } - case INSN_XCV_OUTSIDE_SEQ: /* 55 */ + case INSN_XCV_OUTSIDE_SEQ: /* 58 */ { U32 arg; BGET_U32(arg); CvOUTSIDE_SEQ(bstate->bs_sv) = arg; break; } - case INSN_XCV_FLAGS: /* 56 */ + case INSN_XCV_FLAGS: /* 59 */ { U16 arg; BGET_U16(arg); CvFLAGS(bstate->bs_sv) = arg; break; } - case INSN_AV_EXTEND: /* 57 */ + case INSN_AV_EXTEND: /* 60 */ { SSize_t arg; BGET_I32(arg); BSET_av_extend(bstate->bs_sv, arg); break; } - case INSN_AV_PUSHX: /* 58 */ + case INSN_AV_PUSHX: /* 61 */ { svindex arg; BGET_svindex(arg); BSET_av_pushx(bstate->bs_sv, arg); break; } - case INSN_AV_PUSH: /* 59 */ + case INSN_AV_PUSH: /* 62 */ { svindex arg; BGET_svindex(arg); BSET_av_push(bstate->bs_sv, arg); break; } - case INSN_XAV_FILL: /* 60 */ + case INSN_XAV_FILL: /* 63 */ { SSize_t arg; BGET_I32(arg); AvFILLp(bstate->bs_sv) = arg; break; } - case INSN_XAV_MAX: /* 61 */ + case INSN_XAV_MAX: /* 64 */ { SSize_t arg; BGET_I32(arg); AvMAX(bstate->bs_sv) = arg; break; } - case INSN_XAV_FLAGS: /* 62 */ + case INSN_XAV_FLAGS: /* 65 */ { U8 arg; BGET_U8(arg); AvFLAGS(bstate->bs_sv) = arg; break; } - case INSN_XHV_RITER: /* 63 */ + case INSN_XHV_RITER: /* 66 */ { I32 arg; BGET_I32(arg); HvRITER(bstate->bs_sv) = arg; break; } - case INSN_XHV_NAME: /* 64 */ + case INSN_XHV_NAME: /* 67 */ { pvindex arg; BGET_pvindex(arg); HvNAME(bstate->bs_sv) = arg; break; } - case INSN_XHV_PMROOT: /* 65 */ + case INSN_XHV_PMROOT: /* 68 */ { opindex arg; BGET_opindex(arg); *(OP**)&HvPMROOT(bstate->bs_sv) = arg; break; } - case INSN_HV_STORE: /* 66 */ + case INSN_HV_STORE: /* 69 */ { svindex arg; BGET_svindex(arg); BSET_hv_store(bstate->bs_sv, arg); break; } - case INSN_SV_MAGIC: /* 67 */ + case INSN_SV_MAGIC: /* 70 */ { char arg; BGET_U8(arg); BSET_sv_magic(bstate->bs_sv, arg); break; } - case INSN_MG_OBJ: /* 68 */ + case INSN_MG_OBJ: /* 71 */ { svindex arg; BGET_svindex(arg); SvMAGIC(bstate->bs_sv)->mg_obj = arg; break; } - case INSN_MG_PRIVATE: /* 69 */ + case INSN_MG_PRIVATE: /* 72 */ { U16 arg; BGET_U16(arg); SvMAGIC(bstate->bs_sv)->mg_private = arg; break; } - case INSN_MG_FLAGS: /* 70 */ + case INSN_MG_FLAGS: /* 73 */ { U8 arg; BGET_U8(arg); SvMAGIC(bstate->bs_sv)->mg_flags = arg; break; } - case INSN_MG_NAME: /* 71 */ + case INSN_MG_NAME: /* 74 */ { pvcontents arg; BGET_pvcontents(arg); BSET_mg_name(SvMAGIC(bstate->bs_sv), arg); break; } - case INSN_MG_NAMEX: /* 72 */ + case INSN_MG_NAMEX: /* 75 */ { svindex arg; BGET_svindex(arg); BSET_mg_namex(SvMAGIC(bstate->bs_sv), arg); break; } - case INSN_XMG_STASH: /* 73 */ + case INSN_XMG_STASH: /* 76 */ { svindex arg; BGET_svindex(arg); *(SV**)&SvSTASH(bstate->bs_sv) = arg; break; } - case INSN_GV_FETCHPV: /* 74 */ + case INSN_GV_FETCHPV: /* 77 */ { strconst arg; BGET_strconst(arg); BSET_gv_fetchpv(bstate->bs_sv, arg); break; } - case INSN_GV_STASHPV: /* 75 */ + case INSN_GV_FETCHPVX: /* 78 */ + { + strconst arg; + BGET_strconst(arg); + BSET_gv_fetchpvx(bstate->bs_sv, arg); + break; + } + case INSN_GV_STASHPV: /* 79 */ { strconst arg; BGET_strconst(arg); BSET_gv_stashpv(bstate->bs_sv, arg); break; } - case INSN_GP_SV: /* 76 */ + case INSN_GV_STASHPVX: /* 80 */ + { + strconst arg; + BGET_strconst(arg); + BSET_gv_stashpvx(bstate->bs_sv, arg); + break; + } + case INSN_GP_SV: /* 81 */ { svindex arg; BGET_svindex(arg); GvSV(bstate->bs_sv) = arg; break; } - case INSN_GP_REFCNT: /* 77 */ + case INSN_GP_REFCNT: /* 82 */ { U32 arg; BGET_U32(arg); GvREFCNT(bstate->bs_sv) = arg; break; } - case INSN_GP_REFCNT_ADD: /* 78 */ + case INSN_GP_REFCNT_ADD: /* 83 */ { I32 arg; BGET_I32(arg); BSET_gp_refcnt_add(GvREFCNT(bstate->bs_sv), arg); break; } - case INSN_GP_AV: /* 79 */ + case INSN_GP_AV: /* 84 */ { svindex arg; BGET_svindex(arg); *(SV**)&GvAV(bstate->bs_sv) = arg; break; } - case INSN_GP_HV: /* 80 */ + case INSN_GP_HV: /* 85 */ { svindex arg; BGET_svindex(arg); *(SV**)&GvHV(bstate->bs_sv) = arg; break; } - case INSN_GP_CV: /* 81 */ + case INSN_GP_CV: /* 86 */ { svindex arg; BGET_svindex(arg); *(SV**)&GvCV(bstate->bs_sv) = arg; break; } - case INSN_GP_FILE: /* 82 */ + case INSN_GP_FILE: /* 87 */ { pvindex arg; BGET_pvindex(arg); GvFILE(bstate->bs_sv) = arg; break; } - case INSN_GP_IO: /* 83 */ + case INSN_GP_IO: /* 88 */ { svindex arg; BGET_svindex(arg); *(SV**)&GvIOp(bstate->bs_sv) = arg; break; } - case INSN_GP_FORM: /* 84 */ + case INSN_GP_FORM: /* 89 */ { svindex arg; BGET_svindex(arg); *(SV**)&GvFORM(bstate->bs_sv) = arg; break; } - case INSN_GP_CVGEN: /* 85 */ + case INSN_GP_CVGEN: /* 90 */ { U32 arg; BGET_U32(arg); GvCVGEN(bstate->bs_sv) = arg; break; } - case INSN_GP_LINE: /* 86 */ + case INSN_GP_LINE: /* 91 */ { line_t arg; BGET_U32(arg); GvLINE(bstate->bs_sv) = arg; break; } - case INSN_GP_SHARE: /* 87 */ + case INSN_GP_SHARE: /* 92 */ { svindex arg; BGET_svindex(arg); BSET_gp_share(bstate->bs_sv, arg); break; } - case INSN_XGV_FLAGS: /* 88 */ + case INSN_XGV_FLAGS: /* 93 */ { U8 arg; BGET_U8(arg); GvFLAGS(bstate->bs_sv) = arg; break; } - case INSN_OP_NEXT: /* 89 */ + case INSN_OP_NEXT: /* 94 */ { opindex arg; BGET_opindex(arg); PL_op->op_next = arg; break; } - case INSN_OP_SIBLING: /* 90 */ + case INSN_OP_SIBLING: /* 95 */ { opindex arg; BGET_opindex(arg); PL_op->op_sibling = arg; break; } - case INSN_OP_PPADDR: /* 91 */ + case INSN_OP_PPADDR: /* 96 */ { strconst arg; BGET_strconst(arg); BSET_op_ppaddr(PL_op->op_ppaddr, arg); break; } - case INSN_OP_TARG: /* 92 */ + case INSN_OP_TARG: /* 97 */ { PADOFFSET arg; BGET_U32(arg); PL_op->op_targ = arg; break; } - case INSN_OP_TYPE: /* 93 */ + case INSN_OP_TYPE: /* 98 */ { OPCODE arg; BGET_U16(arg); BSET_op_type(PL_op, arg); break; } - case INSN_OP_SEQ: /* 94 */ + case INSN_OP_SEQ: /* 99 */ { U16 arg; BGET_U16(arg); PL_op->op_seq = arg; break; } - case INSN_OP_FLAGS: /* 95 */ + case INSN_OP_FLAGS: /* 100 */ { U8 arg; BGET_U8(arg); PL_op->op_flags = arg; break; } - case INSN_OP_PRIVATE: /* 96 */ + case INSN_OP_PRIVATE: /* 101 */ { U8 arg; BGET_U8(arg); PL_op->op_private = arg; break; } - case INSN_OP_FIRST: /* 97 */ + case INSN_OP_FIRST: /* 102 */ { opindex arg; BGET_opindex(arg); cUNOP->op_first = arg; break; } - case INSN_OP_LAST: /* 98 */ + case INSN_OP_LAST: /* 103 */ { opindex arg; BGET_opindex(arg); cBINOP->op_last = arg; break; } - case INSN_OP_OTHER: /* 99 */ + case INSN_OP_OTHER: /* 104 */ { opindex arg; BGET_opindex(arg); cLOGOP->op_other = arg; break; } - case INSN_OP_PMREPLROOT: /* 100 */ + case INSN_OP_PMREPLROOT: /* 105 */ { opindex arg; BGET_opindex(arg); cPMOP->op_pmreplroot = arg; break; } - case INSN_OP_PMREPLSTART: /* 101 */ + case INSN_OP_PMREPLSTART: /* 106 */ { opindex arg; BGET_opindex(arg); cPMOP->op_pmreplstart = arg; break; } - case INSN_OP_PMNEXT: /* 102 */ + case INSN_OP_PMNEXT: /* 107 */ { opindex arg; BGET_opindex(arg); @@ -777,14 +813,14 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #ifdef USE_ITHREADS - case INSN_OP_PMSTASHPV: /* 103 */ + case INSN_OP_PMSTASHPV: /* 108 */ { pvindex arg; BGET_pvindex(arg); cPMOP->op_pmstashpv = arg; break; } - case INSN_OP_PMREPLROOTPO: /* 104 */ + case INSN_OP_PMREPLROOTPO: /* 109 */ { PADOFFSET arg; BGET_U32(arg); @@ -792,14 +828,14 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #else - case INSN_OP_PMSTASH: /* 105 */ + case INSN_OP_PMSTASH: /* 110 */ { svindex arg; BGET_svindex(arg); *(SV**)&cPMOP->op_pmstash = arg; break; } - case INSN_OP_PMREPLROOTGV: /* 106 */ + case INSN_OP_PMREPLROOTGV: /* 111 */ { svindex arg; BGET_svindex(arg); @@ -807,84 +843,84 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #endif - case INSN_PREGCOMP: /* 107 */ + case INSN_PREGCOMP: /* 112 */ { pvcontents arg; BGET_pvcontents(arg); BSET_pregcomp(PL_op, arg); break; } - case INSN_OP_PMFLAGS: /* 108 */ + case INSN_OP_PMFLAGS: /* 113 */ { U16 arg; BGET_U16(arg); cPMOP->op_pmflags = arg; break; } - case INSN_OP_PMPERMFLAGS: /* 109 */ + case INSN_OP_PMPERMFLAGS: /* 114 */ { U16 arg; BGET_U16(arg); cPMOP->op_pmpermflags = arg; break; } - case INSN_OP_PMDYNFLAGS: /* 110 */ + case INSN_OP_PMDYNFLAGS: /* 115 */ { U8 arg; BGET_U8(arg); cPMOP->op_pmdynflags = arg; break; } - case INSN_OP_SV: /* 111 */ + case INSN_OP_SV: /* 116 */ { svindex arg; BGET_svindex(arg); cSVOP->op_sv = arg; break; } - case INSN_OP_PADIX: /* 112 */ + case INSN_OP_PADIX: /* 117 */ { PADOFFSET arg; BGET_U32(arg); cPADOP->op_padix = arg; break; } - case INSN_OP_PV: /* 113 */ + case INSN_OP_PV: /* 118 */ { pvcontents arg; BGET_pvcontents(arg); cPVOP->op_pv = arg; break; } - case INSN_OP_PV_TR: /* 114 */ + case INSN_OP_PV_TR: /* 119 */ { op_tr_array arg; BGET_op_tr_array(arg); cPVOP->op_pv = arg; break; } - case INSN_OP_REDOOP: /* 115 */ + case INSN_OP_REDOOP: /* 120 */ { opindex arg; BGET_opindex(arg); cLOOP->op_redoop = arg; break; } - case INSN_OP_NEXTOP: /* 116 */ + case INSN_OP_NEXTOP: /* 121 */ { opindex arg; BGET_opindex(arg); cLOOP->op_nextop = arg; break; } - case INSN_OP_LASTOP: /* 117 */ + case INSN_OP_LASTOP: /* 122 */ { opindex arg; BGET_opindex(arg); cLOOP->op_lastop = arg; break; } - case INSN_COP_LABEL: /* 118 */ + case INSN_COP_LABEL: /* 123 */ { pvindex arg; BGET_pvindex(arg); @@ -892,14 +928,14 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #ifdef USE_ITHREADS - case INSN_COP_STASHPV: /* 119 */ + case INSN_COP_STASHPV: /* 124 */ { pvindex arg; BGET_pvindex(arg); BSET_cop_stashpv(cCOP, arg); break; } - case INSN_COP_FILE: /* 120 */ + case INSN_COP_FILE: /* 125 */ { pvindex arg; BGET_pvindex(arg); @@ -907,14 +943,14 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #else - case INSN_COP_STASH: /* 121 */ + case INSN_COP_STASH: /* 126 */ { svindex arg; BGET_svindex(arg); BSET_cop_stash(cCOP, arg); break; } - case INSN_COP_FILEGV: /* 122 */ + case INSN_COP_FILEGV: /* 127 */ { svindex arg; BGET_svindex(arg); @@ -922,119 +958,119 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #endif - case INSN_COP_SEQ: /* 123 */ + case INSN_COP_SEQ: /* 128 */ { U32 arg; BGET_U32(arg); cCOP->cop_seq = arg; break; } - case INSN_COP_ARYBASE: /* 124 */ + case INSN_COP_ARYBASE: /* 129 */ { I32 arg; BGET_I32(arg); cCOP->cop_arybase = arg; break; } - case INSN_COP_LINE: /* 125 */ + case INSN_COP_LINE: /* 130 */ { line_t arg; BGET_U32(arg); cCOP->cop_line = arg; break; } - case INSN_COP_IO: /* 126 */ + case INSN_COP_IO: /* 131 */ { svindex arg; BGET_svindex(arg); cCOP->cop_io = arg; break; } - case INSN_COP_WARNINGS: /* 127 */ + case INSN_COP_WARNINGS: /* 132 */ { svindex arg; BGET_svindex(arg); cCOP->cop_warnings = arg; break; } - case INSN_MAIN_START: /* 128 */ + case INSN_MAIN_START: /* 133 */ { opindex arg; BGET_opindex(arg); PL_main_start = arg; break; } - case INSN_MAIN_ROOT: /* 129 */ + case INSN_MAIN_ROOT: /* 134 */ { opindex arg; BGET_opindex(arg); PL_main_root = arg; break; } - case INSN_MAIN_CV: /* 130 */ + case INSN_MAIN_CV: /* 135 */ { svindex arg; BGET_svindex(arg); *(SV**)&PL_main_cv = arg; break; } - case INSN_CURPAD: /* 131 */ + case INSN_CURPAD: /* 136 */ { svindex arg; BGET_svindex(arg); BSET_curpad(PL_curpad, arg); break; } - case INSN_PUSH_BEGIN: /* 132 */ + case INSN_PUSH_BEGIN: /* 137 */ { svindex arg; BGET_svindex(arg); BSET_push_begin(PL_beginav, arg); break; } - case INSN_PUSH_INIT: /* 133 */ + case INSN_PUSH_INIT: /* 138 */ { svindex arg; BGET_svindex(arg); BSET_push_init(PL_initav, arg); break; } - case INSN_PUSH_END: /* 134 */ + case INSN_PUSH_END: /* 139 */ { svindex arg; BGET_svindex(arg); BSET_push_end(PL_endav, arg); break; } - case INSN_CURSTASH: /* 135 */ + case INSN_CURSTASH: /* 140 */ { svindex arg; BGET_svindex(arg); *(SV**)&PL_curstash = arg; break; } - case INSN_DEFSTASH: /* 136 */ + case INSN_DEFSTASH: /* 141 */ { svindex arg; BGET_svindex(arg); *(SV**)&PL_defstash = arg; break; } - case INSN_DATA: /* 137 */ + case INSN_DATA: /* 142 */ { U8 arg; BGET_U8(arg); BSET_data(none, arg); break; } - case INSN_INCAV: /* 138 */ + case INSN_INCAV: /* 143 */ { svindex arg; BGET_svindex(arg); *(SV**)&PL_incgv = arg; break; } - case INSN_LOAD_GLOB: /* 139 */ + case INSN_LOAD_GLOB: /* 144 */ { svindex arg; BGET_svindex(arg); @@ -1042,7 +1078,7 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #ifdef USE_ITHREADS - case INSN_REGEX_PADAV: /* 140 */ + case INSN_REGEX_PADAV: /* 145 */ { svindex arg; BGET_svindex(arg); @@ -1050,35 +1086,35 @@ byterun(pTHX_ register struct byteloader_state *bstate) break; } #endif - case INSN_DOWARN: /* 141 */ + case INSN_DOWARN: /* 146 */ { U8 arg; BGET_U8(arg); PL_dowarn = arg; break; } - case INSN_COMPPAD_NAME: /* 142 */ + case INSN_COMPPAD_NAME: /* 147 */ { svindex arg; BGET_svindex(arg); *(SV**)&PL_comppad_name = arg; break; } - case INSN_XGV_STASH: /* 143 */ + case INSN_XGV_STASH: /* 148 */ { svindex arg; BGET_svindex(arg); *(SV**)&GvSTASH(bstate->bs_sv) = arg; break; } - case INSN_SIGNAL: /* 144 */ + case INSN_SIGNAL: /* 149 */ { strconst arg; BGET_strconst(arg); BSET_signal(bstate->bs_sv, arg); break; } - case INSN_FORMFEED: /* 145 */ + case INSN_FORMFEED: /* 150 */ { svindex arg; BGET_svindex(arg); diff --git a/ext/ByteLoader/byterun.h b/ext/ByteLoader/byterun.h index 6ab4425fc7..6e28693963 100644 --- a/ext/ByteLoader/byterun.h +++ b/ext/ByteLoader/byterun.h @@ -19,6 +19,7 @@ struct byteloader_state { SV *bs_sv; void **bs_obj_list; int bs_obj_list_fill; + int bs_ix; XPV bs_pv; int bs_iv_overflows; }; @@ -35,146 +36,151 @@ enum { INSN_STOP, /* 4 */ INSN_STPV, /* 5 */ INSN_LDSPECSV, /* 6 */ - INSN_NEWSV, /* 7 */ - INSN_NEWOP, /* 8 */ - INSN_NEWOPN, /* 9 */ + INSN_LDSPECSVX, /* 7 */ + INSN_NEWSV, /* 8 */ + INSN_NEWSVX, /* 9 */ INSN_NOP, /* 10 */ - INSN_NEWPV, /* 11 */ - INSN_PV_CUR, /* 12 */ - INSN_PV_FREE, /* 13 */ - INSN_SV_UPGRADE, /* 14 */ - INSN_SV_REFCNT, /* 15 */ - INSN_SV_REFCNT_ADD, /* 16 */ - INSN_SV_FLAGS, /* 17 */ - INSN_XRV, /* 18 */ - INSN_XPV, /* 19 */ - INSN_XPV_CUR, /* 20 */ - INSN_XPV_LEN, /* 21 */ - INSN_XIV, /* 22 */ - INSN_XNV, /* 23 */ - INSN_XLV_TARGOFF, /* 24 */ - INSN_XLV_TARGLEN, /* 25 */ - INSN_XLV_TARG, /* 26 */ - INSN_XLV_TYPE, /* 27 */ - INSN_XBM_USEFUL, /* 28 */ - INSN_XBM_PREVIOUS, /* 29 */ - INSN_XBM_RARE, /* 30 */ - INSN_XFM_LINES, /* 31 */ - INSN_XIO_LINES, /* 32 */ - INSN_XIO_PAGE, /* 33 */ - INSN_XIO_PAGE_LEN, /* 34 */ + INSN_NEWOP, /* 11 */ + INSN_NEWOPX, /* 12 */ + INSN_NEWOPN, /* 13 */ + INSN_NEWPV, /* 14 */ + INSN_PV_CUR, /* 15 */ + INSN_PV_FREE, /* 16 */ + INSN_SV_UPGRADE, /* 17 */ + INSN_SV_REFCNT, /* 18 */ + INSN_SV_REFCNT_ADD, /* 19 */ + INSN_SV_FLAGS, /* 20 */ + INSN_XRV, /* 21 */ + INSN_XPV, /* 22 */ + INSN_XPV_CUR, /* 23 */ + INSN_XPV_LEN, /* 24 */ + INSN_XIV, /* 25 */ + INSN_XNV, /* 26 */ + INSN_XLV_TARGOFF, /* 27 */ + INSN_XLV_TARGLEN, /* 28 */ + INSN_XLV_TARG, /* 29 */ + INSN_XLV_TYPE, /* 30 */ + INSN_XBM_USEFUL, /* 31 */ + INSN_XBM_PREVIOUS, /* 32 */ + INSN_XBM_RARE, /* 33 */ + INSN_XFM_LINES, /* 34 */ INSN_COMMENT, /* 35 */ - INSN_XIO_LINES_LEFT, /* 36 */ - INSN_XIO_TOP_NAME, /* 37 */ - INSN_XIO_TOP_GV, /* 38 */ - INSN_XIO_FMT_NAME, /* 39 */ - INSN_XIO_FMT_GV, /* 40 */ - INSN_XIO_BOTTOM_NAME, /* 41 */ - INSN_XIO_BOTTOM_GV, /* 42 */ - INSN_XIO_SUBPROCESS, /* 43 */ - INSN_XIO_TYPE, /* 44 */ - INSN_XIO_FLAGS, /* 45 */ - INSN_XCV_XSUBANY, /* 46 */ - INSN_XCV_STASH, /* 47 */ - INSN_XCV_START, /* 48 */ - INSN_XCV_ROOT, /* 49 */ - INSN_XCV_GV, /* 50 */ - INSN_XCV_FILE, /* 51 */ - INSN_XCV_DEPTH, /* 52 */ - INSN_XCV_PADLIST, /* 53 */ - INSN_XCV_OUTSIDE, /* 54 */ - INSN_XCV_OUTSIDE_SEQ, /* 55 */ - INSN_XCV_FLAGS, /* 56 */ - INSN_AV_EXTEND, /* 57 */ - INSN_AV_PUSHX, /* 58 */ - INSN_AV_PUSH, /* 59 */ - INSN_XAV_FILL, /* 60 */ - INSN_XAV_MAX, /* 61 */ - INSN_XAV_FLAGS, /* 62 */ - INSN_XHV_RITER, /* 63 */ - INSN_XHV_NAME, /* 64 */ - INSN_XHV_PMROOT, /* 65 */ - INSN_HV_STORE, /* 66 */ - INSN_SV_MAGIC, /* 67 */ - INSN_MG_OBJ, /* 68 */ - INSN_MG_PRIVATE, /* 69 */ - INSN_MG_FLAGS, /* 70 */ - INSN_MG_NAME, /* 71 */ - INSN_MG_NAMEX, /* 72 */ - INSN_XMG_STASH, /* 73 */ - INSN_GV_FETCHPV, /* 74 */ - INSN_GV_STASHPV, /* 75 */ - INSN_GP_SV, /* 76 */ - INSN_GP_REFCNT, /* 77 */ - INSN_GP_REFCNT_ADD, /* 78 */ - INSN_GP_AV, /* 79 */ - INSN_GP_HV, /* 80 */ - INSN_GP_CV, /* 81 */ - INSN_GP_FILE, /* 82 */ - INSN_GP_IO, /* 83 */ - INSN_GP_FORM, /* 84 */ - INSN_GP_CVGEN, /* 85 */ - INSN_GP_LINE, /* 86 */ - INSN_GP_SHARE, /* 87 */ - INSN_XGV_FLAGS, /* 88 */ - INSN_OP_NEXT, /* 89 */ - INSN_OP_SIBLING, /* 90 */ - INSN_OP_PPADDR, /* 91 */ - INSN_OP_TARG, /* 92 */ - INSN_OP_TYPE, /* 93 */ - INSN_OP_SEQ, /* 94 */ - INSN_OP_FLAGS, /* 95 */ - INSN_OP_PRIVATE, /* 96 */ - INSN_OP_FIRST, /* 97 */ - INSN_OP_LAST, /* 98 */ - INSN_OP_OTHER, /* 99 */ - INSN_OP_PMREPLROOT, /* 100 */ - INSN_OP_PMREPLSTART, /* 101 */ - INSN_OP_PMNEXT, /* 102 */ - INSN_OP_PMSTASHPV, /* 103 */ - INSN_OP_PMREPLROOTPO, /* 104 */ - INSN_OP_PMSTASH, /* 105 */ - INSN_OP_PMREPLROOTGV, /* 106 */ - INSN_PREGCOMP, /* 107 */ - INSN_OP_PMFLAGS, /* 108 */ - INSN_OP_PMPERMFLAGS, /* 109 */ - INSN_OP_PMDYNFLAGS, /* 110 */ - INSN_OP_SV, /* 111 */ - INSN_OP_PADIX, /* 112 */ - INSN_OP_PV, /* 113 */ - INSN_OP_PV_TR, /* 114 */ - INSN_OP_REDOOP, /* 115 */ - INSN_OP_NEXTOP, /* 116 */ - INSN_OP_LASTOP, /* 117 */ - INSN_COP_LABEL, /* 118 */ - INSN_COP_STASHPV, /* 119 */ - INSN_COP_FILE, /* 120 */ - INSN_COP_STASH, /* 121 */ - INSN_COP_FILEGV, /* 122 */ - INSN_COP_SEQ, /* 123 */ - INSN_COP_ARYBASE, /* 124 */ - INSN_COP_LINE, /* 125 */ - INSN_COP_IO, /* 126 */ - INSN_COP_WARNINGS, /* 127 */ - INSN_MAIN_START, /* 128 */ - INSN_MAIN_ROOT, /* 129 */ - INSN_MAIN_CV, /* 130 */ - INSN_CURPAD, /* 131 */ - INSN_PUSH_BEGIN, /* 132 */ - INSN_PUSH_INIT, /* 133 */ - INSN_PUSH_END, /* 134 */ - INSN_CURSTASH, /* 135 */ - INSN_DEFSTASH, /* 136 */ - INSN_DATA, /* 137 */ - INSN_INCAV, /* 138 */ - INSN_LOAD_GLOB, /* 139 */ - INSN_REGEX_PADAV, /* 140 */ - INSN_DOWARN, /* 141 */ - INSN_COMPPAD_NAME, /* 142 */ - INSN_XGV_STASH, /* 143 */ - INSN_SIGNAL, /* 144 */ - INSN_FORMFEED, /* 145 */ - MAX_INSN = 145 + INSN_XIO_LINES, /* 36 */ + INSN_XIO_PAGE, /* 37 */ + INSN_XIO_PAGE_LEN, /* 38 */ + INSN_XIO_LINES_LEFT, /* 39 */ + INSN_XIO_TOP_NAME, /* 40 */ + INSN_XIO_TOP_GV, /* 41 */ + INSN_XIO_FMT_NAME, /* 42 */ + INSN_XIO_FMT_GV, /* 43 */ + INSN_XIO_BOTTOM_NAME, /* 44 */ + INSN_XIO_BOTTOM_GV, /* 45 */ + INSN_XIO_SUBPROCESS, /* 46 */ + INSN_XIO_TYPE, /* 47 */ + INSN_XIO_FLAGS, /* 48 */ + INSN_XCV_XSUBANY, /* 49 */ + INSN_XCV_STASH, /* 50 */ + INSN_XCV_START, /* 51 */ + INSN_XCV_ROOT, /* 52 */ + INSN_XCV_GV, /* 53 */ + INSN_XCV_FILE, /* 54 */ + INSN_XCV_DEPTH, /* 55 */ + INSN_XCV_PADLIST, /* 56 */ + INSN_XCV_OUTSIDE, /* 57 */ + INSN_XCV_OUTSIDE_SEQ, /* 58 */ + INSN_XCV_FLAGS, /* 59 */ + INSN_AV_EXTEND, /* 60 */ + INSN_AV_PUSHX, /* 61 */ + INSN_AV_PUSH, /* 62 */ + INSN_XAV_FILL, /* 63 */ + INSN_XAV_MAX, /* 64 */ + INSN_XAV_FLAGS, /* 65 */ + INSN_XHV_RITER, /* 66 */ + INSN_XHV_NAME, /* 67 */ + INSN_XHV_PMROOT, /* 68 */ + INSN_HV_STORE, /* 69 */ + INSN_SV_MAGIC, /* 70 */ + INSN_MG_OBJ, /* 71 */ + INSN_MG_PRIVATE, /* 72 */ + INSN_MG_FLAGS, /* 73 */ + INSN_MG_NAME, /* 74 */ + INSN_MG_NAMEX, /* 75 */ + INSN_XMG_STASH, /* 76 */ + INSN_GV_FETCHPV, /* 77 */ + INSN_GV_FETCHPVX, /* 78 */ + INSN_GV_STASHPV, /* 79 */ + INSN_GV_STASHPVX, /* 80 */ + INSN_GP_SV, /* 81 */ + INSN_GP_REFCNT, /* 82 */ + INSN_GP_REFCNT_ADD, /* 83 */ + INSN_GP_AV, /* 84 */ + INSN_GP_HV, /* 85 */ + INSN_GP_CV, /* 86 */ + INSN_GP_FILE, /* 87 */ + INSN_GP_IO, /* 88 */ + INSN_GP_FORM, /* 89 */ + INSN_GP_CVGEN, /* 90 */ + INSN_GP_LINE, /* 91 */ + INSN_GP_SHARE, /* 92 */ + INSN_XGV_FLAGS, /* 93 */ + INSN_OP_NEXT, /* 94 */ + INSN_OP_SIBLING, /* 95 */ + INSN_OP_PPADDR, /* 96 */ + INSN_OP_TARG, /* 97 */ + INSN_OP_TYPE, /* 98 */ + INSN_OP_SEQ, /* 99 */ + INSN_OP_FLAGS, /* 100 */ + INSN_OP_PRIVATE, /* 101 */ + INSN_OP_FIRST, /* 102 */ + INSN_OP_LAST, /* 103 */ + INSN_OP_OTHER, /* 104 */ + INSN_OP_PMREPLROOT, /* 105 */ + INSN_OP_PMREPLSTART, /* 106 */ + INSN_OP_PMNEXT, /* 107 */ + INSN_OP_PMSTASHPV, /* 108 */ + INSN_OP_PMREPLROOTPO, /* 109 */ + INSN_OP_PMSTASH, /* 110 */ + INSN_OP_PMREPLROOTGV, /* 111 */ + INSN_PREGCOMP, /* 112 */ + INSN_OP_PMFLAGS, /* 113 */ + INSN_OP_PMPERMFLAGS, /* 114 */ + INSN_OP_PMDYNFLAGS, /* 115 */ + INSN_OP_SV, /* 116 */ + INSN_OP_PADIX, /* 117 */ + INSN_OP_PV, /* 118 */ + INSN_OP_PV_TR, /* 119 */ + INSN_OP_REDOOP, /* 120 */ + INSN_OP_NEXTOP, /* 121 */ + INSN_OP_LASTOP, /* 122 */ + INSN_COP_LABEL, /* 123 */ + INSN_COP_STASHPV, /* 124 */ + INSN_COP_FILE, /* 125 */ + INSN_COP_STASH, /* 126 */ + INSN_COP_FILEGV, /* 127 */ + INSN_COP_SEQ, /* 128 */ + INSN_COP_ARYBASE, /* 129 */ + INSN_COP_LINE, /* 130 */ + INSN_COP_IO, /* 131 */ + INSN_COP_WARNINGS, /* 132 */ + INSN_MAIN_START, /* 133 */ + INSN_MAIN_ROOT, /* 134 */ + INSN_MAIN_CV, /* 135 */ + INSN_CURPAD, /* 136 */ + INSN_PUSH_BEGIN, /* 137 */ + INSN_PUSH_INIT, /* 138 */ + INSN_PUSH_END, /* 139 */ + INSN_CURSTASH, /* 140 */ + INSN_DEFSTASH, /* 141 */ + INSN_DATA, /* 142 */ + INSN_INCAV, /* 143 */ + INSN_LOAD_GLOB, /* 144 */ + INSN_REGEX_PADAV, /* 145 */ + INSN_DOWARN, /* 146 */ + INSN_COMPPAD_NAME, /* 147 */ + INSN_XGV_STASH, /* 148 */ + INSN_SIGNAL, /* 149 */ + INSN_FORMFEED, /* 150 */ + MAX_INSN = 150 }; enum { @@ -153,7 +153,7 @@ TESTING DEPARSER ------------------------------------------------------------------------------ EOT - print <<'EOT' if ($type eq 'bytecompile'); + print <<EOT if ($type eq 'bytecompile'); ------------------------------------------------------------------------------ TESTING BYTECODE COMPILER ------------------------------------------------------------------------------ @@ -246,13 +246,11 @@ EOT elsif ($type eq 'bytecompile') { my $perl = $ENV{PERL} || './perl'; my $redir = ($^O eq 'VMS' ? '2>&1' : ''); - my $bswitch = "-MO=Bytecode,-H,-s,-TD`pwd`,"; - $bswitch .= "-TF," + my $bswitch = "-MO=Bytecode,-H,-TI,-s`pwd`/$test,"; + $bswitch .= "-TF$test.plc," if $test =~ m(chdir|pod/|CGI/t/carp|lib/DB); $bswitch .= "-k," if $test =~ m(deparse|terse|ext/Storable/t/code); - $bswitch .= "-k," - if $] < 5.009 && $test =~ m(avhv|hashwarn); $bswitch .= "-b," if $test =~ m(op/getpid); my $bytecompile = |