DestructuringAssignment.golden 12.5 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
#
# Autogenerated by generate-bytecode-expectations.
#

---
wrap: yes

---
snippet: "
  var x, a = [0,1,2,3];
  [x] = a;
"
13
frame size: 13
14
parameter count: 1
15
bytecode array length: 122
16 17
bytecodes: [
  /*   45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
18
                B(Star1),
19
  /*   60 S> */ B(GetIterator), R(1), U8(1), U8(3),
20
                B(Star4),
21
                B(GetNamedProperty), R(4), U8(1), U8(5),
22
                B(Star3),
23
                B(LdaFalse),
24
                B(Mov), R(1), R(2),
25
                B(Star5),
26 27
                B(Mov), R(context), R(8),
  /*   57 S> */ B(Ldar), R(5),
28
                B(JumpIfToBooleanTrue), U8(33),
29
                B(LdaTrue),
30
                B(Star5),
31
                B(CallProperty0), R(3), R(4), U8(11),
32
                B(Star9),
33
                B(JumpIfJSReceiver), U8(7),
34
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(9), U8(1),
35
                B(GetNamedProperty), R(9), U8(2), U8(9),
36
                B(JumpIfToBooleanTrue), U8(13),
37
                B(GetNamedProperty), R(9), U8(3), U8(7),
38
                B(Star9),
39
                B(LdaFalse),
40
                B(Star5),
41
                B(Ldar), R(9),
42 43
                B(Jump), U8(3),
                B(LdaUndefined),
44
                B(Star0),
45
                B(LdaSmi), I8(-1),
46 47 48 49
                B(Star7),
                B(Star6),
                B(Jump), U8(5),
                B(Star7),
50
                B(LdaZero),
51
                B(Star6),
52 53
                B(LdaTheHole),
                B(SetPendingMessage),
54
                B(Star8),
55
                B(Ldar), R(5),
56
                B(JumpIfToBooleanTrue), U8(35),
57
                B(Mov), R(context), R(10),
58
                B(GetNamedProperty), R(4), U8(4), U8(13),
59 60
                B(JumpIfUndefinedOrNull), U8(26),
                B(Star11),
61
                B(CallProperty0), R(11), R(4), U8(15),
62 63
                B(JumpIfJSReceiver), U8(19),
                B(Star12),
64
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
65 66
                B(Jump), U8(11),
                B(Star10),
67
                B(LdaZero),
68
                B(TestReferenceEqual), R(6),
69
                B(JumpIfTrue), U8(5),
70
                B(Ldar), R(10),
71
                B(ReThrow),
72
                B(Ldar), R(8),
73 74
                B(SetPendingMessage),
                B(LdaZero),
75
                B(TestReferenceEqual), R(6),
76
                B(JumpIfFalse), U8(5),
77
                B(Ldar), R(7),
78 79 80 81 82 83 84 85 86 87 88 89
                B(ReThrow),
                B(LdaUndefined),
  /*   65 S> */ B(Return),
]
constant pool: [
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
]
handlers: [
90 91
  [23, 60, 66],
  [79, 98, 100],
92 93 94 95 96 97 98
]

---
snippet: "
  var x, y, a = [0,1,2,3];
  [,x,...y] = a;
"
99
frame size: 14
100
parameter count: 1
101
bytecode array length: 197
102 103
bytecodes: [
  /*   48 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
104
                B(Star2),
105
  /*   69 S> */ B(GetIterator), R(2), U8(1), U8(3),
106
                B(Star5),
107
                B(GetNamedProperty), R(5), U8(1), U8(5),
108
                B(Star4),
109
                B(LdaFalse),
110
                B(Mov), R(2), R(3),
111
                B(Star6),
112 113
                B(Mov), R(context), R(9),
                B(Ldar), R(6),
114
                B(JumpIfToBooleanTrue), U8(24),
115
                B(LdaTrue),
116
                B(Star6),
117
                B(CallProperty0), R(4), R(5), U8(11),
118
                B(Star10),
119
                B(JumpIfJSReceiver), U8(7),
120
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
121
                B(GetNamedProperty), R(10), U8(2), U8(9),
122
                B(JumpIfToBooleanTrue), U8(4),
123
                B(LdaFalse),
124
                B(Star6),
125
  /*   61 S> */ B(Ldar), R(6),
126
                B(JumpIfToBooleanTrue), U8(33),
127
                B(LdaTrue),
128
                B(Star6),
129
                B(CallProperty0), R(4), R(5), U8(13),
130
                B(Star10),
131
                B(JumpIfJSReceiver), U8(7),
132
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
133
                B(GetNamedProperty), R(10), U8(2), U8(9),
134
                B(JumpIfToBooleanTrue), U8(13),
135
                B(GetNamedProperty), R(10), U8(3), U8(7),
136
                B(Star10),
137
                B(LdaFalse),
138
                B(Star6),
139
                B(Ldar), R(10),
140 141
                B(Jump), U8(3),
                B(LdaUndefined),
142
                B(Star0),
143
  /*   63 S> */ B(CreateEmptyArrayLiteral), U8(15),
144
                B(Star11),
145
                B(Ldar), R(6),
146
                B(JumpIfToBooleanTrue), U8(41),
147
                B(LdaZero),
148
                B(Star12),
149
                B(LdaTrue),
150
                B(Star6),
151
                B(CallProperty0), R(4), R(5), U8(19),
152
                B(Star10),
153
                B(JumpIfJSReceiver), U8(7),
154
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
155
                B(GetNamedProperty), R(10), U8(2), U8(21),
156
                B(JumpIfToBooleanTrue), U8(19),
157
                B(GetNamedProperty), R(10), U8(3), U8(7),
158 159
                B(StaInArrayLiteral), R(11), R(12), U8(16),
                B(Ldar), R(12),
160
                B(Inc), U8(18),
161
                B(Star12),
162
                B(JumpLoop), U8(31), I8(0), U8(23),
163
                B(Mov), R(11), R(1),
164
                B(LdaSmi), I8(-1),
165 166 167 168
                B(Star8),
                B(Star7),
                B(Jump), U8(5),
                B(Star8),
169
                B(LdaZero),
170
                B(Star7),
171 172
                B(LdaTheHole),
                B(SetPendingMessage),
173
                B(Star9),
174
                B(Ldar), R(6),
175
                B(JumpIfToBooleanTrue), U8(35),
176
                B(Mov), R(context), R(11),
177
                B(GetNamedProperty), R(5), U8(4), U8(24),
178 179
                B(JumpIfUndefinedOrNull), U8(26),
                B(Star12),
180
                B(CallProperty0), R(12), R(5), U8(26),
181 182
                B(JumpIfJSReceiver), U8(19),
                B(Star13),
183
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
184 185
                B(Jump), U8(11),
                B(Star11),
186
                B(LdaZero),
187
                B(TestReferenceEqual), R(7),
188
                B(JumpIfTrue), U8(5),
189
                B(Ldar), R(11),
190
                B(ReThrow),
191
                B(Ldar), R(9),
192 193
                B(SetPendingMessage),
                B(LdaZero),
194
                B(TestReferenceEqual), R(7),
195
                B(JumpIfFalse), U8(5),
196
                B(Ldar), R(8),
197 198 199 200 201 202 203 204 205 206 207 208
                B(ReThrow),
                B(LdaUndefined),
  /*   74 S> */ B(Return),
]
constant pool: [
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
]
handlers: [
209 210
  [23, 135, 141],
  [154, 173, 175],
211 212 213 214 215 216 217
]

---
snippet: "
  var x={}, y, a = [0];
  [x.foo,y=4] = a;
"
218
frame size: 15
219
parameter count: 1
220
bytecode array length: 168
221 222
bytecodes: [
  /*   40 S> */ B(CreateEmptyObjectLiteral),
223
                B(Star0),
224
  /*   51 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
225
                B(Star2),
226
  /*   68 S> */ B(GetIterator), R(2), U8(1), U8(3),
227
                B(Star5),
228
                B(GetNamedProperty), R(5), U8(1), U8(5),
229
                B(Star4),
230
                B(LdaFalse),
231
                B(Mov), R(2), R(3),
232
                B(Star6),
233 234 235
                B(Mov), R(context), R(9),
  /*   59 S> */ B(Ldar), R(6),
                B(Mov), R(0), R(11),
236
                B(JumpIfToBooleanTrue), U8(33),
237
                B(LdaTrue),
238
                B(Star6),
239
                B(CallProperty0), R(4), R(5), U8(11),
240
                B(Star10),
241
                B(JumpIfJSReceiver), U8(7),
242
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
243
                B(GetNamedProperty), R(10), U8(2), U8(9),
244
                B(JumpIfToBooleanTrue), U8(13),
245
                B(GetNamedProperty), R(10), U8(3), U8(7),
246
                B(Star10),
247
                B(LdaFalse),
248
                B(Star6),
249
                B(Ldar), R(10),
250 251
                B(Jump), U8(3),
                B(LdaUndefined),
252
                B(SetNamedProperty), R(11), U8(4), U8(13),
253
  /*   63 S> */ B(Ldar), R(6),
254
                B(JumpIfToBooleanTrue), U8(33),
255
                B(LdaTrue),
256
                B(Star6),
257
                B(CallProperty0), R(4), R(5), U8(15),
258
                B(Star10),
259
                B(JumpIfJSReceiver), U8(7),
260
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
261
                B(GetNamedProperty), R(10), U8(2), U8(9),
262
                B(JumpIfToBooleanTrue), U8(13),
263
                B(GetNamedProperty), R(10), U8(3), U8(7),
264
                B(Star10),
265
                B(LdaFalse),
266
                B(Star6),
267
                B(Ldar), R(10),
268
                B(JumpIfNotUndefined), U8(4),
269
                B(LdaSmi), I8(4),
270
                B(Star1),
271
                B(LdaSmi), I8(-1),
272 273 274 275
                B(Star8),
                B(Star7),
                B(Jump), U8(5),
                B(Star8),
276
                B(LdaZero),
277
                B(Star7),
278 279
                B(LdaTheHole),
                B(SetPendingMessage),
280
                B(Star9),
281
                B(Ldar), R(6),
282
                B(JumpIfToBooleanTrue), U8(35),
283
                B(Mov), R(context), R(12),
284
                B(GetNamedProperty), R(5), U8(5), U8(17),
285 286
                B(JumpIfUndefinedOrNull), U8(26),
                B(Star13),
287
                B(CallProperty0), R(13), R(5), U8(19),
288 289
                B(JumpIfJSReceiver), U8(19),
                B(Star14),
290
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
291 292
                B(Jump), U8(11),
                B(Star12),
293
                B(LdaZero),
294
                B(TestReferenceEqual), R(7),
295
                B(JumpIfTrue), U8(5),
296
                B(Ldar), R(12),
297
                B(ReThrow),
298
                B(Ldar), R(9),
299 300
                B(SetPendingMessage),
                B(LdaZero),
301
                B(TestReferenceEqual), R(7),
302
                B(JumpIfFalse), U8(5),
303
                B(Ldar), R(8),
304 305 306 307 308 309 310 311 312 313 314 315 316
                B(ReThrow),
                B(LdaUndefined),
  /*   73 S> */ B(Return),
]
constant pool: [
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["foo"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
]
handlers: [
317 318
  [25, 106, 112],
  [125, 144, 146],
319 320 321 322 323 324 325
]

---
snippet: "
  var x, a = {x:1};
  ({x} = a);
"
326
frame size: 2
327
parameter count: 1
328
bytecode array length: 12
329 330
bytecodes: [
  /*   45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
331
                B(Star1),
332
  /*   54 S> */ B(GetNamedProperty), R(1), U8(1), U8(1),
333
                B(Star0),
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348
                B(LdaUndefined),
  /*   63 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
]
handlers: [
]

---
snippet: "
  var x={}, a = {y:1};
  ({y:x.foo} = a);
"
349
frame size: 2
350
parameter count: 1
351
bytecode array length: 17
352 353
bytecodes: [
  /*   40 S> */ B(CreateEmptyObjectLiteral),
354
                B(Star0),
355
  /*   48 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
356
                B(Star1),
357 358
  /*   61 S> */ B(GetNamedProperty), R(1), U8(1), U8(1),
                B(SetNamedProperty), R(0), U8(2), U8(3),
359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374
                B(LdaUndefined),
  /*   72 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["y"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["foo"],
]
handlers: [
]

---
snippet: "
  var x, a = {y:1, w:2, v:3};
  ({x=0,...y} = a);
"
375
frame size: 4
376
parameter count: 1
377
bytecode array length: 28
378 379
bytecodes: [
  /*   45 S> */ B(CreateObjectLiteral), U8(0), U8(0), U8(41),
380
                B(Star1),
381
  /*   64 S> */ B(LdaConstant), U8(1),
382
                B(Star3),
383
                B(GetNamedProperty), R(1), U8(1), U8(1),
384
                B(Mov), R(1), R(2),
385
                B(JumpIfNotUndefined), U8(3),
386
                B(LdaZero),
387
                B(Star0),
388
  /*   71 S> */ B(InvokeIntrinsic), U8(Runtime::k_CopyDataPropertiesWithExcludedPropertiesOnStack), R(2), U8(2),
389
                B(StaGlobal), U8(2), U8(3),
390 391 392 393 394 395 396 397 398 399 400
                B(LdaUndefined),
  /*   80 S> */ B(Return),
]
constant pool: [
  OBJECT_BOILERPLATE_DESCRIPTION_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["y"],
]
handlers: [
]