1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
|
#
# Autogenerated by generate-bytecode-expectations.
#
---
wrap: yes
---
snippet: "
let x = 10; function f1() {return x;}
"
frame size: 1
parameter count: 1
bytecode array length: 14
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(10),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 72 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
let x = 10; function f1() {return x;} return x;
"
frame size: 1
parameter count: 1
bytecode array length: 15
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(10),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 72 S> */ B(LdaImmutableCurrentContextSlot), U8(2),
/* 81 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
---
snippet: "
let x = (x = 20); function f1() {return x;}
"
frame size: 2
parameter count: 1
bytecode array length: 24
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(20),
B(Star), R(1),
B(LdaCurrentContextSlot), U8(2),
/* 45 E> */ B(ThrowReferenceErrorIfHole), U8(1),
B(Ldar), R(1),
B(StaCurrentContextSlot), U8(2),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 78 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
ONE_BYTE_INTERNALIZED_STRING_TYPE ["x"],
]
handlers: [
]
---
snippet: "
let x = 10; x = 20; function f1() {return x;}
"
frame size: 1
parameter count: 1
bytecode array length: 18
bytecodes: [
/* 30 E> */ B(CreateFunctionContext), U8(0), U8(1),
B(PushContext), R(0),
B(LdaTheHole),
B(StaCurrentContextSlot), U8(2),
/* 42 S> */ B(LdaSmi), I8(10),
/* 42 E> */ B(StaCurrentContextSlot), U8(2),
/* 46 S> */ B(LdaSmi), I8(20),
/* 48 E> */ B(StaCurrentContextSlot), U8(2),
B(LdaUndefined),
/* 80 S> */ B(Return),
]
constant pool: [
SCOPE_INFO_TYPE,
]
handlers: [
]
|