Index: src/heap.cc |
diff --git a/src/heap.cc b/src/heap.cc |
index 2ae0230f73776e487e32b3d510fed41a8f863da9..1a77c188fe87bf90a8ba7201a7507ab6ab176f16 100644 |
--- a/src/heap.cc |
+++ b/src/heap.cc |
@@ -5281,8 +5281,14 @@ MaybeObject* Heap::AllocateConstantPoolArray(int number_of_int64_entries, |
int number_of_code_ptr_entries, |
int number_of_heap_ptr_entries, |
int number_of_int32_entries) { |
- ASSERT(number_of_int64_entries > 0 || number_of_code_ptr_entries > 0 || |
- number_of_heap_ptr_entries > 0 || number_of_int32_entries > 0); |
+ CHECK(number_of_int64_entries >= 0 && |
+ number_of_int64_entries <= ConstantPoolArray::kMaxEntriesPerType && |
+ number_of_code_ptr_entries >= 0 && |
+ number_of_code_ptr_entries <= ConstantPoolArray::kMaxEntriesPerType && |
+ number_of_heap_ptr_entries >= 0 && |
+ number_of_heap_ptr_entries <= ConstantPoolArray::kMaxEntriesPerType && |
+ number_of_int32_entries >= 0 && |
+ number_of_int32_entries <= ConstantPoolArray::kMaxEntriesPerType); |
int size = ConstantPoolArray::SizeFor(number_of_int64_entries, |
number_of_code_ptr_entries, |
number_of_heap_ptr_entries, |
@@ -5301,10 +5307,10 @@ MaybeObject* Heap::AllocateConstantPoolArray(int number_of_int64_entries, |
ConstantPoolArray* constant_pool = |
reinterpret_cast<ConstantPoolArray*>(object); |
- constant_pool->SetEntryCounts(number_of_int64_entries, |
- number_of_code_ptr_entries, |
- number_of_heap_ptr_entries, |
- number_of_int32_entries); |
+ constant_pool->Init(number_of_int64_entries, |
+ number_of_code_ptr_entries, |
+ number_of_heap_ptr_entries, |
+ number_of_int32_entries); |
if (number_of_code_ptr_entries > 0) { |
int offset = |
constant_pool->OffsetOfElementAt(constant_pool->first_code_ptr_index()); |
@@ -5333,7 +5339,7 @@ MaybeObject* Heap::AllocateEmptyConstantPoolArray() { |
if (!maybe_result->ToObject(&result)) return maybe_result; |
} |
HeapObject::cast(result)->set_map_no_write_barrier(constant_pool_array_map()); |
- ConstantPoolArray::cast(result)->SetEntryCounts(0, 0, 0, 0); |
+ ConstantPoolArray::cast(result)->Init(0, 0, 0, 0); |
return result; |
} |