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

---
wrap: no
module: yes
top level: yes

---
snippet: "
  import \"bar\";
"
14
frame size: 5
15
parameter count: 2
16
bytecode array length: 62
17
bytecodes: [
18
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
19
                B(LdaConstant), U8(1),
20
                B(Star), R(3),
21
                B(Mov), R(arg0), R(2),
22
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
23
                B(PushContext), R(2),
24
                B(Mov), R(closure), R(3),
25 26
                B(Mov), R(this), R(4),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
27
                B(Star), R(0),
28
  /*    0 E> */ B(StackCheck),
29 30 31
  /*    0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(3),
                B(Star), R(3),
32
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
33
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
34
                B(Ldar), R(3),
35
  /*    0 E> */ B(Throw),
36
                B(Ldar), R(3),
37
  /*   14 S> */ B(Return),
38
                B(Mov), R(3), R(1),
39
                B(Ldar), R(1),
40
  /*   14 S> */ B(Return),
41 42
]
constant pool: [
43
  Smi [36],
44
  SCOPE_INFO_TYPE,
45
  Smi [10],
46
  Smi [7],
47 48 49 50 51 52 53 54
]
handlers: [
]

---
snippet: "
  import {foo} from \"bar\";
"
55
frame size: 5
56
parameter count: 2
57
bytecode array length: 62
58
bytecodes: [
59
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
60
                B(LdaConstant), U8(1),
61
                B(Star), R(3),
62
                B(Mov), R(arg0), R(2),
63
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
64
                B(PushContext), R(2),
65
                B(Mov), R(closure), R(3),
66 67
                B(Mov), R(this), R(4),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
68
                B(Star), R(0),
69
  /*    0 E> */ B(StackCheck),
70 71 72
  /*    0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(3),
                B(Star), R(3),
73
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
74
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
75
                B(Ldar), R(3),
76
  /*    0 E> */ B(Throw),
77
                B(Ldar), R(3),
78
  /*   25 S> */ B(Return),
79
                B(Mov), R(3), R(1),
80
                B(Ldar), R(1),
81
  /*   25 S> */ B(Return),
82 83
]
constant pool: [
84
  Smi [36],
85
  SCOPE_INFO_TYPE,
86
  Smi [10],
87
  Smi [7],
88 89 90 91 92 93 94 95 96 97
]
handlers: [
]

---
snippet: "
  import {foo as goo} from \"bar\";
  goo(42);
  { let x; { goo(42) } };
"
98
frame size: 6
99
parameter count: 2
100
bytecode array length: 92
101
bytecodes: [
102
                B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
103
                B(LdaConstant), U8(1),
104
                B(Star), R(4),
105
                B(Mov), R(arg0), R(3),
106
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
107
                B(PushContext), R(3),
108
                B(Mov), R(closure), R(4),
109 110
                B(Mov), R(this), R(5),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
111
                B(Star), R(1),
112
  /*    0 E> */ B(StackCheck),
113 114 115
  /*    0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
                B(ResumeGenerator), R(1), R(0), U8(4),
                B(Star), R(4),
116
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
117
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
118
                B(Ldar), R(4),
119
  /*    0 E> */ B(Throw),
120
                B(Ldar), R(4),
121
  /*   65 S> */ B(Return),
122
  /*   32 S> */ B(LdaModuleVariable), I8(-1), U8(0),
123
                B(ThrowReferenceErrorIfHole), U8(4),
124
                B(Star), R(4),
125
                B(LdaSmi), I8(42),
126 127
                B(Star), R(5),
  /*   32 E> */ B(CallUndefinedReceiver1), R(4), R(5), U8(0),
128
  /*   47 S> */ B(LdaUndefined),
129 130
                B(Star), R(0),
  /*   52 S> */ B(LdaModuleVariable), I8(-1), U8(0),
131
                B(ThrowReferenceErrorIfHole), U8(4),
132
                B(Star), R(4),
133
                B(LdaSmi), I8(42),
134 135
                B(Star), R(5),
  /*   52 E> */ B(CallUndefinedReceiver1), R(4), R(5), U8(2),
136
                B(Star), R(2),
137
  /*   65 S> */ B(Return),
138 139
]
constant pool: [
140
  Smi [36],
141
  SCOPE_INFO_TYPE,
142
  Smi [10],
143
  Smi [7],
144 145 146 147 148 149 150 151 152 153 154
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["goo"],
]
handlers: [
]

---
snippet: "
  export var foo = 42;
  foo++;
  { let x; { foo++ } };
"
155
frame size: 6
156
parameter count: 2
157
bytecode array length: 90
158
bytecodes: [
159
                B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
160
                B(LdaConstant), U8(1),
161
                B(Star), R(4),
162
                B(Mov), R(arg0), R(3),
163
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
164
                B(PushContext), R(3),
165
                B(Mov), R(closure), R(4),
166 167
                B(Mov), R(this), R(5),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
168
                B(Star), R(1),
169
  /*    0 E> */ B(StackCheck),
170 171 172
  /*    0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
                B(ResumeGenerator), R(1), R(0), U8(4),
                B(Star), R(4),
173
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
174
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
175
                B(Ldar), R(4),
176
  /*    0 E> */ B(Throw),
177
                B(Ldar), R(4),
178
  /*   50 S> */ B(Return),
179 180 181
  /*   17 S> */ B(LdaSmi), I8(42),
  /*   17 E> */ B(StaModuleVariable), I8(1), U8(0),
  /*   21 S> */ B(LdaModuleVariable), I8(1), U8(0),
182
                B(Inc), U8(0),
183
  /*   24 E> */ B(StaModuleVariable), I8(1), U8(0),
184
  /*   34 S> */ B(LdaUndefined),
185 186
                B(Star), R(0),
  /*   39 S> */ B(LdaModuleVariable), I8(1), U8(0),
187
                B(ToNumeric), U8(1),
188
                B(Star), R(4),
189
                B(Inc), U8(1),
190
  /*   42 E> */ B(StaModuleVariable), I8(1), U8(0),
191
                B(Mov), R(4), R(2),
192
                B(Ldar), R(2),
193
  /*   50 S> */ B(Return),
194 195
]
constant pool: [
196
  Smi [36],
197
  SCOPE_INFO_TYPE,
198
  Smi [10],
199
  Smi [7],
200 201 202 203 204 205 206 207 208 209
]
handlers: [
]

---
snippet: "
  export let foo = 42;
  foo++;
  { let x; { foo++ } };
"
210
frame size: 6
211
parameter count: 2
212
bytecode array length: 96
213
bytecodes: [
214
                B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
215
                B(LdaConstant), U8(1),
216
                B(Star), R(4),
217
                B(Mov), R(arg0), R(3),
218
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
219
                B(PushContext), R(3),
220
                B(Mov), R(closure), R(4),
221 222
                B(Mov), R(this), R(5),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
223
                B(Star), R(1),
224
                B(LdaTheHole),
225
                B(StaModuleVariable), I8(1), U8(0),
226
  /*    0 E> */ B(StackCheck),
227
                B(Ldar), R(1),
228 229 230
  /*    0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
                B(ResumeGenerator), R(1), R(0), U8(4),
                B(Star), R(4),
231
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
232
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
233
                B(Ldar), R(4),
234
  /*    0 E> */ B(Throw),
235
                B(Ldar), R(4),
236
  /*   50 S> */ B(Return),
237 238 239
  /*   17 S> */ B(LdaSmi), I8(42),
  /*   17 E> */ B(StaModuleVariable), I8(1), U8(0),
  /*   21 S> */ B(LdaModuleVariable), I8(1), U8(0),
240
                B(Inc), U8(0),
241
  /*   24 E> */ B(StaModuleVariable), I8(1), U8(0),
242
  /*   34 S> */ B(LdaUndefined),
243 244
                B(Star), R(0),
  /*   39 S> */ B(LdaModuleVariable), I8(1), U8(0),
245
                B(ToNumeric), U8(1),
246
                B(Star), R(4),
247
                B(Inc), U8(1),
248
  /*   42 E> */ B(StaModuleVariable), I8(1), U8(0),
249
                B(Mov), R(4), R(2),
250
                B(Ldar), R(2),
251
  /*   50 S> */ B(Return),
252 253
]
constant pool: [
254
  Smi [42],
255
  SCOPE_INFO_TYPE,
256
  Smi [10],
257
  Smi [7],
258 259 260 261 262 263 264 265 266 267
]
handlers: [
]

---
snippet: "
  export const foo = 42;
  foo++;
  { let x; { foo++ } };
"
268
frame size: 6
269
parameter count: 2
270
bytecode array length: 100
271
bytecodes: [
272
                B(SwitchOnGeneratorState), R(1), U8(0), U8(1),
273
                B(LdaConstant), U8(1),
274
                B(Star), R(4),
275
                B(Mov), R(arg0), R(3),
276
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
277
                B(PushContext), R(3),
278
                B(Mov), R(closure), R(4),
279 280
                B(Mov), R(this), R(5),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
281
                B(Star), R(1),
282
                B(LdaTheHole),
283
                B(StaModuleVariable), I8(1), U8(0),
284
  /*    0 E> */ B(StackCheck),
285
                B(Ldar), R(1),
286 287 288
  /*    0 E> */ B(SuspendGenerator), R(1), R(0), U8(4), U8(0),
                B(ResumeGenerator), R(1), R(0), U8(4),
                B(Star), R(4),
289
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(1), U8(1),
290
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
291
                B(Ldar), R(4),
292
  /*    0 E> */ B(Throw),
293
                B(Ldar), R(4),
294
  /*   52 S> */ B(Return),
295 296 297
  /*   19 S> */ B(LdaSmi), I8(42),
  /*   19 E> */ B(StaModuleVariable), I8(1), U8(0),
  /*   23 S> */ B(LdaModuleVariable), I8(1), U8(0),
298
                B(Inc), U8(0),
299 300
  /*   26 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
  /*   36 S> */ B(LdaUndefined),
301 302
                B(Star), R(0),
  /*   41 S> */ B(LdaModuleVariable), I8(1), U8(0),
303
                B(ToNumeric), U8(1),
304
                B(Star), R(4),
305
                B(Inc), U8(1),
306
  /*   44 E> */ B(CallRuntime), U16(Runtime::kThrowConstAssignError), R(0), U8(0),
307
                B(Mov), R(4), R(2),
308
                B(Ldar), R(2),
309
  /*   52 S> */ B(Return),
310 311
]
constant pool: [
312
  Smi [42],
313
  SCOPE_INFO_TYPE,
314
  Smi [10],
315
  Smi [7],
316 317 318 319 320 321 322 323
]
handlers: [
]

---
snippet: "
  export default (function () {});
"
324
frame size: 5
325
parameter count: 2
326
bytecode array length: 75
327
bytecodes: [
328
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
329
                B(LdaConstant), U8(1),
330
                B(Star), R(3),
331
                B(Mov), R(arg0), R(2),
332
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
333
                B(PushContext), R(2),
334
                B(Mov), R(closure), R(3),
335 336
                B(Mov), R(this), R(4),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
337
                B(Star), R(0),
338
                B(LdaTheHole),
339
                B(StaModuleVariable), I8(1), U8(0),
340
  /*    0 E> */ B(StackCheck),
341
                B(Ldar), R(0),
342 343 344
  /*    0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(3),
                B(Star), R(3),
345
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
346
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
347
                B(Ldar), R(3),
348
  /*    0 E> */ B(Throw),
349
                B(Ldar), R(3),
350
  /*   33 S> */ B(Return),
351
                B(Mov), R(3), R(1),
352
                B(CreateClosure), U8(4), U8(0), U8(0),
353
                B(StaModuleVariable), I8(1), U8(0),
354
                B(Ldar), R(1),
355
  /*   33 S> */ B(Return),
356 357
]
constant pool: [
358
  Smi [42],
359
  SCOPE_INFO_TYPE,
360
  Smi [10],
361
  Smi [7],
362 363 364 365 366 367 368 369 370
  SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

---
snippet: "
  export default (class {});
"
371
frame size: 7
372
parameter count: 2
373
bytecode array length: 96
374
bytecodes: [
375
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
376
                B(LdaConstant), U8(1),
377
                B(Star), R(3),
378
                B(Mov), R(arg0), R(2),
379
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
380
                B(PushContext), R(2),
381
                B(Mov), R(closure), R(3),
382 383
                B(Mov), R(this), R(4),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
384
                B(Star), R(0),
385
                B(LdaTheHole),
386
                B(StaModuleVariable), I8(1), U8(0),
387
  /*    0 E> */ B(StackCheck),
388
                B(Ldar), R(0),
389 390 391
  /*    0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(3),
                B(Star), R(3),
392
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
393
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
394
                B(Ldar), R(3),
395
  /*    0 E> */ B(Throw),
396
                B(Ldar), R(3),
397
  /*   27 S> */ B(Return),
398
                B(Mov), R(3), R(1),
399
                B(LdaTheHole),
400
                B(Star), R(6),
401
                B(CreateClosure), U8(5), U8(0), U8(0),
402
                B(Star), R(3),
403
                B(LdaConstant), U8(4),
404 405 406 407 408
                B(Star), R(4),
                B(Mov), R(3), R(5),
                B(CallRuntime), U16(Runtime::kDefineClass), R(4), U8(3),
                B(Star), R(4),
                B(Ldar), R(5),
409
                B(StaModuleVariable), I8(1), U8(0),
410
                B(Ldar), R(1),
411
  /*   27 S> */ B(Return),
412 413
]
constant pool: [
414
  Smi [42],
415
  SCOPE_INFO_TYPE,
416
  Smi [10],
417
  Smi [7],
418
  FIXED_ARRAY_TYPE,
419 420 421 422 423 424 425 426 427
  SHARED_FUNCTION_INFO_TYPE,
]
handlers: [
]

---
snippet: "
  export {foo as goo} from \"bar\"
"
428
frame size: 5
429
parameter count: 2
430
bytecode array length: 62
431
bytecodes: [
432
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
433
                B(LdaConstant), U8(1),
434
                B(Star), R(3),
435
                B(Mov), R(arg0), R(2),
436
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
437
                B(PushContext), R(2),
438
                B(Mov), R(closure), R(3),
439 440
                B(Mov), R(this), R(4),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
441
                B(Star), R(0),
442
  /*    0 E> */ B(StackCheck),
443 444 445
  /*    0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(3),
                B(Star), R(3),
446
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
447
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
448
                B(Ldar), R(3),
449
  /*    0 E> */ B(Throw),
450
                B(Ldar), R(3),
451
  /*   31 S> */ B(Return),
452
                B(Mov), R(3), R(1),
453
                B(Ldar), R(1),
454
  /*   31 S> */ B(Return),
455 456
]
constant pool: [
457
  Smi [36],
458
  SCOPE_INFO_TYPE,
459
  Smi [10],
460
  Smi [7],
461 462 463 464 465 466 467 468
]
handlers: [
]

---
snippet: "
  export * from \"bar\"
"
469
frame size: 5
470
parameter count: 2
471
bytecode array length: 62
472
bytecodes: [
473
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
474
                B(LdaConstant), U8(1),
475
                B(Star), R(3),
476
                B(Mov), R(arg0), R(2),
477
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(2), U8(2),
478
                B(PushContext), R(2),
479
                B(Mov), R(closure), R(3),
480 481
                B(Mov), R(this), R(4),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(3), U8(2),
482
                B(Star), R(0),
483
  /*    0 E> */ B(StackCheck),
484 485 486
  /*    0 E> */ B(SuspendGenerator), R(0), R(0), U8(3), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(3),
                B(Star), R(3),
487
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
488
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
489
                B(Ldar), R(3),
490
  /*    0 E> */ B(Throw),
491
                B(Ldar), R(3),
492
  /*   20 S> */ B(Return),
493
                B(Mov), R(3), R(1),
494
                B(Ldar), R(1),
495
  /*   20 S> */ B(Return),
496 497
]
constant pool: [
498
  Smi [36],
499
  SCOPE_INFO_TYPE,
500
  Smi [10],
501
  Smi [7],
502 503 504 505
]
handlers: [
]

506 507 508 509 510
---
snippet: "
  import * as foo from \"bar\"
  foo.f(foo, foo.x);
"
511
frame size: 8
512
parameter count: 2
513
bytecode array length: 89
514
bytecodes: [
515
                B(SwitchOnGeneratorState), R(0), U8(0), U8(1),
516
                B(LdaConstant), U8(1),
517
                B(Star), R(4),
518
                B(Mov), R(arg0), R(3),
519
                B(CallRuntime), U16(Runtime::kPushModuleContext), R(3), U8(2),
520
                B(PushContext), R(3),
521
                B(Mov), R(closure), R(4),
522 523
                B(Mov), R(this), R(5),
                B(InvokeIntrinsic), U8(Runtime::k_CreateJSGeneratorObject), R(4), U8(2),
524
                B(Star), R(0),
525
                B(LdaZero),
526 527
                B(Star), R(4),
                B(CallRuntime), U16(Runtime::kGetModuleNamespace), R(4), U8(1),
528
                B(Star), R(1),
529
  /*    0 E> */ B(StackCheck),
530
                B(Ldar), R(0),
531 532 533
  /*    0 E> */ B(SuspendGenerator), R(0), R(0), U8(4), U8(0),
                B(ResumeGenerator), R(0), R(0), U8(4),
                B(Star), R(4),
534
                B(InvokeIntrinsic), U8(Runtime::k_GeneratorGetResumeMode), R(0), U8(1),
535
                B(SwitchOnSmiNoFeedback), U8(2), U8(2), I8(0),
536
                B(Ldar), R(4),
537
  /*    0 E> */ B(Throw),
538
                B(Ldar), R(4),
539
  /*   46 S> */ B(Return),
540
  /*   31 S> */ B(LdaNamedProperty), R(1), U8(4), U8(0),
541
                B(Star), R(4),
542
  /*   42 E> */ B(LdaNamedProperty), R(1), U8(5), U8(2),
543
                B(Star), R(7),
544
  /*   31 E> */ B(CallProperty2), R(4), R(1), R(1), R(7), U8(4),
545
                B(Star), R(2),
546
  /*   46 S> */ B(Return),
547 548
]
constant pool: [
549
  Smi [48],
550
  SCOPE_INFO_TYPE,
551
  Smi [10],
552
  Smi [7],
553 554 555 556 557 558
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["f"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
]
handlers: [
]