diff options
author | David Mitchell <davem@iabyn.com> | 2019-09-18 12:28:18 +0100 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2019-09-19 08:42:46 +0100 |
commit | 4176abf7a8e425113debe55679c99b59bb9d299a (patch) | |
tree | f8950218aeee9cad215793ef9cba187c8d24a207 /ext/B | |
parent | 068b48acd4bdf9e7c69b87f4ba838bdff035053c (diff) | |
download | perl-4176abf7a8e425113debe55679c99b59bb9d299a.tar.gz |
set VOID on OP_ENTER
The OP_ENTER planted at the start of a program (and possibly elsewhere)
gets left as UNKNOWN context rather than VOID context, due to op_scope()
not honouring the current context.
Fixing this makes things infinitesimally faster.
Diffstat (limited to 'ext/B')
-rw-r--r-- | ext/B/t/optree_concise.t | 12 | ||||
-rw-r--r-- | ext/B/t/optree_constants.t | 8 | ||||
-rw-r--r-- | ext/B/t/optree_misc.t | 4 | ||||
-rw-r--r-- | ext/B/t/optree_samples.t | 8 | ||||
-rw-r--r-- | ext/B/t/optree_sort.t | 16 | ||||
-rw-r--r-- | ext/B/t/optree_varinit.t | 40 |
6 files changed, 44 insertions, 44 deletions
diff --git a/ext/B/t/optree_concise.t b/ext/B/t/optree_concise.t index 1e2594703f..86280ac488 100644 --- a/ext/B/t/optree_concise.t +++ b/ext/B/t/optree_concise.t @@ -217,7 +217,7 @@ checkOptree ( name => 'cmdline invoke -basic works', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # 7 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 6 <@> sort vK ->7 # 3 <0> pushmark s ->4 @@ -225,7 +225,7 @@ checkOptree ( name => 'cmdline invoke -basic works', # 4 <#> gv[*a] s ->5 EOT_EOT # 7 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 6 <@> sort vK ->7 # 3 <0> pushmark s ->4 @@ -241,7 +241,7 @@ checkOptree ( name => 'cmdline invoke -exec works', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> pushmark s 4 <#> gv[*a] s @@ -249,7 +249,7 @@ checkOptree ( name => 'cmdline invoke -exec works', 6 <@> sort vK 7 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <$> gv(*a) s @@ -290,7 +290,7 @@ checkOptree errs => ['Useless use of sort in void context at -e line 1.'], strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <#> gv[*a] s @@ -298,7 +298,7 @@ checkOptree # 6 <@> sort vK # 7 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <$> gv(*a) s diff --git a/ext/B/t/optree_constants.t b/ext/B/t/optree_constants.t index a8073164db..43afacc570 100644 --- a/ext/B/t/optree_constants.t +++ b/ext/B/t/optree_constants.t @@ -152,14 +152,14 @@ checkOptree ( name => 'myyes() as coderef', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # 6 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3 # 5 <@> print vK ->6 # 3 <0> pushmark s ->4 # 4 <$> const[SPECIAL sv_yes] s*/FOLD ->5 EOT_EOT # 6 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3 # 5 <@> print vK ->6 # 3 <0> pushmark s ->4 @@ -176,14 +176,14 @@ checkOptree ( name => 'myno() as coderef', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # 6 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3 # 5 <@> print vK ->6 # 3 <0> pushmark s ->4 # 4 <$> const[SPECIAL sv_no] s*/FOLD ->5 EOT_EOT # 6 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ ->3 # 5 <@> print vK ->6 # 3 <0> pushmark s ->4 diff --git a/ext/B/t/optree_misc.t b/ext/B/t/optree_misc.t index f8ff3ce968..490abb33d4 100644 --- a/ext/B/t/optree_misc.t +++ b/ext/B/t/optree_misc.t @@ -89,7 +89,7 @@ EONT_EONT my $t = <<'EOT_EOT'; # 8 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 7 <2> sassign vKS/2 ->8 # 5 <@> index[t2] sK/2 ->6 @@ -101,7 +101,7 @@ my $t = <<'EOT_EOT'; EOT_EOT my $nt = <<'EONT_EONT'; # 8 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 7 <2> sassign vKS/2 ->8 # 5 <@> index[t1] sK/2 ->6 diff --git a/ext/B/t/optree_samples.t b/ext/B/t/optree_samples.t index 15b5799ce0..0a498a9e52 100644 --- a/ext/B/t/optree_samples.t +++ b/ext/B/t/optree_samples.t @@ -331,7 +331,7 @@ checkOptree ( name => '-exec -e foreach (1..10) {print qq{foo $_}}', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <$> const[IV 1] s @@ -350,7 +350,7 @@ checkOptree ( name => '-exec -e foreach (1..10) {print qq{foo $_}}', # g <2> leaveloop vK/2 # h <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 2 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <$> const(IV 1) s @@ -602,14 +602,14 @@ checkOptree ( name => '-e use constant j => qq{junk}; print j', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 71 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <$> const[PV "junk"] s*/FOLD # 5 <@> print vK # 6 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 71 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <$> const(PV "junk") s*/FOLD diff --git a/ext/B/t/optree_sort.t b/ext/B/t/optree_sort.t index 0b5897d575..2c661f6765 100644 --- a/ext/B/t/optree_sort.t +++ b/ext/B/t/optree_sort.t @@ -46,7 +46,7 @@ checkOptree ( name => 'sort @a', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> pushmark s 4 <#> gv[*a] s @@ -54,7 +54,7 @@ checkOptree ( name => 'sort @a', 6 <@> sort vK 7 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <$> gv(*a) s @@ -98,7 +98,7 @@ checkOptree ( name => '@a = sort @a', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> pushmark s 4 <0> pushmark s @@ -107,7 +107,7 @@ checkOptree ( name => '@a = sort @a', 7 <@> sort lK/INPLACE 8 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <0> pushmark s @@ -155,7 +155,7 @@ checkOptree ( name => '@a = sort @a; reverse @a', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> pushmark s 4 <0> pushmark s @@ -169,7 +169,7 @@ b <1> rv2av[t7] lK/1 c <@> reverse[t8] vK/1 d <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <0> pushmark s @@ -219,7 +219,7 @@ checkOptree ( name => 'my @a; @a = sort @a', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> padav[@a:1,2] vM/LVINTRO 4 <;> nextstate(main 2 -e:1) v:>,<,%,{ @@ -229,7 +229,7 @@ checkOptree ( name => 'my @a; @a = sort @a', 8 <@> sort lK/INPLACE 9 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> padav[@a:1,2] vM/LVINTRO # 4 <;> nextstate(main 2 -e:1) v:>,<,%,{ diff --git a/ext/B/t/optree_varinit.t b/ext/B/t/optree_varinit.t index 5938048f3a..8312df029d 100644 --- a/ext/B/t/optree_varinit.t +++ b/ext/B/t/optree_varinit.t @@ -80,12 +80,12 @@ checkOptree ( name => 'my $a', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); # 4 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 3 <0> padsv[$a:1,2] vM/LVINTRO ->4 EOT_EOT # 4 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 3 <0> padsv[$a:1,2] vM/LVINTRO ->4 EONT_EONT @@ -96,13 +96,13 @@ checkOptree ( name => 'our $a', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); 3 <@> leave[1 ref] vKP/REFC ->(end) -1 <0> enter ->2 +1 <0> enter v ->2 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 - <1> rv2sv vK/OURINTR,1 ->3 - <#> gv[*a] s ->- EOT_EOT # 3 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # - <1> rv2sv vK/OURINTR,1 ->3 # - <$> gv(*a) s ->- @@ -115,13 +115,13 @@ checkOptree ( name => 'local $c', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); 4 <@> leave[1 ref] vKP/REFC ->(end) -1 <0> enter ->2 +1 <0> enter v ->2 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 - <1> ex-rv2sv vKM/LVINTRO,1 ->4 3 <#> gvsv[*c] s/LVINTRO ->4 EOT_EOT # 4 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # - <1> ex-rv2sv vKM/LVINTRO,1 ->4 # 3 <$> gvsv(*c) s/LVINTRO ->4 @@ -201,14 +201,14 @@ checkOptree ( name => 'my $a=undef', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); 6 <@> leave[1 ref] vKP/REFC ->(end) -1 <0> enter ->2 +1 <0> enter v ->2 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 5 <2> sassign vKS/2 ->6 3 <0> undef s ->4 4 <0> padsv[$a:1,2] sRM*/LVINTRO ->5 EOT_EOT # 6 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 5 <2> sassign vKS/2 ->6 # 3 <0> undef s ->4 @@ -222,7 +222,7 @@ checkOptree ( name => 'our $a=undef', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); 6 <@> leave[1 ref] vKP/REFC ->(end) -1 <0> enter ->2 +1 <0> enter v ->2 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 5 <2> sassign vKS/2 ->6 3 <0> undef s ->4 @@ -230,7 +230,7 @@ checkOptree ( name => 'our $a=undef', 4 <#> gvsv[*a] s/OURINTR ->5 EOT_EOT # 6 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 5 <2> sassign vKS/2 ->6 # 3 <0> undef s ->4 @@ -246,7 +246,7 @@ checkOptree ( name => 'local $c=undef', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); 6 <@> leave[1 ref] vKP/REFC ->(end) -1 <0> enter ->2 +1 <0> enter v ->2 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 5 <2> sassign vKS/2 ->6 3 <0> undef s ->4 @@ -254,7 +254,7 @@ checkOptree ( name => 'local $c=undef', 4 <#> gvsv[*c] s/LVINTRO ->5 EOT_EOT # 6 <@> leave[1 ref] vKP/REFC ->(end) -# 1 <0> enter ->2 +# 1 <0> enter v ->2 # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ ->3 # 5 <2> sassign vKS/2 ->6 # 3 <0> undef s ->4 @@ -323,14 +323,14 @@ checkOptree ( name => 'my $a=()', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> stub sP 4 <0> padsv[$a:1,2] sRM*/LVINTRO 5 <2> sassign vKS/2 6 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> stub sP # 4 <0> padsv[$a:1,2] sRM*/LVINTRO @@ -344,14 +344,14 @@ checkOptree ( name => 'our $a=()', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> stub sP 4 <#> gvsv[*a] s/OURINTR 5 <2> sassign vKS/2 6 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> stub sP # 4 <$> gvsv(*a) s/OURINTR @@ -366,14 +366,14 @@ checkOptree ( name => 'local $c=()', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -1 <0> enter +1 <0> enter v 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ 3 <0> stub sP 4 <#> gvsv[*c] s/LVINTRO 5 <2> sassign vKS/2 6 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> stub sP # 4 <$> gvsv(*c) s/LVINTRO @@ -387,14 +387,14 @@ checkOptree ( name => 'my ($a,$b)=()', bcopts => '-exec', strip_open_hints => 1, expect => <<'EOT_EOT', expect_nt => <<'EONT_EONT'); -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <0> padrange[$a:1,2; $b:1,2] RM/LVINTRO,range=2 # 5 <2> aassign[t3] vKS # 6 <@> leave[1 ref] vKP/REFC EOT_EOT -# 1 <0> enter +# 1 <0> enter v # 2 <;> nextstate(main 1 -e:1) v:>,<,%,{ # 3 <0> pushmark s # 4 <0> padrange[$a:1,2; $b:1,2] RM/LVINTRO,range=2 |