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

---
wrap: yes

---
snippet: "
  return [ 1, 2 ];
"
frame size: 0
parameter count: 1
bytecode array length: 6
bytecodes: [
16
  /*   30 E> */ B(StackCheck),
17
  /*   34 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
18
  /*   50 S> */ B(Return),
19 20
]
constant pool: [
21
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
22 23 24 25 26 27 28 29
]
handlers: [
]

---
snippet: "
  var a = 1; return [ a, a + 1 ];
"
30
frame size: 3
31
parameter count: 1
32
bytecode array length: 36
33
bytecodes: [
34
  /*   30 E> */ B(StackCheck),
35
  /*   42 S> */ B(LdaSmi), I8(1),
36
                B(Star), R(0),
37
  /*   45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
38
                B(Star), R(2),
39 40
                B(LdaZero),
                B(Star), R(1),
41
                B(Ldar), R(0),
42
  /*   54 E> */ B(StaInArrayLiteral), R(2), R(1), U8(1),
43
                B(LdaSmi), I8(1),
44
                B(Star), R(1),
45
                B(Ldar), R(0),
46
  /*   59 E> */ B(AddSmi), I8(1), U8(3),
47 48
                B(StaInArrayLiteral), R(2), R(1), U8(1),
                B(Ldar), R(2),
49
  /*   65 S> */ B(Return),
50 51
]
constant pool: [
52
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
53 54 55 56 57 58 59 60 61 62 63 64
]
handlers: [
]

---
snippet: "
  return [ [ 1, 2 ], [ 3 ] ];
"
frame size: 0
parameter count: 1
bytecode array length: 6
bytecodes: [
65
  /*   30 E> */ B(StackCheck),
66
  /*   34 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(4),
67
  /*   61 S> */ B(Return),
68 69
]
constant pool: [
70
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
71 72 73 74 75 76 77 78
]
handlers: [
]

---
snippet: "
  var a = 1; return [ [ a, 2 ], [ a + 2 ] ];
"
79
frame size: 5
80
parameter count: 1
81
bytecode array length: 66
82
bytecodes: [
83
  /*   30 E> */ B(StackCheck),
84
  /*   42 S> */ B(LdaSmi), I8(1),
85
                B(Star), R(0),
86
  /*   45 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(4),
87 88
                B(Star), R(2),
                B(LdaZero),
89 90
                B(Star), R(1),
                B(CreateArrayLiteral), U8(1), U8(1), U8(37),
91
                B(Star), R(4),
92 93
                B(LdaZero),
                B(Star), R(3),
94
                B(Ldar), R(0),
95 96 97
  /*   56 E> */ B(StaInArrayLiteral), R(4), R(3), U8(2),
                B(Ldar), R(4),
                B(StaInArrayLiteral), R(2), R(1), U8(4),
98
                B(LdaSmi), I8(1),
99
                B(Star), R(1),
100
                B(CreateArrayLiteral), U8(2), U8(6), U8(37),
101
                B(Star), R(4),
102 103
                B(LdaZero),
                B(Star), R(3),
104
                B(Ldar), R(0),
105
  /*   68 E> */ B(AddSmi), I8(2), U8(7),
106 107 108 109
                B(StaInArrayLiteral), R(4), R(3), U8(8),
                B(Ldar), R(4),
                B(StaInArrayLiteral), R(2), R(1), U8(4),
                B(Ldar), R(2),
110
  /*   76 S> */ B(Return),
111 112
]
constant pool: [
113 114 115
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
116 117 118 119
]
handlers: [
]

120 121 122 123
---
snippet: "
  var a = [ 1, 2 ]; return [ ...a ];
"
124
frame size: 1
125
parameter count: 1
126
bytecode array length: 9
127 128 129 130
bytecodes: [
  /*   30 E> */ B(StackCheck),
  /*   42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
                B(Star), R(0),
131
  /*   52 S> */ B(CreateArrayFromIterable),
132 133 134 135 136 137 138 139 140 141 142 143
  /*   68 S> */ B(Return),
]
constant pool: [
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
]
handlers: [
]

---
snippet: "
  var a = [ 1, 2 ]; return [ 0, ...a ];
"
144
frame size: 6
145
parameter count: 1
146
bytecode array length: 68
147 148 149 150 151
bytecodes: [
  /*   30 E> */ B(StackCheck),
  /*   42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
                B(Star), R(0),
  /*   52 S> */ B(CreateArrayLiteral), U8(1), U8(1), U8(37),
152
                B(Star), R(2),
153
                B(LdaConstant), U8(2),
154
  /*   67 S> */ B(Star), R(1),
155
                B(GetIterator), R(0), U8(2), U8(4),
156
                B(Star), R(4),
157
                B(LdaNamedProperty), R(4), U8(3), U8(6),
158
                B(Star), R(3),
159
                B(CallProperty0), R(3), R(4), U8(15),
160
                B(Star), R(5),
161
                B(JumpIfJSReceiver), U8(7),
162 163
                B(CallRuntime), U16(Runtime::kThrowIteratorResultNotAnObject), R(5), U8(1),
                B(LdaNamedProperty), R(5), U8(4), U8(17),
164
                B(JumpIfToBooleanTrue), U8(19),
165
                B(LdaNamedProperty), R(5), U8(5), U8(8),
166
                B(StaInArrayLiteral), R(2), R(1), U8(13),
167
                B(Ldar), R(1),
168
                B(Inc), U8(12),
169
                B(Star), R(1),
170
                B(JumpLoop), U8(33), I8(0),
171
                B(Ldar), R(2),
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
  /*   71 S> */ B(Return),
]
constant pool: [
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
  Smi [1],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["next"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["done"],
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["value"],
]
handlers: [
]

---
snippet: "
  var a = [ 1, 2 ]; return [ ...a, 3 ];
"
189
frame size: 3
190
parameter count: 1
191
bytecode array length: 25
192 193 194 195
bytecodes: [
  /*   30 E> */ B(StackCheck),
  /*   42 S> */ B(CreateArrayLiteral), U8(0), U8(0), U8(37),
                B(Star), R(0),
196
  /*   52 S> */ B(CreateArrayFromIterable),
197
                B(Star), R(2),
198 199
                B(LdaNamedProperty), R(2), U8(1), U8(1),
                B(Star), R(1),
200
                B(LdaSmi), I8(3),
201
                B(StaInArrayLiteral), R(2), R(1), U8(3),
202 203 204 205 206
                B(Ldar), R(2),
  /*   71 S> */ B(Return),
]
constant pool: [
  ARRAY_BOILERPLATE_DESCRIPTION_TYPE,
207
  ONE_BYTE_INTERNALIZED_STRING_TYPE ["length"],
208 209 210 211
]
handlers: [
]