OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/factory.h" | 7 #include "src/factory.h" |
8 #include "src/handles-inl.h" | 8 #include "src/handles-inl.h" |
9 #include "src/interpreter/constant-array-builder.h" | 9 #include "src/interpreter/constant-array-builder.h" |
10 #include "src/isolate.h" | 10 #include "src/isolate.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 ConstantArrayBuilder builder(isolate(), zone()); | 33 ConstantArrayBuilder builder(isolate(), zone()); |
34 for (size_t i = 0; i < k16BitCapacity; i++) { | 34 for (size_t i = 0; i < k16BitCapacity; i++) { |
35 builder.Insert(handle(Smi::FromInt(static_cast<int>(i)), isolate())); | 35 builder.Insert(handle(Smi::FromInt(static_cast<int>(i)), isolate())); |
36 } | 36 } |
37 CHECK_EQ(builder.size(), k16BitCapacity); | 37 CHECK_EQ(builder.size(), k16BitCapacity); |
38 for (size_t i = 0; i < k16BitCapacity; i++) { | 38 for (size_t i = 0; i < k16BitCapacity; i++) { |
39 CHECK_EQ(Handle<Smi>::cast(builder.At(i))->value(), i); | 39 CHECK_EQ(Handle<Smi>::cast(builder.At(i))->value(), i); |
40 } | 40 } |
41 } | 41 } |
42 | 42 |
| 43 TEST_F(ConstantArrayBuilderTest, ToFixedArray) { |
| 44 CanonicalHandleScope canonical(isolate()); |
| 45 ConstantArrayBuilder builder(isolate(), zone()); |
| 46 static const size_t kNumberOfElements = 37; |
| 47 for (size_t i = 0; i < kNumberOfElements; i++) { |
| 48 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); |
| 49 builder.Insert(object); |
| 50 CHECK(builder.At(i)->SameValue(*object)); |
| 51 } |
| 52 Handle<FixedArray> constant_array = builder.ToFixedArray(); |
| 53 CHECK_EQ(constant_array->length(), kNumberOfElements); |
| 54 for (size_t i = 0; i < kNumberOfElements; i++) { |
| 55 CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i))); |
| 56 } |
| 57 } |
| 58 |
| 59 TEST_F(ConstantArrayBuilderTest, ToLargeFixedArray) { |
| 60 CanonicalHandleScope canonical(isolate()); |
| 61 ConstantArrayBuilder builder(isolate(), zone()); |
| 62 static const size_t kNumberOfElements = 37373; |
| 63 for (size_t i = 0; i < kNumberOfElements; i++) { |
| 64 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); |
| 65 builder.Insert(object); |
| 66 CHECK(builder.At(i)->SameValue(*object)); |
| 67 } |
| 68 Handle<FixedArray> constant_array = builder.ToFixedArray(); |
| 69 CHECK_EQ(constant_array->length(), kNumberOfElements); |
| 70 for (size_t i = 0; i < kNumberOfElements; i++) { |
| 71 CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i))); |
| 72 } |
| 73 } |
| 74 |
| 75 TEST_F(ConstantArrayBuilderTest, ToLargeFixedArrayWithReservations) { |
| 76 CanonicalHandleScope canonical(isolate()); |
| 77 ConstantArrayBuilder builder(isolate(), zone()); |
| 78 static const size_t kNumberOfElements = 37373; |
| 79 for (size_t i = 0; i < kNumberOfElements; i++) { |
| 80 builder.CommitReservedEntry(builder.CreateReservedEntry(), |
| 81 Smi::FromInt(static_cast<int>(i))); |
| 82 } |
| 83 Handle<FixedArray> constant_array = builder.ToFixedArray(); |
| 84 CHECK_EQ(constant_array->length(), kNumberOfElements); |
| 85 for (size_t i = 0; i < kNumberOfElements; i++) { |
| 86 CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i))); |
| 87 } |
| 88 } |
| 89 |
43 TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithIdx8Reservations) { | 90 TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithIdx8Reservations) { |
44 CanonicalHandleScope canonical(isolate()); | 91 CanonicalHandleScope canonical(isolate()); |
45 for (size_t reserved = 1; reserved < k8BitCapacity; reserved *= 3) { | 92 for (size_t reserved = 1; reserved < k8BitCapacity; reserved *= 3) { |
46 ConstantArrayBuilder builder(isolate(), zone()); | 93 ConstantArrayBuilder builder(isolate(), zone()); |
47 for (size_t i = 0; i < reserved; i++) { | 94 for (size_t i = 0; i < reserved; i++) { |
48 OperandSize operand_size = builder.CreateReservedEntry(); | 95 OperandSize operand_size = builder.CreateReservedEntry(); |
49 CHECK(operand_size == OperandSize::kByte); | 96 CHECK(operand_size == OperandSize::kByte); |
50 } | 97 } |
51 for (size_t i = 0; i < 2 * k8BitCapacity; i++) { | 98 for (size_t i = 0; i < 2 * k8BitCapacity; i++) { |
52 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); | 99 builder.CommitReservedEntry(builder.CreateReservedEntry(), |
53 builder.Insert(object); | 100 Smi::FromInt(static_cast<int>(i))); |
54 if (i + reserved < k8BitCapacity) { | 101 if (i + reserved < k8BitCapacity) { |
55 CHECK_LE(builder.size(), k8BitCapacity); | 102 CHECK_LE(builder.size(), k8BitCapacity); |
56 CHECK_EQ(builder.size(), i + 1); | 103 CHECK_EQ(builder.size(), i + 1); |
57 CHECK(builder.At(i)->SameValue(*object)); | |
58 } else { | 104 } else { |
59 CHECK_GE(builder.size(), k8BitCapacity); | 105 CHECK_GE(builder.size(), k8BitCapacity); |
60 CHECK_EQ(builder.size(), i + reserved + 1); | 106 CHECK_EQ(builder.size(), i + reserved + 1); |
61 CHECK(builder.At(i + reserved)->SameValue(*object)); | |
62 } | 107 } |
63 } | 108 } |
64 CHECK_EQ(builder.size(), 2 * k8BitCapacity + reserved); | 109 CHECK_EQ(builder.size(), 2 * k8BitCapacity + reserved); |
65 | 110 |
66 // Check reserved values represented by the hole. | 111 // Check reserved values represented by the hole. |
67 for (size_t i = 0; i < reserved; i++) { | 112 for (size_t i = 0; i < reserved; i++) { |
68 Handle<Object> empty = builder.At(k8BitCapacity - reserved + i); | 113 Handle<Object> empty = builder.At(k8BitCapacity - reserved + i); |
69 CHECK(empty->SameValue(isolate()->heap()->the_hole_value())); | 114 CHECK(empty->SameValue(isolate()->heap()->the_hole_value())); |
70 } | 115 } |
71 | 116 |
72 // Commmit reserved entries with duplicates and check size does not change. | 117 // Commit reserved entries with duplicates and check size does not change. |
73 DCHECK_EQ(reserved + 2 * k8BitCapacity, builder.size()); | 118 DCHECK_EQ(reserved + 2 * k8BitCapacity, builder.size()); |
74 size_t duplicates_in_idx8_space = | 119 size_t duplicates_in_idx8_space = |
75 std::min(reserved, k8BitCapacity - reserved); | 120 std::min(reserved, k8BitCapacity - reserved); |
76 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { | 121 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { |
77 builder.CommitReservedEntry(OperandSize::kByte, | 122 builder.CommitReservedEntry(OperandSize::kByte, |
78 isolate()->factory()->NewNumberFromSize(i)); | 123 Smi::FromInt(static_cast<int>(i))); |
79 DCHECK_EQ(reserved + 2 * k8BitCapacity, builder.size()); | 124 DCHECK_EQ(reserved + 2 * k8BitCapacity, builder.size()); |
80 } | 125 } |
81 | 126 |
82 // Check all committed values match expected (holes where | |
83 // duplicates_in_idx8_space allocated). | |
84 for (size_t i = 0; i < k8BitCapacity - reserved; i++) { | |
85 Smi* smi = Smi::FromInt(static_cast<int>(i)); | |
86 CHECK(Handle<Smi>::cast(builder.At(i))->SameValue(smi)); | |
87 } | |
88 for (size_t i = k8BitCapacity; i < 2 * k8BitCapacity + reserved; i++) { | |
89 Smi* smi = Smi::FromInt(static_cast<int>(i - reserved)); | |
90 CHECK(Handle<Smi>::cast(builder.At(i))->SameValue(smi)); | |
91 } | |
92 for (size_t i = 0; i < reserved; i++) { | |
93 size_t index = k8BitCapacity - reserved + i; | |
94 CHECK(builder.At(index)->IsTheHole(isolate())); | |
95 } | |
96 | |
97 // Now make reservations, and commit them with unique entries. | 127 // Now make reservations, and commit them with unique entries. |
98 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { | 128 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { |
99 OperandSize operand_size = builder.CreateReservedEntry(); | 129 OperandSize operand_size = builder.CreateReservedEntry(); |
100 CHECK(operand_size == OperandSize::kByte); | 130 CHECK(operand_size == OperandSize::kByte); |
101 } | 131 } |
102 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { | 132 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { |
103 Handle<Object> object = | 133 Smi* value = Smi::FromInt(static_cast<int>(2 * k8BitCapacity + i)); |
104 isolate()->factory()->NewNumberFromSize(2 * k8BitCapacity + i); | 134 size_t index = builder.CommitReservedEntry(OperandSize::kByte, value); |
105 size_t index = builder.CommitReservedEntry(OperandSize::kByte, object); | |
106 CHECK_EQ(static_cast<int>(index), k8BitCapacity - reserved + i); | 135 CHECK_EQ(static_cast<int>(index), k8BitCapacity - reserved + i); |
107 CHECK(builder.At(static_cast<int>(index))->SameValue(*object)); | |
108 } | 136 } |
109 CHECK_EQ(builder.size(), 2 * k8BitCapacity + reserved); | 137 |
| 138 Handle<FixedArray> constant_array = builder.ToFixedArray(); |
| 139 CHECK_EQ(constant_array->length(), 2 * k8BitCapacity + reserved); |
| 140 |
| 141 // Check all committed values match expected |
| 142 for (size_t i = 0; i < k8BitCapacity - reserved; i++) { |
| 143 Object* value = constant_array->get(static_cast<int>(i)); |
| 144 Smi* smi = Smi::FromInt(static_cast<int>(i)); |
| 145 CHECK(value->SameValue(smi)); |
| 146 } |
| 147 for (size_t i = k8BitCapacity; i < 2 * k8BitCapacity + reserved; i++) { |
| 148 Object* value = constant_array->get(static_cast<int>(i)); |
| 149 Smi* smi = Smi::FromInt(static_cast<int>(i - reserved)); |
| 150 CHECK(value->SameValue(smi)); |
| 151 } |
110 } | 152 } |
111 } | 153 } |
112 | 154 |
113 TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithWideReservations) { | 155 TEST_F(ConstantArrayBuilderTest, AllocateEntriesWithWideReservations) { |
114 CanonicalHandleScope canonical(isolate()); | 156 CanonicalHandleScope canonical(isolate()); |
115 for (size_t reserved = 1; reserved < k8BitCapacity; reserved *= 3) { | 157 for (size_t reserved = 1; reserved < k8BitCapacity; reserved *= 3) { |
116 ConstantArrayBuilder builder(isolate(), zone()); | 158 ConstantArrayBuilder builder(isolate(), zone()); |
117 for (size_t i = 0; i < k8BitCapacity; i++) { | 159 for (size_t i = 0; i < k8BitCapacity; i++) { |
118 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); | 160 builder.CommitReservedEntry(builder.CreateReservedEntry(), |
119 builder.Insert(object); | 161 Smi::FromInt(static_cast<int>(i))); |
120 CHECK(builder.At(i)->SameValue(*object)); | |
121 CHECK_EQ(builder.size(), i + 1); | 162 CHECK_EQ(builder.size(), i + 1); |
122 } | 163 } |
123 for (size_t i = 0; i < reserved; i++) { | 164 for (size_t i = 0; i < reserved; i++) { |
124 OperandSize operand_size = builder.CreateReservedEntry(); | 165 OperandSize operand_size = builder.CreateReservedEntry(); |
125 CHECK(operand_size == OperandSize::kShort); | 166 CHECK(operand_size == OperandSize::kShort); |
126 CHECK_EQ(builder.size(), k8BitCapacity); | 167 CHECK_EQ(builder.size(), k8BitCapacity); |
127 } | 168 } |
128 for (size_t i = 0; i < reserved; i++) { | 169 for (size_t i = 0; i < reserved; i++) { |
129 builder.DiscardReservedEntry(OperandSize::kShort); | 170 builder.DiscardReservedEntry(OperandSize::kShort); |
130 CHECK_EQ(builder.size(), k8BitCapacity); | 171 CHECK_EQ(builder.size(), k8BitCapacity); |
131 } | 172 } |
132 for (size_t i = 0; i < reserved; i++) { | 173 for (size_t i = 0; i < reserved; i++) { |
133 OperandSize operand_size = builder.CreateReservedEntry(); | 174 OperandSize operand_size = builder.CreateReservedEntry(); |
134 CHECK(operand_size == OperandSize::kShort); | 175 CHECK(operand_size == OperandSize::kShort); |
135 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); | 176 builder.CommitReservedEntry(operand_size, |
136 builder.CommitReservedEntry(operand_size, object); | 177 Smi::FromInt(static_cast<int>(i))); |
137 CHECK_EQ(builder.size(), k8BitCapacity); | 178 CHECK_EQ(builder.size(), k8BitCapacity); |
138 } | 179 } |
139 for (size_t i = k8BitCapacity; i < k8BitCapacity + reserved; i++) { | 180 for (size_t i = k8BitCapacity; i < k8BitCapacity + reserved; i++) { |
140 OperandSize operand_size = builder.CreateReservedEntry(); | 181 OperandSize operand_size = builder.CreateReservedEntry(); |
141 CHECK(operand_size == OperandSize::kShort); | 182 CHECK(operand_size == OperandSize::kShort); |
142 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); | 183 builder.CommitReservedEntry(operand_size, |
143 builder.CommitReservedEntry(operand_size, object); | 184 Smi::FromInt(static_cast<int>(i))); |
144 CHECK_EQ(builder.size(), i + 1); | 185 CHECK_EQ(builder.size(), i + 1); |
145 } | 186 } |
| 187 |
| 188 Handle<FixedArray> constant_array = builder.ToFixedArray(); |
| 189 CHECK_EQ(constant_array->length(), k8BitCapacity + reserved); |
| 190 for (size_t i = 0; i < k8BitCapacity + reserved; i++) { |
| 191 Object* value = constant_array->get(static_cast<int>(i)); |
| 192 CHECK(value->SameValue(*isolate()->factory()->NewNumberFromSize(i))); |
| 193 } |
146 } | 194 } |
147 } | 195 } |
148 | 196 |
149 | |
150 TEST_F(ConstantArrayBuilderTest, ToFixedArray) { | |
151 CanonicalHandleScope canonical(isolate()); | |
152 ConstantArrayBuilder builder(isolate(), zone()); | |
153 static const size_t kNumberOfElements = 37; | |
154 for (size_t i = 0; i < kNumberOfElements; i++) { | |
155 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); | |
156 builder.Insert(object); | |
157 CHECK(builder.At(i)->SameValue(*object)); | |
158 } | |
159 Handle<FixedArray> constant_array = builder.ToFixedArray(); | |
160 CHECK_EQ(constant_array->length(), kNumberOfElements); | |
161 for (size_t i = 0; i < kNumberOfElements; i++) { | |
162 CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i))); | |
163 } | |
164 } | |
165 | |
166 TEST_F(ConstantArrayBuilderTest, ToLargeFixedArray) { | |
167 CanonicalHandleScope canonical(isolate()); | |
168 ConstantArrayBuilder builder(isolate(), zone()); | |
169 static const size_t kNumberOfElements = 37373; | |
170 for (size_t i = 0; i < kNumberOfElements; i++) { | |
171 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); | |
172 builder.Insert(object); | |
173 CHECK(builder.At(i)->SameValue(*object)); | |
174 } | |
175 Handle<FixedArray> constant_array = builder.ToFixedArray(); | |
176 CHECK_EQ(constant_array->length(), kNumberOfElements); | |
177 for (size_t i = 0; i < kNumberOfElements; i++) { | |
178 CHECK(constant_array->get(static_cast<int>(i))->SameValue(*builder.At(i))); | |
179 } | |
180 } | |
181 | |
182 TEST_F(ConstantArrayBuilderTest, GapFilledWhenLowReservationCommitted) { | 197 TEST_F(ConstantArrayBuilderTest, GapFilledWhenLowReservationCommitted) { |
183 CanonicalHandleScope canonical(isolate()); | 198 CanonicalHandleScope canonical(isolate()); |
184 ConstantArrayBuilder builder(isolate(), zone()); | 199 ConstantArrayBuilder builder(isolate(), zone()); |
185 for (size_t i = 0; i < k8BitCapacity; i++) { | 200 for (size_t i = 0; i < k8BitCapacity; i++) { |
186 OperandSize operand_size = builder.CreateReservedEntry(); | 201 OperandSize operand_size = builder.CreateReservedEntry(); |
187 CHECK(OperandSize::kByte == operand_size); | 202 CHECK(OperandSize::kByte == operand_size); |
188 CHECK_EQ(builder.size(), 0); | 203 CHECK_EQ(builder.size(), 0); |
189 } | 204 } |
190 for (size_t i = 0; i < k8BitCapacity; i++) { | 205 for (size_t i = 0; i < k8BitCapacity; i++) { |
191 Handle<Object> object = isolate()->factory()->NewNumberFromSize(i); | 206 builder.CommitReservedEntry(builder.CreateReservedEntry(), |
192 builder.Insert(object); | 207 Smi::FromInt(static_cast<int>(i))); |
193 CHECK_EQ(builder.size(), i + k8BitCapacity + 1); | 208 CHECK_EQ(builder.size(), i + k8BitCapacity + 1); |
194 } | 209 } |
195 for (size_t i = 0; i < k8BitCapacity; i++) { | 210 for (size_t i = 0; i < k8BitCapacity; i++) { |
196 builder.CommitReservedEntry(OperandSize::kByte, | 211 builder.CommitReservedEntry(OperandSize::kByte, |
197 builder.At(i + k8BitCapacity)); | 212 Smi::FromInt(static_cast<int>(i))); |
198 CHECK_EQ(builder.size(), 2 * k8BitCapacity); | 213 CHECK_EQ(builder.size(), 2 * k8BitCapacity); |
199 } | 214 } |
| 215 Handle<FixedArray> constant_array = builder.ToFixedArray(); |
| 216 CHECK_EQ(constant_array->length(), 2 * k8BitCapacity); |
200 for (size_t i = 0; i < k8BitCapacity; i++) { | 217 for (size_t i = 0; i < k8BitCapacity; i++) { |
201 Handle<Object> original = builder.At(k8BitCapacity + i); | 218 Object* original = constant_array->get(static_cast<int>(k8BitCapacity + i)); |
202 Handle<Object> duplicate = builder.At(i); | 219 Object* duplicate = constant_array->get(static_cast<int>(i)); |
203 CHECK(original->SameValue(*duplicate)); | 220 CHECK(original->SameValue(duplicate)); |
204 Handle<Object> reference = isolate()->factory()->NewNumberFromSize(i); | 221 Handle<Object> reference = isolate()->factory()->NewNumberFromSize(i); |
205 CHECK(original->SameValue(*reference)); | 222 CHECK(original->SameValue(*reference)); |
206 } | 223 } |
207 } | 224 } |
208 | 225 |
209 TEST_F(ConstantArrayBuilderTest, GapNotFilledWhenLowReservationDiscarded) { | 226 TEST_F(ConstantArrayBuilderTest, GapNotFilledWhenLowReservationDiscarded) { |
210 CanonicalHandleScope canonical(isolate()); | 227 CanonicalHandleScope canonical(isolate()); |
211 ConstantArrayBuilder builder(isolate(), zone()); | 228 ConstantArrayBuilder builder(isolate(), zone()); |
212 for (size_t i = 0; i < k8BitCapacity; i++) { | 229 for (size_t i = 0; i < k8BitCapacity; i++) { |
213 OperandSize operand_size = builder.CreateReservedEntry(); | 230 OperandSize operand_size = builder.CreateReservedEntry(); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 ConstantArrayBuilder builder(isolate(), zone()); | 279 ConstantArrayBuilder builder(isolate(), zone()); |
263 for (int i = 0; i < 256; i++) { | 280 for (int i = 0; i < 256; i++) { |
264 CHECK_EQ(builder.CreateReservedEntry(), OperandSize::kByte); | 281 CHECK_EQ(builder.CreateReservedEntry(), OperandSize::kByte); |
265 } | 282 } |
266 for (int i = 256; i < 65536; ++i) { | 283 for (int i = 256; i < 65536; ++i) { |
267 CHECK_EQ(builder.CreateReservedEntry(), OperandSize::kShort); | 284 CHECK_EQ(builder.CreateReservedEntry(), OperandSize::kShort); |
268 } | 285 } |
269 for (int i = 65536; i < 131072; ++i) { | 286 for (int i = 65536; i < 131072; ++i) { |
270 CHECK_EQ(builder.CreateReservedEntry(), OperandSize::kQuad); | 287 CHECK_EQ(builder.CreateReservedEntry(), OperandSize::kQuad); |
271 } | 288 } |
272 CHECK_EQ(builder.CommitReservedEntry(OperandSize::kByte, | 289 CHECK_EQ(builder.CommitReservedEntry(OperandSize::kByte, Smi::FromInt(1)), 0); |
273 isolate()->factory()->NewNumber(1)), | 290 CHECK_EQ(builder.CommitReservedEntry(OperandSize::kShort, Smi::FromInt(2)), |
274 0); | |
275 CHECK_EQ(builder.CommitReservedEntry(OperandSize::kShort, | |
276 isolate()->factory()->NewNumber(2)), | |
277 256); | 291 256); |
278 CHECK_EQ(builder.CommitReservedEntry(OperandSize::kQuad, | 292 CHECK_EQ(builder.CommitReservedEntry(OperandSize::kQuad, Smi::FromInt(3)), |
279 isolate()->factory()->NewNumber(3)), | |
280 65536); | 293 65536); |
281 Handle<FixedArray> constant_array = builder.ToFixedArray(); | 294 Handle<FixedArray> constant_array = builder.ToFixedArray(); |
282 CHECK_EQ(constant_array->length(), 65537); | 295 CHECK_EQ(constant_array->length(), 65537); |
283 int count = 1; | 296 int count = 1; |
284 for (int i = 0; i < constant_array->length(); ++i) { | 297 for (int i = 0; i < constant_array->length(); ++i) { |
285 Handle<Object> expected; | 298 Handle<Object> expected; |
286 if (i == 0 || i == 256 || i == 65536) { | 299 if (i == 0 || i == 256 || i == 65536) { |
287 expected = isolate()->factory()->NewNumber(count++); | 300 expected = isolate()->factory()->NewNumber(count++); |
288 } else { | 301 } else { |
289 expected = isolate()->factory()->the_hole_value(); | 302 expected = isolate()->factory()->the_hole_value(); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 | 336 |
324 // Check values after reserved entries are inserted. | 337 // Check values after reserved entries are inserted. |
325 for (size_t i = 0; i < k16BitCapacity; i++) { | 338 for (size_t i = 0; i < k16BitCapacity; i++) { |
326 CHECK_EQ(Handle<Smi>::cast(builder.At(i))->value(), i); | 339 CHECK_EQ(Handle<Smi>::cast(builder.At(i))->value(), i); |
327 } | 340 } |
328 } | 341 } |
329 | 342 |
330 } // namespace interpreter | 343 } // namespace interpreter |
331 } // namespace internal | 344 } // namespace internal |
332 } // namespace v8 | 345 } // namespace v8 |
OLD | NEW |