OLD | NEW |
1 # | 1 # |
2 # Autogenerated by generate-bytecode-expectations. | 2 # Autogenerated by generate-bytecode-expectations. |
3 # | 3 # |
4 | 4 |
5 --- | 5 --- |
6 wrap: yes | 6 wrap: yes |
7 | 7 |
8 --- | 8 --- |
9 snippet: " | 9 snippet: " |
10 var x = 0; | 10 var x = 0; |
11 label: { | 11 label: { |
12 x = x + 1; | 12 x = x + 1; |
13 break label; | 13 break label; |
14 x = x + 1; | 14 x = x + 1; |
15 } | 15 } |
16 return x; | 16 return x; |
17 " | 17 " |
18 frame size: 1 | 18 frame size: 2 |
19 parameter count: 1 | 19 parameter count: 1 |
20 bytecode array length: 16 | 20 bytecode array length: 23 |
21 bytecodes: [ | 21 bytecodes: [ |
22 /* 30 E> */ B(StackCheck), | 22 /* 30 E> */ B(StackCheck), |
23 /* 42 S> */ B(LdaZero), | 23 /* 42 S> */ B(LdaConstant), U8(0), |
| 24 B(Star), R(1), |
| 25 B(LdaZero), |
24 B(Star), R(0), | 26 B(Star), R(0), |
25 /* 56 S> */ B(LdaSmi), I8(1), | 27 /* 56 S> */ B(LdaConstant), U8(0), |
26 /* 62 E> */ B(Add), R(0), U8(2), | 28 B(Star), R(1), |
| 29 /* 62 E> */ B(AddSmi), I8(1), R(0), U8(4), |
27 B(Star), R(0), | 30 B(Star), R(0), |
28 /* 69 S> */ B(Jump), U8(2), | 31 /* 69 S> */ B(Jump), U8(2), |
29 /* 97 S> */ B(Ldar), R(0), | 32 /* 97 S> */ B(Ldar), R(0), |
30 /* 107 S> */ B(Return), | 33 /* 107 S> */ B(Return), |
31 ] | 34 ] |
32 constant pool: [ | 35 constant pool: [ |
| 36 ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"], |
33 ] | 37 ] |
34 handlers: [ | 38 handlers: [ |
35 ] | 39 ] |
36 | 40 |
37 --- | 41 --- |
38 snippet: " | 42 snippet: " |
39 var sum = 0; | 43 var sum = 0; |
40 outer: { | 44 outer: { |
41 for (var x = 0; x < 10; ++x) { | 45 for (var x = 0; x < 10; ++x) { |
42 for (var y = 0; y < 3; ++y) { | 46 for (var y = 0; y < 3; ++y) { |
43 ++sum; | 47 ++sum; |
44 if (x + y == 12) { break outer; } | 48 if (x + y == 12) { break outer; } |
45 } | 49 } |
46 } | 50 } |
47 } | 51 } |
48 return sum; | 52 return sum; |
49 " | 53 " |
50 frame size: 4 | 54 frame size: 4 |
51 parameter count: 1 | 55 parameter count: 1 |
52 bytecode array length: 69 | 56 bytecode array length: 81 |
53 bytecodes: [ | 57 bytecodes: [ |
54 /* 30 E> */ B(StackCheck), | 58 /* 30 E> */ B(StackCheck), |
55 /* 44 S> */ B(LdaZero), | 59 /* 44 S> */ B(LdaConstant), U8(0), |
| 60 B(Star), R(3), |
| 61 B(LdaZero), |
56 B(Star), R(0), | 62 B(Star), R(0), |
57 /* 71 S> */ B(LdaZero), | 63 /* 71 S> */ B(LdaConstant), U8(1), |
| 64 B(Star), R(3), |
| 65 B(LdaZero), |
58 B(Star), R(1), | 66 B(Star), R(1), |
59 /* 76 S> */ B(LdaSmi), I8(10), | 67 /* 76 S> */ B(LdaSmi), I8(10), |
60 /* 76 E> */ B(TestLessThan), R(1), U8(2), | 68 /* 76 E> */ B(TestLessThan), R(1), U8(6), |
61 B(JumpIfFalse), U8(54), | 69 B(JumpIfFalse), U8(58), |
62 /* 58 E> */ B(StackCheck), | 70 /* 58 E> */ B(StackCheck), |
63 /* 106 S> */ B(LdaZero), | 71 /* 106 S> */ B(LdaConstant), U8(2), |
| 72 B(Star), R(3), |
| 73 B(LdaZero), |
64 B(Star), R(2), | 74 B(Star), R(2), |
65 /* 111 S> */ B(LdaSmi), I8(3), | 75 /* 111 S> */ B(LdaSmi), I8(3), |
66 /* 111 E> */ B(TestLessThan), R(2), U8(4), | 76 /* 111 E> */ B(TestLessThan), R(2), U8(10), |
67 B(JumpIfFalse), U8(34), | 77 B(JumpIfFalse), U8(34), |
68 /* 93 E> */ B(StackCheck), | 78 /* 93 E> */ B(StackCheck), |
69 /* 129 S> */ B(Ldar), R(0), | 79 /* 129 S> */ B(Ldar), R(0), |
70 B(Inc), U8(6), | 80 B(Inc), U8(12), |
71 B(Star), R(0), | 81 B(Star), R(0), |
72 /* 142 S> */ B(Ldar), R(2), | 82 /* 142 S> */ B(Ldar), R(2), |
73 /* 148 E> */ B(Add), R(1), U8(7), | 83 /* 148 E> */ B(Add), R(1), U8(13), |
74 B(Star), R(3), | 84 B(Star), R(3), |
75 B(LdaSmi), I8(12), | 85 B(LdaSmi), I8(12), |
76 /* 152 E> */ B(TestEqual), R(3), U8(8), | 86 /* 152 E> */ B(TestEqual), R(3), U8(14), |
77 B(JumpIfFalse), U8(4), | 87 B(JumpIfFalse), U8(4), |
78 /* 161 S> */ B(Jump), U8(20), | 88 /* 161 S> */ B(Jump), U8(20), |
79 /* 118 S> */ B(Ldar), R(2), | 89 /* 118 S> */ B(Ldar), R(2), |
80 B(Inc), U8(5), | 90 B(Inc), U8(11), |
81 B(Star), R(2), | 91 B(Star), R(2), |
82 B(JumpLoop), U8(36), I8(1), | 92 B(JumpLoop), U8(36), I8(1), |
83 /* 84 S> */ B(Ldar), R(1), | 93 /* 84 S> */ B(Ldar), R(1), |
84 B(Inc), U8(3), | 94 B(Inc), U8(7), |
85 B(Star), R(1), | 95 B(Star), R(1), |
86 B(JumpLoop), U8(56), I8(0), | 96 B(JumpLoop), U8(60), I8(0), |
87 /* 188 S> */ B(Ldar), R(0), | 97 /* 188 S> */ B(Ldar), R(0), |
88 /* 200 S> */ B(Return), | 98 /* 200 S> */ B(Return), |
89 ] | 99 ] |
90 constant pool: [ | 100 constant pool: [ |
| 101 ONE_BYTE_INTERNALIZED_STRING_TYPE ["sum"], |
| 102 ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"], |
| 103 ONE_BYTE_INTERNALIZED_STRING_TYPE ["y"], |
91 ] | 104 ] |
92 handlers: [ | 105 handlers: [ |
93 ] | 106 ] |
94 | 107 |
95 --- | 108 --- |
96 snippet: " | 109 snippet: " |
97 outer: { | 110 outer: { |
98 let y = 10; | 111 let y = 10; |
99 function f() { return y; } | 112 function f() { return y; } |
100 break outer; | 113 break outer; |
101 } | 114 } |
102 " | 115 " |
103 frame size: 3 | 116 frame size: 4 |
104 parameter count: 1 | 117 parameter count: 1 |
105 bytecode array length: 31 | 118 bytecode array length: 39 |
106 bytecodes: [ | 119 bytecodes: [ |
107 /* 30 E> */ B(StackCheck), | 120 /* 30 E> */ B(StackCheck), |
108 B(Ldar), R(closure), | 121 B(Ldar), R(closure), |
109 B(CreateBlockContext), U8(0), | 122 B(CreateBlockContext), U8(0), |
110 B(PushContext), R(2), | 123 B(PushContext), R(2), |
111 B(LdaTheHole), | 124 B(LdaTheHole), |
112 B(StaCurrentContextSlot), U8(4), | 125 B(StaCurrentContextSlot), U8(4), |
113 B(CreateClosure), U8(1), U8(2), U8(2), | 126 B(CreateClosure), U8(1), U8(2), U8(2), |
114 B(Star), R(0), | 127 B(Star), R(0), |
115 /* 53 S> */ B(LdaSmi), I8(10), | 128 /* 53 S> */ B(LdaConstant), U8(2), |
| 129 B(Star), R(3), |
| 130 B(LdaSmi), I8(10), |
116 /* 53 E> */ B(StaCurrentContextSlot), U8(4), | 131 /* 53 E> */ B(StaCurrentContextSlot), U8(4), |
| 132 B(LdaConstant), U8(3), |
| 133 B(Star), R(3), |
117 B(Mov), R(0), R(1), | 134 B(Mov), R(0), R(1), |
118 B(Ldar), R(0), | 135 B(Ldar), R(0), |
119 /* 88 S> */ B(Jump), U8(2), | 136 /* 88 S> */ B(Jump), U8(2), |
120 B(PopContext), R(2), | 137 B(PopContext), R(2), |
121 B(LdaUndefined), | 138 B(LdaUndefined), |
122 /* 103 S> */ B(Return), | 139 /* 103 S> */ B(Return), |
123 ] | 140 ] |
124 constant pool: [ | 141 constant pool: [ |
125 FIXED_ARRAY_TYPE, | 142 FIXED_ARRAY_TYPE, |
126 SHARED_FUNCTION_INFO_TYPE, | 143 SHARED_FUNCTION_INFO_TYPE, |
| 144 ONE_BYTE_INTERNALIZED_STRING_TYPE ["y"], |
| 145 ONE_BYTE_INTERNALIZED_STRING_TYPE ["f"], |
127 ] | 146 ] |
128 handlers: [ | 147 handlers: [ |
129 ] | 148 ] |
130 | 149 |
131 --- | 150 --- |
132 snippet: " | 151 snippet: " |
133 let x = 1; | 152 let x = 1; |
134 outer: { | 153 outer: { |
135 inner: { | 154 inner: { |
136 let y = 2; | 155 let y = 2; |
137 function f() { return x + y; } | 156 function f() { return x + y; } |
138 if (y) break outer; | 157 if (y) break outer; |
139 y = 3; | 158 y = 3; |
140 } | 159 } |
141 } | 160 } |
142 x = 4; | 161 x = 4; |
143 " | 162 " |
144 frame size: 4 | 163 frame size: 5 |
145 parameter count: 1 | 164 parameter count: 1 |
146 bytecode array length: 54 | 165 bytecode array length: 74 |
147 bytecodes: [ | 166 bytecodes: [ |
148 B(CreateFunctionContext), U8(1), | 167 B(CreateFunctionContext), U8(1), |
149 B(PushContext), R(2), | 168 B(PushContext), R(2), |
150 B(LdaTheHole), | 169 B(LdaTheHole), |
151 B(StaCurrentContextSlot), U8(4), | 170 B(StaCurrentContextSlot), U8(4), |
152 /* 30 E> */ B(StackCheck), | 171 /* 30 E> */ B(StackCheck), |
153 /* 42 S> */ B(LdaSmi), I8(1), | 172 /* 42 S> */ B(LdaConstant), U8(0), |
| 173 B(Star), R(4), |
| 174 B(LdaSmi), I8(1), |
154 /* 42 E> */ B(StaCurrentContextSlot), U8(4), | 175 /* 42 E> */ B(StaCurrentContextSlot), U8(4), |
155 B(Ldar), R(closure), | 176 B(Ldar), R(closure), |
156 B(CreateBlockContext), U8(0), | 177 B(CreateBlockContext), U8(1), |
157 B(PushContext), R(3), | 178 B(PushContext), R(3), |
158 B(LdaTheHole), | 179 B(LdaTheHole), |
159 B(StaCurrentContextSlot), U8(4), | 180 B(StaCurrentContextSlot), U8(4), |
160 B(CreateClosure), U8(1), U8(2), U8(2), | 181 B(CreateClosure), U8(2), U8(4), U8(2), |
161 B(Star), R(0), | 182 B(Star), R(0), |
162 /* 76 S> */ B(LdaSmi), I8(2), | 183 /* 76 S> */ B(LdaConstant), U8(3), |
| 184 B(Star), R(4), |
| 185 B(LdaSmi), I8(2), |
163 /* 76 E> */ B(StaCurrentContextSlot), U8(4), | 186 /* 76 E> */ B(StaCurrentContextSlot), U8(4), |
| 187 B(LdaConstant), U8(4), |
| 188 B(Star), R(4), |
164 B(Mov), R(0), R(1), | 189 B(Mov), R(0), R(1), |
165 /* 118 S> */ B(LdaCurrentContextSlot), U8(4), | 190 /* 118 S> */ B(LdaCurrentContextSlot), U8(4), |
166 B(JumpIfToBooleanFalse), U8(6), | 191 B(JumpIfToBooleanFalse), U8(6), |
167 /* 125 S> */ B(PopContext), R(3), | 192 /* 125 S> */ B(PopContext), R(3), |
168 B(Jump), U8(8), | 193 B(Jump), U8(12), |
169 /* 142 S> */ B(LdaSmi), I8(3), | 194 /* 142 S> */ B(LdaConstant), U8(3), |
| 195 B(Star), R(4), |
| 196 B(LdaSmi), I8(3), |
170 /* 144 E> */ B(StaCurrentContextSlot), U8(4), | 197 /* 144 E> */ B(StaCurrentContextSlot), U8(4), |
171 B(PopContext), R(3), | 198 B(PopContext), R(3), |
172 /* 155 S> */ B(LdaSmi), I8(4), | 199 /* 155 S> */ B(LdaConstant), U8(0), |
| 200 B(Star), R(4), |
| 201 B(LdaSmi), I8(4), |
173 /* 157 E> */ B(StaCurrentContextSlot), U8(4), | 202 /* 157 E> */ B(StaCurrentContextSlot), U8(4), |
174 B(LdaUndefined), | 203 B(LdaUndefined), |
175 /* 162 S> */ B(Return), | 204 /* 162 S> */ B(Return), |
176 ] | 205 ] |
177 constant pool: [ | 206 constant pool: [ |
| 207 ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"], |
178 FIXED_ARRAY_TYPE, | 208 FIXED_ARRAY_TYPE, |
179 SHARED_FUNCTION_INFO_TYPE, | 209 SHARED_FUNCTION_INFO_TYPE, |
| 210 ONE_BYTE_INTERNALIZED_STRING_TYPE ["y"], |
| 211 ONE_BYTE_INTERNALIZED_STRING_TYPE ["f"], |
180 ] | 212 ] |
181 handlers: [ | 213 handlers: [ |
182 ] | 214 ] |
183 | 215 |
OLD | NEW |