Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1054)

Unified Diff: src/heap.cc

Issue 209473006: Ensure that we don't mark weak heap references in the constant pool array. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: replace with CHECK Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/lithium-codegen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | src/lithium-codegen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698