Commit 874441a
committed
Make OP_DEFINED eligible for constant folding
Prior to this, the condition in the following example did not fold:
'use constant ONE => "bibble"; if (defined(ONE)) { print "boop" }'
With this commit, the final op tree produced for the above is just:
5 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter v ->2
2 <;> nextstate(main 193 -e:1) v:%,us,{,fea=15 ->3
4 <1> padsv_store[$x:193,194] vKS/LVINTRO ->5
3 <$> const[IV 1] s/FOLD ->4
- <0> ex-padsv sRM*/LVINTRO ->41 parent d19a96b commit 874441a
4 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5011 | 5011 | | |
5012 | 5012 | | |
5013 | 5013 | | |
| 5014 | + | |
| 5015 | + | |
| 5016 | + | |
| 5017 | + | |
| 5018 | + | |
| 5019 | + | |
5014 | 5020 | | |
5015 | 5021 | | |
5016 | 5022 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
| 104 | + | |
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1106 | 1106 | | |
1107 | 1107 | | |
1108 | 1108 | | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
1109 | 1117 | | |
0 commit comments