ForOfLoop.golden 30 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
#
# Autogenerated by generate-bytecode-expectations.
#

---
wrap: no
test function name: f

---
snippet: "
  function f(arr) {
    for (let x of arr) { let y = x; }
  }
  f([1, 2, 3]);
"
16
frame size: 14
17
parameter count: 2
18
bytecode array length: 140
19
bytecodes: [
20
  /*   34 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
21 22
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
23
                B(Star), R(5),
24
                B(LdaNamedProperty), R(5), U8(0), U8(4),
25 26
                B(Star), R(4),
                B(LdaFalse),
27 28
                B(Star), R(6),
                B(Mov), R(context), R(9),
29
                B(LdaTrue),
30
                B(Star), R(6),
31
  /*   29 S> */ B(CallProperty0), R(4), R(5), U8(6),
32
                B(Star), R(10),
33
                B(JumpIfJSReceiver), U8(7),
34 35
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
                B(LdaNamedProperty), R(10), U8(1), U8(8),
36
                B(JumpIfToBooleanTrue), U8(25),
37 38
                B(LdaNamedProperty), R(10), U8(2), U8(10),
                B(Star), R(10),
39
                B(LdaFalse),
40 41
                B(Star), R(6),
                B(Mov), R(10), R(0),
42 43
  /*   29 S> */ B(Mov), R(0), R(2),
  /*   49 S> */ B(Mov), R(2), R(3),
44
                B(Ldar), R(10),
45
  /*   20 E> */ B(JumpLoop), U8(42), I8(0),
46
                B(LdaSmi), I8(-1),
47 48
                B(Star), R(8),
                B(Star), R(7),
49
                B(Jump), U8(7),
50
                B(Star), R(8),
51
                B(LdaZero),
52
                B(Star), R(7),
53
                B(LdaTheHole),
54
                B(SetPendingMessage),
55 56
                B(Star), R(9),
                B(Ldar), R(6),
57 58
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(11),
59
                B(LdaNamedProperty), R(5), U8(3), U8(12),
60 61 62
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(12),
                B(CallProperty0), R(12), R(5), U8(14),
63
                B(JumpIfJSReceiver), U8(21),
64 65
                B(Star), R(13),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
66
                B(Jump), U8(12),
67
                B(Star), R(11),
68
                B(LdaZero),
69
                B(TestReferenceEqual), R(7),
70
                B(JumpIfTrue), U8(5),
71
                B(Ldar), R(11),
72
                B(ReThrow),
73
                B(Ldar), R(9),
74
                B(SetPendingMessage),
75
                B(LdaZero),
76
                B(TestReferenceEqual), R(7),
77
                B(JumpIfFalse), U8(5),
78
                B(Ldar), R(8),
79 80 81 82 83 84 85 86 87 88 89
                B(ReThrow),
                B(LdaUndefined),
  /*   54 S> */ B(Return),
]
constant pool: [
  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
  [25, 70, 78],
91
  [94, 115, 117],
92 93 94 95 96 97 98 99 100
]

---
snippet: "
  function f(arr) {
    for (let x of arr) { eval('1'); }
  }
  f([1, 2, 3]);
"
101
frame size: 20
102
parameter count: 2
103
bytecode array length: 224
104
bytecodes: [
105
  /*   10 E> */ B(CreateFunctionContext), U8(0), U8(5),
106
                B(PushContext), R(2),
107
                B(Ldar), R(this),
108
                B(StaCurrentContextSlot), U8(4),
109 110
                B(Ldar), R(arg0),
                B(StaCurrentContextSlot), U8(3),
111
                B(CreateMappedArguments),
112
                B(StaCurrentContextSlot), U8(6),
113 114
                B(Ldar), R(1),
                B(StaCurrentContextSlot), U8(5),
115
                B(CreateBlockContext), U8(1),
116
                B(PushContext), R(3),
117
                B(LdaTheHole),
118
                B(StaCurrentContextSlot), U8(2),
119
  /*   34 S> */ B(LdaContextSlot), R(3), U8(3), U8(0),
120
                B(Star), R(6),
121
                B(GetIterator), R(6), U8(0), U8(2),
122 123
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
124
                B(Star), R(5),
125
                B(LdaNamedProperty), R(5), U8(2), U8(4),
126
                B(Star), R(4),
127
                B(LdaFalse),
128 129
                B(Star), R(6),
                B(Mov), R(context), R(9),
130
                B(LdaTrue),
131
                B(Star), R(6),
132
  /*   29 S> */ B(CallProperty0), R(4), R(5), U8(6),
133
                B(Star), R(10),
134
                B(JumpIfJSReceiver), U8(7),
135 136
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
                B(LdaNamedProperty), R(10), U8(3), U8(8),
137
                B(JumpIfToBooleanTrue), U8(74),
138 139
                B(LdaNamedProperty), R(10), U8(4), U8(10),
                B(Star), R(10),
140
                B(LdaFalse),
141 142
                B(Star), R(6),
                B(Mov), R(10), R(0),
143
                B(CreateBlockContext), U8(5),
144
                B(PushContext), R(11),
145
                B(LdaTheHole),
146
                B(StaCurrentContextSlot), U8(2),
147
  /*   29 S> */ B(Ldar), R(0),
148
  /*   29 E> */ B(StaCurrentContextSlot), U8(2),
149
  /*   41 S> */ B(LdaLookupGlobalSlot), U8(6), U8(12), U8(3),
150
                B(Star), R(12),
151
                B(LdaConstant), U8(7),
152
                B(Star), R(13),
153
                B(LdaZero),
154
                B(Star), R(17),
155
                B(LdaSmi), I8(37),
156
                B(Star), R(18),
157
                B(LdaSmi), I8(41),
158 159 160 161 162 163 164 165 166
                B(Star), R(19),
                B(Mov), R(12), R(14),
                B(Mov), R(13), R(15),
                B(Mov), R(closure), R(16),
                B(CallRuntime), U16(Runtime::kResolvePossiblyDirectEval), R(14), U8(6),
                B(Star), R(12),
  /*   41 E> */ B(CallUndefinedReceiver1), R(12), R(13), U8(14),
                B(PopContext), R(11),
                B(Mov), R(0), R(10),
167
  /*   20 E> */ B(JumpLoop), U8(91), I8(0),
168
                B(LdaSmi), I8(-1),
169 170
                B(Star), R(8),
                B(Star), R(7),
171
                B(Jump), U8(7),
172
                B(Star), R(8),
173
                B(LdaZero),
174
                B(Star), R(7),
175 176
                B(LdaTheHole),
                B(SetPendingMessage),
177 178
                B(Star), R(9),
                B(Ldar), R(6),
179 180
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(12),
181
                B(LdaNamedProperty), R(5), U8(8), U8(16),
182 183 184
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(13),
                B(CallProperty0), R(13), R(5), U8(18),
185
                B(JumpIfJSReceiver), U8(21),
186 187
                B(Star), R(14),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
188
                B(Jump), U8(12),
189
                B(Star), R(12),
190
                B(LdaZero),
191
                B(TestReferenceEqual), R(7),
192
                B(JumpIfTrue), U8(5),
193
                B(Ldar), R(12),
194
                B(ReThrow),
195
                B(Ldar), R(9),
196
                B(SetPendingMessage),
197
                B(LdaZero),
198
                B(TestReferenceEqual), R(7),
199
                B(JumpIfFalse), U8(5),
200
                B(Ldar), R(8),
201
                B(ReThrow),
202
                B(PopContext), R(3),
203 204 205 206
                B(LdaUndefined),
  /*   54 S> */ B(Return),
]
constant pool: [
207
  SCOPE_INFO_TYPE,
208
  SCOPE_INFO_TYPE,
209 210 211
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
212
  SCOPE_INFO_TYPE,
213 214 215 216 217
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["eval"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["1"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
]
handlers: [
218
  [58, 152, 160],
219
  [176, 197, 199],
220 221 222 223 224 225 226 227 228
]

---
snippet: "
  function f(arr) {
    for (let x of arr) { (function() { return x; })(); }
  }
  f([1, 2, 3]);
"
229
frame size: 13
230
parameter count: 2
231
bytecode array length: 157
232
bytecodes: [
233
  /*   34 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
234 235
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
236
                B(Star), R(3),
237
                B(LdaNamedProperty), R(3), U8(0), U8(4),
238 239
                B(Star), R(2),
                B(LdaFalse),
240 241
                B(Star), R(4),
                B(Mov), R(context), R(7),
242
                B(LdaTrue),
243
                B(Star), R(4),
244
  /*   29 S> */ B(CallProperty0), R(2), R(3), U8(6),
245
                B(Star), R(8),
246
                B(JumpIfJSReceiver), U8(7),
247 248
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(8), U8(1),
                B(LdaNamedProperty), R(8), U8(1), U8(8),
249
                B(JumpIfToBooleanTrue), U8(42),
250 251
                B(LdaNamedProperty), R(8), U8(2), U8(10),
                B(Star), R(8),
252
                B(LdaFalse),
253 254
                B(Star), R(4),
                B(Mov), R(8), R(0),
255
                B(CreateBlockContext), U8(3),
256
                B(PushContext), R(9),
257
                B(LdaTheHole),
258
                B(StaCurrentContextSlot), U8(2),
259
  /*   29 S> */ B(Ldar), R(0),
260
  /*   29 E> */ B(StaCurrentContextSlot), U8(2),
261
  /*   41 S> */ B(CreateClosure), U8(4), U8(0), U8(2),
262 263 264 265
                B(Star), R(10),
  /*   67 E> */ B(CallUndefinedReceiver0), R(10), U8(12),
                B(PopContext), R(9),
                B(Mov), R(0), R(8),
266
  /*   20 E> */ B(JumpLoop), U8(59), I8(0),
267
                B(LdaSmi), I8(-1),
268 269
                B(Star), R(6),
                B(Star), R(5),
270
                B(Jump), U8(7),
271
                B(Star), R(6),
272
                B(LdaZero),
273
                B(Star), R(5),
274 275
                B(LdaTheHole),
                B(SetPendingMessage),
276 277
                B(Star), R(7),
                B(Ldar), R(4),
278 279
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(10),
280
                B(LdaNamedProperty), R(3), U8(5), U8(14),
281 282 283
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(11),
                B(CallProperty0), R(11), R(3), U8(16),
284
                B(JumpIfJSReceiver), U8(21),
285 286
                B(Star), R(12),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
287
                B(Jump), U8(12),
288
                B(Star), R(10),
289
                B(LdaZero),
290
                B(TestReferenceEqual), R(5),
291
                B(JumpIfTrue), U8(5),
292
                B(Ldar), R(10),
293
                B(ReThrow),
294
                B(Ldar), R(7),
295
                B(SetPendingMessage),
296
                B(LdaZero),
297
                B(TestReferenceEqual), R(5),
298
                B(JumpIfFalse), U8(5),
299
                B(Ldar), R(6),
300 301 302 303 304 305 306 307
                B(ReThrow),
                B(LdaUndefined),
  /*   73 S> */ B(Return),
]
constant pool: [
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
308
  SCOPE_INFO_TYPE,
309 310 311 312
  SHARED_FUNCTION_INFO_TYPE,
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
]
handlers: [
313
  [25, 87, 95],
314
  [111, 132, 134],
315 316 317 318 319 320 321 322 323
]

---
snippet: "
  function f(arr) {
    for (let { x, y } of arr) { let z = x + y; }
  }
  f([{ x: 0, y: 3 }, { x: 1, y: 9 }, { x: -12, y: 17 }]);
"
324
frame size: 16
325
parameter count: 2
326
bytecode array length: 151
327
bytecodes: [
328
  /*   41 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
329 330
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
331
                B(Star), R(7),
332
                B(LdaNamedProperty), R(7), U8(0), U8(4),
333 334
                B(Star), R(6),
                B(LdaFalse),
335 336
                B(Star), R(8),
                B(Mov), R(context), R(11),
337
                B(LdaTrue),
338
                B(Star), R(8),
339
  /*   36 S> */ B(CallProperty0), R(6), R(7), U8(6),
340
                B(Star), R(12),
341
                B(JumpIfJSReceiver), U8(7),
342 343
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
                B(LdaNamedProperty), R(12), U8(1), U8(8),
344
                B(JumpIfToBooleanTrue), U8(36),
345 346
                B(LdaNamedProperty), R(12), U8(2), U8(10),
                B(Star), R(12),
347
                B(LdaFalse),
348 349
                B(Star), R(8),
                B(Mov), R(12), R(0),
350
  /*   31 S> */ B(LdaNamedProperty), R(0), U8(3), U8(12),
351
                B(Star), R(3),
352
  /*   34 S> */ B(LdaNamedProperty), R(0), U8(4), U8(14),
353 354 355 356
                B(Star), R(4),
  /*   56 S> */ B(Ldar), R(4),
  /*   58 E> */ B(Add), R(3), U8(16),
                B(Star), R(5),
357
  /*   20 E> */ B(JumpLoop), U8(53), I8(0),
358
                B(LdaSmi), I8(-1),
359 360
                B(Star), R(10),
                B(Star), R(9),
361
                B(Jump), U8(7),
362
                B(Star), R(10),
363
                B(LdaZero),
364
                B(Star), R(9),
365
                B(LdaTheHole),
366
                B(SetPendingMessage),
367 368
                B(Star), R(11),
                B(Ldar), R(8),
369 370
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(13),
371
                B(LdaNamedProperty), R(7), U8(5), U8(17),
372 373 374
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(14),
                B(CallProperty0), R(14), R(7), U8(19),
375
                B(JumpIfJSReceiver), U8(21),
376 377
                B(Star), R(15),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
378
                B(Jump), U8(12),
379
                B(Star), R(13),
380
                B(LdaZero),
381
                B(TestReferenceEqual), R(9),
382
                B(JumpIfTrue), U8(5),
383
                B(Ldar), R(13),
384
                B(ReThrow),
385
                B(Ldar), R(11),
386
                B(SetPendingMessage),
387
                B(LdaZero),
388
                B(TestReferenceEqual), R(9),
389
                B(JumpIfFalse), U8(5),
390
                B(Ldar), R(10),
391 392 393 394 395 396 397 398 399 400 401 402 403
                B(ReThrow),
                B(LdaUndefined),
  /*   65 S> */ B(Return),
]
constant pool: [
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["y"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
]
handlers: [
404
  [25, 81, 89],
405
  [105, 126, 128],
406 407 408 409 410 411 412 413 414
]

---
snippet: "
  function* f(arr) {
    for (let x of arr) { let y = x; }
  }
  f([1, 2, 3]);
"
415
frame size: 15
416
parameter count: 2
417
bytecode array length: 181
418
bytecodes: [
419
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
420 421
                B(Mov), R(closure), R(5),
                B(Mov), R(this), R(6),
422
  /*   11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(5), U8(2),
423 424 425
                B(Star), R(0),
  /*   11 E> */ B(SuspendGenerator), R(0), R(0), U8(5), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(5),
426
                B(Star), R(5),
427
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
428
                B(SwitchOnSmiNoFeedback), U8(1), U8(2), I8(0),
429
                B(Ldar), R(5),
430
  /*   11 E> */ B(Throw),
431
                B(Ldar), R(5),
432
  /*   55 S> */ B(Return),
433
  /*   35 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
434 435
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
436
                B(Star), R(6),
437
                B(LdaNamedProperty), R(6), U8(3), U8(4),
438 439
                B(Star), R(5),
                B(LdaFalse),
440 441
                B(Star), R(7),
                B(Mov), R(context), R(10),
442
                B(LdaTrue),
443
                B(Star), R(7),
444
  /*   30 S> */ B(CallProperty0), R(5), R(6), U8(6),
445
                B(Star), R(11),
446
                B(JumpIfJSReceiver), U8(7),
447 448
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
                B(LdaNamedProperty), R(11), U8(4), U8(8),
449
                B(JumpIfToBooleanTrue), U8(25),
450 451
                B(LdaNamedProperty), R(11), U8(5), U8(10),
                B(Star), R(11),
452
                B(LdaFalse),
453 454
                B(Star), R(7),
                B(Mov), R(11), R(1),
455 456
  /*   30 S> */ B(Mov), R(1), R(3),
  /*   50 S> */ B(Mov), R(3), R(4),
457
                B(Ldar), R(11),
458
  /*   21 E> */ B(JumpLoop), U8(42), I8(0),
459
                B(LdaSmi), I8(-1),
460 461
                B(Star), R(9),
                B(Star), R(8),
462
                B(Jump), U8(7),
463
                B(Star), R(9),
464
                B(LdaZero),
465
                B(Star), R(8),
466
                B(LdaTheHole),
467
                B(SetPendingMessage),
468 469
                B(Star), R(10),
                B(Ldar), R(7),
470 471
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(12),
472
                B(LdaNamedProperty), R(6), U8(6), U8(12),
473 474 475
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(13),
                B(CallProperty0), R(13), R(6), U8(14),
476
                B(JumpIfJSReceiver), U8(21),
477 478
                B(Star), R(14),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
479
                B(Jump), U8(12),
480
                B(Star), R(12),
481
                B(LdaZero),
482
                B(TestReferenceEqual), R(8),
483
                B(JumpIfTrue), U8(5),
484
                B(Ldar), R(12),
485
                B(ReThrow),
486
                B(Ldar), R(10),
487
                B(SetPendingMessage),
488
                B(LdaZero),
489
                B(TestReferenceEqual), R(8),
490
                B(JumpIfFalse), U8(5),
491
                B(Ldar), R(9),
492 493 494 495 496
                B(ReThrow),
                B(LdaUndefined),
  /*   55 S> */ B(Return),
]
constant pool: [
497
  Smi [21],
498
  Smi [10],
499
  Smi [7],
500 501 502 503 504 505
  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: [
506
  [66, 111, 119],
507
  [135, 156, 158],
508 509 510 511 512 513 514 515 516
]

---
snippet: "
  function* f(arr) {
    for (let x of arr) yield x;
  }
  f([1, 2, 3]);
"
517
frame size: 14
518
parameter count: 2
519
bytecode array length: 225
520
bytecodes: [
521
                B(SwitchOnGeneratorState), R(0), U8(0), U8(2),
522 523
                B(Mov), R(closure), R(4),
                B(Mov), R(this), R(5),
524
  /*   11 E> */ B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
525 526 527
                B(Star), R(0),
  /*   11 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(4),
528
                B(Star), R(4),
529
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
530
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
531
                B(Ldar), R(4),
532
  /*   11 E> */ B(Throw),
533
                B(Ldar), R(4),
534
  /*   49 S> */ B(Return),
535
  /*   35 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
536 537
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
538
                B(Star), R(5),
539
                B(LdaNamedProperty), R(5), U8(4), U8(4),
540 541
                B(Star), R(4),
                B(LdaFalse),
542 543
                B(Star), R(6),
                B(Mov), R(context), R(9),
544
                B(LdaTrue),
545
                B(Star), R(6),
546
  /*   30 S> */ B(CallProperty0), R(4), R(5), U8(6),
547
                B(Star), R(10),
548
                B(JumpIfJSReceiver), U8(7),
549 550
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(10), U8(1),
                B(LdaNamedProperty), R(10), U8(5), U8(8),
551
                B(JumpIfToBooleanTrue), U8(63),
552 553
                B(LdaNamedProperty), R(10), U8(6), U8(10),
                B(Star), R(10),
554
                B(LdaFalse),
555 556
                B(Star), R(6),
                B(Mov), R(10), R(1),
557
  /*   30 S> */ B(Mov), R(1), R(3),
558
  /*   40 S> */ B(LdaFalse),
559 560 561 562 563 564
                B(Star), R(12),
                B(Mov), R(3), R(11),
                B(InvokeIntrinsic), U8(Runtime::k_CreateIterResultObject), R(11), U8(2),
  /*   40 E> */ B(SuspendGenerator), R(0), R(0), U8(11), U8(1),
                B(ResumeGenerator), R(0), R(0), U8(11),
                B(Star), R(11),
565
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
566
                B(SwitchOnSmiNoFeedback), U8(7), U8(2), I8(0),
567
                B(Ldar), R(11),
568
  /*   40 E> */ B(Throw),
569
                B(LdaSmi), I8(1),
570 571
                B(Star), R(7),
                B(Mov), R(11), R(8),
572
                B(Jump), U8(20),
573
                B(Ldar), R(11),
574
  /*   21 E> */ B(JumpLoop), U8(80), I8(0),
575
                B(LdaSmi), I8(-1),
576 577
                B(Star), R(8),
                B(Star), R(7),
578
                B(Jump), U8(7),
579
                B(Star), R(8),
580
                B(LdaZero),
581
                B(Star), R(7),
582 583
                B(LdaTheHole),
                B(SetPendingMessage),
584 585
                B(Star), R(9),
                B(Ldar), R(6),
586 587
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(11),
588
                B(LdaNamedProperty), R(5), U8(9), U8(12),
589 590 591
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(12),
                B(CallProperty0), R(12), R(5), U8(14),
592
                B(JumpIfJSReceiver), U8(21),
593 594
                B(Star), R(13),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(13), U8(1),
595
                B(Jump), U8(12),
596
                B(Star), R(11),
597
                B(LdaZero),
598
                B(TestReferenceEqual), R(7),
599
                B(JumpIfTrue), U8(5),
600
                B(Ldar), R(11),
601 602
                B(ReThrow),
                B(Ldar), R(9),
603 604
                B(SetPendingMessage),
                B(Ldar), R(7),
605
                B(SwitchOnSmiNoFeedback), U8(10), U8(2), I8(0),
606
                B(Jump), U8(8),
607
                B(Ldar), R(8),
608
                B(ReThrow),
609
                B(Ldar), R(8),
610
  /*   49 S> */ B(Return),
611 612 613 614
                B(LdaUndefined),
  /*   49 S> */ B(Return),
]
constant pool: [
615
  Smi [21],
616
  Smi [118],
617
  Smi [10],
618
  Smi [7],
619 620 621
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
622
  Smi [16],
623
  Smi [7],
624
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
625
  Smi [6],
626
  Smi [9],
627 628
]
handlers: [
629
  [66, 149, 157],
630
  [173, 194, 196],
631 632 633 634 635 636 637 638 639
]

---
snippet: "
  async function f(arr) {
    for (let x of arr) { let y = x; }
  }
  f([1, 2, 3]);
"
640
frame size: 16
641
parameter count: 2
642
bytecode array length: 195
643
bytecodes: [
644 645
                B(Mov), R(closure), R(5),
                B(Mov), R(this), R(6),
646
  /*   16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(5), U8(2),
647
                B(Star), R(0),
648
                B(Mov), R(context), R(5),
649
  /*   40 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
650 651
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
652
                B(Star), R(7),
653
                B(LdaNamedProperty), R(7), U8(0), U8(4),
654 655
                B(Star), R(6),
                B(LdaFalse),
656 657
                B(Star), R(8),
                B(Mov), R(context), R(11),
658
                B(LdaTrue),
659
                B(Star), R(8),
660
  /*   35 S> */ B(CallProperty0), R(6), R(7), U8(6),
661
                B(Star), R(12),
662
                B(JumpIfJSReceiver), U8(7),
663 664
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(12), U8(1),
                B(LdaNamedProperty), R(12), U8(1), U8(8),
665
                B(JumpIfToBooleanTrue), U8(25),
666 667
                B(LdaNamedProperty), R(12), U8(2), U8(10),
                B(Star), R(12),
668
                B(LdaFalse),
669 670
                B(Star), R(8),
                B(Mov), R(12), R(1),
671 672
  /*   35 S> */ B(Mov), R(1), R(3),
  /*   55 S> */ B(Mov), R(3), R(4),
673
                B(Ldar), R(12),
674
  /*   26 E> */ B(JumpLoop), U8(42), I8(0),
675
                B(LdaSmi), I8(-1),
676 677
                B(Star), R(10),
                B(Star), R(9),
678
                B(Jump), U8(7),
679
                B(Star), R(10),
680
                B(LdaZero),
681
                B(Star), R(9),
682
                B(LdaTheHole),
683
                B(SetPendingMessage),
684 685
                B(Star), R(11),
                B(Ldar), R(8),
686 687
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(13),
688
                B(LdaNamedProperty), R(7), U8(3), U8(12),
689 690 691
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(14),
                B(CallProperty0), R(14), R(7), U8(14),
692
                B(JumpIfJSReceiver), U8(21),
693 694
                B(Star), R(15),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(15), U8(1),
695
                B(Jump), U8(12),
696
                B(Star), R(13),
697
                B(LdaZero),
698
                B(TestReferenceEqual), R(9),
699
                B(JumpIfTrue), U8(5),
700
                B(Ldar), R(13),
701
                B(ReThrow),
702
                B(Ldar), R(11),
703
                B(SetPendingMessage),
704
                B(LdaZero),
705
                B(TestReferenceEqual), R(9),
706
                B(JumpIfFalse), U8(5),
707
                B(Ldar), R(10),
708 709
                B(ReThrow),
                B(LdaUndefined),
710
                B(Star), R(7),
711
                B(LdaFalse),
712
                B(Star), R(8),
713
                B(Mov), R(0), R(6),
714
                B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(6), U8(3),
715
  /*   60 S> */ B(Return),
716
                B(Star), R(6),
717
                B(CreateCatchContext), R(6), U8(4),
718
                B(Star), R(5),
719 720
                B(LdaTheHole),
                B(SetPendingMessage),
721 722
                B(Ldar), R(5),
                B(PushContext), R(6),
723
                B(LdaImmutableCurrentContextSlot), U8(2),
724
                B(Star), R(8),
725
                B(LdaFalse),
726
                B(Star), R(9),
727
                B(Mov), R(0), R(7),
728
                B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(7), U8(3),
729 730 731 732 733 734 735
  /*   60 S> */ B(Return),
]
constant pool: [
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
736
  SCOPE_INFO_TYPE,
737 738
]
handlers: [
739
  [15, 167, 167],
740
  [40, 85, 93],
741
  [109, 130, 132],
742 743 744 745 746 747 748 749 750
]

---
snippet: "
  async function f(arr) {
    for (let x of arr) await x;
  }
  f([1, 2, 3]);
"
751
frame size: 15
752
parameter count: 2
753
bytecode array length: 231
754
bytecodes: [
755
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
756 757
                B(Mov), R(closure), R(4),
                B(Mov), R(this), R(5),
758
  /*   16 E> */ B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionEnter), R(4), U8(2),
759
                B(Star), R(0),
760
                B(Mov), R(context), R(4),
761
  /*   40 S> */ B(GetIterator), R(arg0), U8(0), U8(2),
762 763
                B(JumpIfJSReceiver), U8(7),
                B(CallRuntime), U16(Runtime::kThrowSymbolIteratorInvalid), R(0), U8(0),
764
                B(Star), R(6),
765
                B(LdaNamedProperty), R(6), U8(1), U8(4),
766 767
                B(Star), R(5),
                B(LdaFalse),
768 769
                B(Star), R(7),
                B(Mov), R(context), R(10),
770
                B(LdaTrue),
771
                B(Star), R(7),
772
  /*   35 S> */ B(CallProperty0), R(5), R(6), U8(6),
773
                B(Star), R(11),
774
                B(JumpIfJSReceiver), U8(7),
775 776
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(11), U8(1),
                B(LdaNamedProperty), R(11), U8(2), U8(8),
777
                B(JumpIfToBooleanTrue), U8(57),
778 779
                B(LdaNamedProperty), R(11), U8(3), U8(10),
                B(Star), R(11),
780
                B(LdaFalse),
781 782
                B(Star), R(7),
                B(Mov), R(11), R(1),
783
  /*   35 S> */ B(Mov), R(1), R(3),
784 785 786 787 788 789
  /*   45 S> */ B(Mov), R(0), R(12),
                B(Mov), R(3), R(13),
                B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionAwaitUncaught), R(12), U8(2),
  /*   45 E> */ B(SuspendGenerator), R(0), R(0), U8(12), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(12),
                B(Star), R(12),
790
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
791
                B(Star), R(13),
792
                B(LdaZero),
793
                B(TestReferenceEqual), R(13),
794
                B(JumpIfTrue), U8(5),
795
                B(Ldar), R(12),
796
                B(ReThrow),
797
                B(Ldar), R(12),
798
  /*   26 E> */ B(JumpLoop), U8(74), I8(0),
799
                B(LdaSmi), I8(-1),
800 801
                B(Star), R(9),
                B(Star), R(8),
802
                B(Jump), U8(7),
803
                B(Star), R(9),
804
                B(LdaZero),
805
                B(Star), R(8),
806 807
                B(LdaTheHole),
                B(SetPendingMessage),
808 809
                B(Star), R(10),
                B(Ldar), R(7),
810 811
                B(JumpIfToBooleanTrue), U8(38),
                B(Mov), R(context), R(12),
812
                B(LdaNamedProperty), R(6), U8(4), U8(12),
813 814 815
                B(JumpIfUndefinedOrNull), U8(29),
                B(Star), R(13),
                B(CallProperty0), R(13), R(6), U8(14),
816
                B(JumpIfJSReceiver), U8(21),
817 818
                B(Star), R(14),
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(14), U8(1),
819
                B(Jump), U8(12),
820
                B(Star), R(12),
821
                B(LdaZero),
822
                B(TestReferenceEqual), R(8),
823
                B(JumpIfTrue), U8(5),
824
                B(Ldar), R(12),
825
                B(ReThrow),
826
                B(Ldar), R(10),
827 828
                B(SetPendingMessage),
                B(LdaZero),
829
                B(TestReferenceEqual), R(8),
830
                B(JumpIfFalse), U8(5),
831
                B(Ldar), R(9),
832 833
                B(ReThrow),
                B(LdaUndefined),
834
                B(Star), R(6),
835
                B(LdaTrue),
836
                B(Star), R(7),
837
                B(Mov), R(0), R(5),
838
                B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionResolve), R(5), U8(3),
839
  /*   54 S> */ B(Return),
840
                B(Star), R(5),
841
                B(CreateCatchContext), R(5), U8(5),
842
                B(Star), R(4),
843 844
                B(LdaTheHole),
                B(SetPendingMessage),
845 846
                B(Ldar), R(4),
                B(PushContext), R(5),
847
                B(LdaImmutableCurrentContextSlot), U8(2),
848
                B(Star), R(7),
849
                B(LdaTrue),
850
                B(Star), R(8),
851
                B(Mov), R(0), R(6),
852
                B(InvokeIntrinsic), U8(Runtime::k_AsyncFunctionReject), R(6), U8(3),
853 854 855
  /*   54 S> */ B(Return),
]
constant pool: [
856
  Smi [96],
857 858 859 860
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["return"],
861
  SCOPE_INFO_TYPE,
862 863
]
handlers: [
864
  [19, 203, 203],
865
  [44, 121, 129],
866
  [145, 166, 168],
867 868
]