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

Unified Diff: src/heap.cc

Issue 183883011: Differentate between code target pointers and heap pointers in constant pools. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor fix to ConstantPoolArray visiting Created 6 years, 9 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 | « src/heap.h ('k') | src/mark-compact.h » ('j') | src/objects.cc » ('J')
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 42e56ca1eb9e2bb40498d9ea2d341c71a67f6b4e..4cb1adcbc0f1ca083ceb349e4966aadf4ef2af02 100644
--- a/src/heap.cc
+++ b/src/heap.cc
@@ -5129,20 +5129,23 @@ MaybeObject* Heap::CopyFixedDoubleArrayWithMap(FixedDoubleArray* src,
MaybeObject* Heap::CopyConstantPoolArrayWithMap(ConstantPoolArray* src,
Map* map) {
int int64_entries = src->count_of_int64_entries();
- int ptr_entries = src->count_of_ptr_entries();
+ int code_ptr_entries = src->count_of_code_ptr_entries();
+ int heap_ptr_entries = src->count_of_heap_ptr_entries();
int int32_entries = src->count_of_int32_entries();
Object* obj;
{ MaybeObject* maybe_obj =
- AllocateConstantPoolArray(int64_entries, ptr_entries, int32_entries);
+ AllocateConstantPoolArray(int64_entries, code_ptr_entries,
+ heap_ptr_entries, int32_entries);
if (!maybe_obj->ToObject(&obj)) return maybe_obj;
}
HeapObject* dst = HeapObject::cast(obj);
dst->set_map_no_write_barrier(map);
+ int size = ConstantPoolArray::SizeFor(
+ int64_entries, code_ptr_entries, heap_ptr_entries, int32_entries);
CopyBlock(
dst->address() + ConstantPoolArray::kLengthOffset,
src->address() + ConstantPoolArray::kLengthOffset,
- ConstantPoolArray::SizeFor(int64_entries, ptr_entries, int32_entries)
- - ConstantPoolArray::kLengthOffset);
+ size - ConstantPoolArray::kLengthOffset);
return obj;
}
@@ -5279,12 +5282,14 @@ MaybeObject* Heap::AllocateRawFixedDoubleArray(int length,
MaybeObject* Heap::AllocateConstantPoolArray(int number_of_int64_entries,
- int number_of_ptr_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_ptr_entries > 0 ||
- number_of_int32_entries > 0);
+ ASSERT(number_of_int64_entries > 0 || number_of_code_ptr_entries > 0 ||
+ number_of_heap_ptr_entries > 0 || number_of_int32_entries > 0);
int size = ConstantPoolArray::SizeFor(number_of_int64_entries,
- number_of_ptr_entries,
+ number_of_code_ptr_entries,
+ number_of_heap_ptr_entries,
number_of_int32_entries);
#ifndef V8_HOST_ARCH_64_BIT
size += kPointerSize;
@@ -5301,29 +5306,30 @@ MaybeObject* Heap::AllocateConstantPoolArray(int number_of_int64_entries,
ConstantPoolArray* constant_pool =
reinterpret_cast<ConstantPoolArray*>(object);
constant_pool->SetEntryCounts(number_of_int64_entries,
- number_of_ptr_entries,
+ number_of_code_ptr_entries,
+ number_of_heap_ptr_entries,
number_of_int32_entries);
- if (number_of_ptr_entries > 0) {
+ if (number_of_heap_ptr_entries > 0) {
Michael Starzinger 2014/03/07 15:07:47 Can we really skip initializing the code_ptr_entri
rmcilroy 2014/03/10 14:03:05 Yes I think you are right. At the moment I don't
MemsetPointer(
- HeapObject::RawField(
- constant_pool,
- constant_pool->OffsetOfElementAt(constant_pool->first_ptr_index())),
+ HeapObject::RawField(constant_pool,
+ constant_pool->OffsetOfElementAt(
+ constant_pool->first_heap_ptr_index())),
undefined_value(),
- number_of_ptr_entries);
+ number_of_heap_ptr_entries);
}
return constant_pool;
}
MaybeObject* Heap::AllocateEmptyConstantPoolArray() {
- int size = ConstantPoolArray::SizeFor(0, 0, 0);
+ int size = ConstantPoolArray::SizeFor(0, 0, 0, 0);
Object* result;
{ MaybeObject* maybe_result =
AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
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);
+ ConstantPoolArray::cast(result)->SetEntryCounts(0, 0, 0, 0);
return result;
}
« no previous file with comments | « src/heap.h ('k') | src/mark-compact.h » ('j') | src/objects.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698