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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 for (size_t i = 0; i < k8BitCapacity - reserved; i++) { | 82 for (size_t i = 0; i < k8BitCapacity - reserved; i++) { |
83 Smi* smi = Smi::FromInt(static_cast<int>(i)); | 83 Smi* smi = Smi::FromInt(static_cast<int>(i)); |
84 CHECK(Handle<Smi>::cast(builder.At(i))->SameValue(smi)); | 84 CHECK(Handle<Smi>::cast(builder.At(i))->SameValue(smi)); |
85 } | 85 } |
86 for (size_t i = k8BitCapacity; i < 2 * k8BitCapacity + reserved; i++) { | 86 for (size_t i = k8BitCapacity; i < 2 * k8BitCapacity + reserved; i++) { |
87 Smi* smi = Smi::FromInt(static_cast<int>(i - reserved)); | 87 Smi* smi = Smi::FromInt(static_cast<int>(i - reserved)); |
88 CHECK(Handle<Smi>::cast(builder.At(i))->SameValue(smi)); | 88 CHECK(Handle<Smi>::cast(builder.At(i))->SameValue(smi)); |
89 } | 89 } |
90 for (size_t i = 0; i < reserved; i++) { | 90 for (size_t i = 0; i < reserved; i++) { |
91 size_t index = k8BitCapacity - reserved + i; | 91 size_t index = k8BitCapacity - reserved + i; |
92 CHECK(builder.At(index)->IsTheHole()); | 92 CHECK(builder.At(index)->IsTheHole(isolate())); |
93 } | 93 } |
94 | 94 |
95 // Now make reservations, and commit them with unique entries. | 95 // Now make reservations, and commit them with unique entries. |
96 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { | 96 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { |
97 OperandSize operand_size = builder.CreateReservedEntry(); | 97 OperandSize operand_size = builder.CreateReservedEntry(); |
98 CHECK(operand_size == OperandSize::kByte); | 98 CHECK(operand_size == OperandSize::kByte); |
99 } | 99 } |
100 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { | 100 for (size_t i = 0; i < duplicates_in_idx8_space; i++) { |
101 Handle<Object> object = | 101 Handle<Object> object = |
102 isolate()->factory()->NewNumberFromSize(2 * k8BitCapacity + i); | 102 isolate()->factory()->NewNumberFromSize(2 * k8BitCapacity + i); |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } else { | 279 } else { |
280 expected = isolate()->factory()->the_hole_value(); | 280 expected = isolate()->factory()->the_hole_value(); |
281 } | 281 } |
282 CHECK(constant_array->get(i)->SameValue(*expected)); | 282 CHECK(constant_array->get(i)->SameValue(*expected)); |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
286 } // namespace interpreter | 286 } // namespace interpreter |
287 } // namespace internal | 287 } // namespace internal |
288 } // namespace v8 | 288 } // namespace v8 |
OLD | NEW |