| Index: src/heap/heap.cc
|
| diff --git a/src/heap/heap.cc b/src/heap/heap.cc
|
| index fd17774de2294df78cf5ea1e73a952b9fa3d6813..1b0ab092f04da91374cb07f7d8b46da18aa75e49 100644
|
| --- a/src/heap/heap.cc
|
| +++ b/src/heap/heap.cc
|
| @@ -84,7 +84,8 @@ Heap::Heap()
|
| global_ic_age_(0),
|
| scan_on_scavenge_pages_(0),
|
| new_space_(this),
|
| - old_space_(NULL),
|
| + old_pointer_space_(NULL),
|
| + old_data_space_(NULL),
|
| code_space_(NULL),
|
| map_space_(NULL),
|
| cell_space_(NULL),
|
| @@ -171,16 +172,17 @@ Heap::Heap()
|
| intptr_t Heap::Capacity() {
|
| if (!HasBeenSetUp()) return 0;
|
|
|
| - return new_space_.Capacity() + old_space_->Capacity() +
|
| - code_space_->Capacity() + map_space_->Capacity() +
|
| - cell_space_->Capacity();
|
| + return new_space_.Capacity() + old_pointer_space_->Capacity() +
|
| + old_data_space_->Capacity() + code_space_->Capacity() +
|
| + map_space_->Capacity() + cell_space_->Capacity();
|
| }
|
|
|
|
|
| intptr_t Heap::CommittedOldGenerationMemory() {
|
| if (!HasBeenSetUp()) return 0;
|
|
|
| - return old_space_->CommittedMemory() + code_space_->CommittedMemory() +
|
| + return old_pointer_space_->CommittedMemory() +
|
| + old_data_space_->CommittedMemory() + code_space_->CommittedMemory() +
|
| map_space_->CommittedMemory() + cell_space_->CommittedMemory() +
|
| lo_space_->Size();
|
| }
|
| @@ -197,7 +199,8 @@ size_t Heap::CommittedPhysicalMemory() {
|
| if (!HasBeenSetUp()) return 0;
|
|
|
| return new_space_.CommittedPhysicalMemory() +
|
| - old_space_->CommittedPhysicalMemory() +
|
| + old_pointer_space_->CommittedPhysicalMemory() +
|
| + old_data_space_->CommittedPhysicalMemory() +
|
| code_space_->CommittedPhysicalMemory() +
|
| map_space_->CommittedPhysicalMemory() +
|
| cell_space_->CommittedPhysicalMemory() +
|
| @@ -225,15 +228,16 @@ void Heap::UpdateMaximumCommitted() {
|
| intptr_t Heap::Available() {
|
| if (!HasBeenSetUp()) return 0;
|
|
|
| - return new_space_.Available() + old_space_->Available() +
|
| - code_space_->Available() + map_space_->Available() +
|
| - cell_space_->Available();
|
| + return new_space_.Available() + old_pointer_space_->Available() +
|
| + old_data_space_->Available() + code_space_->Available() +
|
| + map_space_->Available() + cell_space_->Available();
|
| }
|
|
|
|
|
| bool Heap::HasBeenSetUp() {
|
| - return old_space_ != NULL && code_space_ != NULL && map_space_ != NULL &&
|
| - cell_space_ != NULL && lo_space_ != NULL;
|
| + return old_pointer_space_ != NULL && old_data_space_ != NULL &&
|
| + code_space_ != NULL && map_space_ != NULL && cell_space_ != NULL &&
|
| + lo_space_ != NULL;
|
| }
|
|
|
|
|
| @@ -336,13 +340,22 @@ void Heap::PrintShortHeapStatistics() {
|
| ", committed: %6" V8_PTR_PREFIX "d KB\n",
|
| new_space_.Size() / KB, new_space_.Available() / KB,
|
| new_space_.CommittedMemory() / KB);
|
| - PrintPID("Old space, used: %6" V8_PTR_PREFIX
|
| + PrintPID("Old pointers, used: %6" V8_PTR_PREFIX
|
| "d KB"
|
| ", available: %6" V8_PTR_PREFIX
|
| "d KB"
|
| ", committed: %6" V8_PTR_PREFIX "d KB\n",
|
| - old_space_->SizeOfObjects() / KB, old_space_->Available() / KB,
|
| - old_space_->CommittedMemory() / KB);
|
| + old_pointer_space_->SizeOfObjects() / KB,
|
| + old_pointer_space_->Available() / KB,
|
| + old_pointer_space_->CommittedMemory() / KB);
|
| + PrintPID("Old data space, used: %6" V8_PTR_PREFIX
|
| + "d KB"
|
| + ", available: %6" V8_PTR_PREFIX
|
| + "d KB"
|
| + ", committed: %6" V8_PTR_PREFIX "d KB\n",
|
| + old_data_space_->SizeOfObjects() / KB,
|
| + old_data_space_->Available() / KB,
|
| + old_data_space_->CommittedMemory() / KB);
|
| PrintPID("Code space, used: %6" V8_PTR_PREFIX
|
| "d KB"
|
| ", available: %6" V8_PTR_PREFIX
|
| @@ -638,8 +651,12 @@ void Heap::GarbageCollectionEpilogue() {
|
|
|
| isolate_->counters()->heap_fraction_new_space()->AddSample(static_cast<int>(
|
| (new_space()->CommittedMemory() * 100.0) / CommittedMemory()));
|
| - isolate_->counters()->heap_fraction_old_space()->AddSample(static_cast<int>(
|
| - (old_space()->CommittedMemory() * 100.0) / CommittedMemory()));
|
| + isolate_->counters()->heap_fraction_old_pointer_space()->AddSample(
|
| + static_cast<int>((old_pointer_space()->CommittedMemory() * 100.0) /
|
| + CommittedMemory()));
|
| + isolate_->counters()->heap_fraction_old_data_space()->AddSample(
|
| + static_cast<int>((old_data_space()->CommittedMemory() * 100.0) /
|
| + CommittedMemory()));
|
| isolate_->counters()->heap_fraction_code_space()->AddSample(
|
| static_cast<int>((code_space()->CommittedMemory() * 100.0) /
|
| CommittedMemory()));
|
| @@ -685,7 +702,8 @@ void Heap::GarbageCollectionEpilogue() {
|
| UPDATE_FRAGMENTATION_FOR_SPACE(space)
|
|
|
| UPDATE_COUNTERS_FOR_SPACE(new_space)
|
| - UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(old_space)
|
| + UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(old_pointer_space)
|
| + UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(old_data_space)
|
| UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(code_space)
|
| UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(map_space)
|
| UPDATE_COUNTERS_AND_FRAGMENTATION_FOR_SPACE(cell_space)
|
| @@ -762,7 +780,7 @@ void Heap::CollectAllGarbage(int flags, const char* gc_reason,
|
| // not matter, so long as we do not specify NEW_SPACE, which would not
|
| // cause a full GC.
|
| mark_compact_collector_.SetFlags(flags);
|
| - CollectGarbage(OLD_SPACE, gc_reason, gc_callback_flags);
|
| + CollectGarbage(OLD_POINTER_SPACE, gc_reason, gc_callback_flags);
|
| mark_compact_collector_.SetFlags(kNoGCFlags);
|
| }
|
|
|
| @@ -1345,6 +1363,11 @@ static void VerifyNonPointerSpacePointers(Heap* heap) {
|
| for (HeapObject* object = code_it.Next(); object != NULL;
|
| object = code_it.Next())
|
| object->Iterate(&v);
|
| +
|
| + HeapObjectIterator data_it(heap->old_data_space());
|
| + for (HeapObject* object = data_it.Next(); object != NULL;
|
| + object = data_it.Next())
|
| + object->Iterate(&v);
|
| }
|
| #endif // VERIFY_HEAP
|
|
|
| @@ -2126,7 +2149,13 @@ class ScavengingVisitor : public StaticVisitorBase {
|
| }
|
|
|
| AllocationResult allocation;
|
| - allocation = heap->old_space()->AllocateRaw(allocation_size);
|
| + if (object_contents == DATA_OBJECT) {
|
| + DCHECK(heap->AllowedToBeMigrated(object, OLD_DATA_SPACE));
|
| + allocation = heap->old_data_space()->AllocateRaw(allocation_size);
|
| + } else {
|
| + DCHECK(heap->AllowedToBeMigrated(object, OLD_POINTER_SPACE));
|
| + allocation = heap->old_pointer_space()->AllocateRaw(allocation_size);
|
| + }
|
|
|
| HeapObject* target = NULL; // Initialization to please compiler.
|
| if (allocation.To(&target)) {
|
| @@ -2542,14 +2571,14 @@ bool Heap::CreateInitialMaps() {
|
| set_empty_fixed_array(FixedArray::cast(obj));
|
|
|
| {
|
| - AllocationResult allocation = Allocate(null_map(), OLD_SPACE);
|
| + AllocationResult allocation = Allocate(null_map(), OLD_POINTER_SPACE);
|
| if (!allocation.To(&obj)) return false;
|
| }
|
| set_null_value(Oddball::cast(obj));
|
| Oddball::cast(obj)->set_kind(Oddball::kNull);
|
|
|
| {
|
| - AllocationResult allocation = Allocate(undefined_map(), OLD_SPACE);
|
| + AllocationResult allocation = Allocate(undefined_map(), OLD_POINTER_SPACE);
|
| if (!allocation.To(&obj)) return false;
|
| }
|
| set_undefined_value(Oddball::cast(obj));
|
| @@ -2786,11 +2815,11 @@ AllocationResult Heap::AllocateHeapNumber(double value, MutableMode mode,
|
| int size = HeapNumber::kSize;
|
| STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxRegularHeapObjectSize);
|
|
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
|
|
|
| HeapObject* result;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
|
|
| @@ -2821,7 +2850,8 @@ AllocationResult Heap::AllocatePropertyCell() {
|
| STATIC_ASSERT(PropertyCell::kSize <= Page::kMaxRegularHeapObjectSize);
|
|
|
| HeapObject* result;
|
| - AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE);
|
| + AllocationResult allocation =
|
| + AllocateRaw(size, OLD_POINTER_SPACE, OLD_POINTER_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
|
|
| result->set_map_no_write_barrier(global_property_cell_map());
|
| @@ -2838,7 +2868,8 @@ AllocationResult Heap::AllocateWeakCell(HeapObject* value) {
|
| STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize);
|
| HeapObject* result = NULL;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE);
|
| + AllocationResult allocation =
|
| + AllocateRaw(size, OLD_POINTER_SPACE, OLD_POINTER_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
| result->set_map_no_write_barrier(weak_cell_map());
|
| @@ -3392,7 +3423,7 @@ AllocationResult Heap::AllocateForeign(Address address,
|
| PretenureFlag pretenure) {
|
| // Statically ensure that it is safe to allocate foreigns in paged spaces.
|
| STATIC_ASSERT(Foreign::kSize <= Page::kMaxRegularHeapObjectSize);
|
| - AllocationSpace space = (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE;
|
| + AllocationSpace space = (pretenure == TENURED) ? OLD_DATA_SPACE : NEW_SPACE;
|
| Foreign* result;
|
| AllocationResult allocation = Allocate(foreign_map(), space);
|
| if (!allocation.To(&result)) return allocation;
|
| @@ -3406,10 +3437,10 @@ AllocationResult Heap::AllocateByteArray(int length, PretenureFlag pretenure) {
|
| v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true);
|
| }
|
| int size = ByteArray::SizeFor(length);
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
|
| HeapObject* result;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
|
|
| @@ -3440,17 +3471,20 @@ void Heap::CreateFillerObjectAt(Address addr, int size) {
|
|
|
| bool Heap::CanMoveObjectStart(HeapObject* object) {
|
| Address address = object->address();
|
| + bool is_in_old_pointer_space = InOldPointerSpace(address);
|
| + bool is_in_old_data_space = InOldDataSpace(address);
|
|
|
| if (lo_space()->Contains(object)) return false;
|
|
|
| Page* page = Page::FromAddress(address);
|
| // We can move the object start if:
|
| - // (1) the object is not in old space,
|
| + // (1) the object is not in old pointer or old data space,
|
| // (2) the page of the object was already swept,
|
| // (3) the page was already concurrently swept. This case is an optimization
|
| // for concurrent sweeping. The WasSwept predicate for concurrently swept
|
| // pages is set after sweeping all pages.
|
| - return !InOldSpace(address) || page->WasSwept() || page->SweepingCompleted();
|
| + return (!is_in_old_pointer_space && !is_in_old_data_space) ||
|
| + page->WasSwept() || page->SweepingCompleted();
|
| }
|
|
|
|
|
| @@ -3567,10 +3601,10 @@ AllocationResult Heap::AllocateExternalArray(int length,
|
| void* external_pointer,
|
| PretenureFlag pretenure) {
|
| int size = ExternalArray::kAlignedSize;
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
|
| HeapObject* result;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
|
|
| @@ -3613,10 +3647,10 @@ AllocationResult Heap::AllocateFixedTypedArray(int length,
|
| size += kPointerSize;
|
| }
|
| #endif
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
|
|
|
| HeapObject* object;
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&object)) return allocation;
|
|
|
| if (array_type == kExternalFloat64Array) {
|
| @@ -3780,7 +3814,8 @@ AllocationResult Heap::Allocate(Map* map, AllocationSpace space,
|
| DCHECK(map->instance_type() != MAP_TYPE);
|
| // If allocation failures are disallowed, we may allocate in a different
|
| // space when new space is full and the object is not a large object.
|
| - AllocationSpace retry_space = (space != NEW_SPACE) ? space : OLD_SPACE;
|
| + AllocationSpace retry_space =
|
| + (space != NEW_SPACE) ? space : TargetSpaceId(map->instance_type());
|
| int size = map->instance_size();
|
| if (allocation_site != NULL) {
|
| size += AllocationMemento::kSize;
|
| @@ -3857,7 +3892,7 @@ AllocationResult Heap::AllocateJSObjectFromMap(
|
|
|
| // Allocate the JSObject.
|
| int size = map->instance_size();
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, pretenure);
|
| JSObject* js_obj;
|
| AllocationResult allocation = Allocate(map, space, allocation_site);
|
| if (!allocation.To(&js_obj)) return allocation;
|
| @@ -3908,7 +3943,7 @@ AllocationResult Heap::CopyJSObject(JSObject* source, AllocationSite* site) {
|
| if (always_allocate()) {
|
| {
|
| AllocationResult allocation =
|
| - AllocateRaw(object_size, NEW_SPACE, OLD_SPACE);
|
| + AllocateRaw(object_size, NEW_SPACE, OLD_POINTER_SPACE);
|
| if (!allocation.To(&clone)) return allocation;
|
| }
|
| Address clone_address = clone->address();
|
| @@ -4059,12 +4094,12 @@ AllocationResult Heap::AllocateInternalizedStringImpl(T t, int chars,
|
| map = internalized_string_map();
|
| size = SeqTwoByteString::SizeFor(chars);
|
| }
|
| - AllocationSpace space = SelectSpace(size, TENURED);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, TENURED);
|
|
|
| // Allocate string.
|
| HeapObject* result;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
|
|
| @@ -4102,11 +4137,11 @@ AllocationResult Heap::AllocateRawOneByteString(int length,
|
| DCHECK_GE(String::kMaxLength, length);
|
| int size = SeqOneByteString::SizeFor(length);
|
| DCHECK(size <= SeqOneByteString::kMaxSize);
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
|
|
|
| HeapObject* result;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
|
|
| @@ -4126,11 +4161,11 @@ AllocationResult Heap::AllocateRawTwoByteString(int length,
|
| DCHECK_GE(String::kMaxLength, length);
|
| int size = SeqTwoByteString::SizeFor(length);
|
| DCHECK(size <= SeqTwoByteString::kMaxSize);
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
|
|
|
| HeapObject* result;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
|
|
| @@ -4147,7 +4182,8 @@ AllocationResult Heap::AllocateEmptyFixedArray() {
|
| int size = FixedArray::SizeFor(0);
|
| HeapObject* result;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE);
|
| + AllocationResult allocation =
|
| + AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
| // Initialize the object.
|
| @@ -4269,9 +4305,9 @@ AllocationResult Heap::AllocateRawFixedArray(int length,
|
| v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true);
|
| }
|
| int size = FixedArray::SizeFor(length);
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, pretenure);
|
|
|
| - return AllocateRaw(size, space, OLD_SPACE);
|
| + return AllocateRaw(size, space, OLD_POINTER_SPACE);
|
| }
|
|
|
|
|
| @@ -4340,11 +4376,11 @@ AllocationResult Heap::AllocateRawFixedDoubleArray(int length,
|
| #ifndef V8_HOST_ARCH_64_BIT
|
| size += kPointerSize;
|
| #endif
|
| - AllocationSpace space = SelectSpace(size, pretenure);
|
| + AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure);
|
|
|
| HeapObject* object;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE);
|
| if (!allocation.To(&object)) return allocation;
|
| }
|
|
|
| @@ -4359,11 +4395,11 @@ AllocationResult Heap::AllocateConstantPoolArray(
|
| #ifndef V8_HOST_ARCH_64_BIT
|
| size += kPointerSize;
|
| #endif
|
| - AllocationSpace space = SelectSpace(size, TENURED);
|
| + AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED);
|
|
|
| HeapObject* object;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_POINTER_SPACE);
|
| if (!allocation.To(&object)) return allocation;
|
| }
|
| object = EnsureDoubleAligned(this, object, size);
|
| @@ -4385,11 +4421,11 @@ AllocationResult Heap::AllocateExtendedConstantPoolArray(
|
| #ifndef V8_HOST_ARCH_64_BIT
|
| size += kPointerSize;
|
| #endif
|
| - AllocationSpace space = SelectSpace(size, TENURED);
|
| + AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED);
|
|
|
| HeapObject* object;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE);
|
| + AllocationResult allocation = AllocateRaw(size, space, OLD_POINTER_SPACE);
|
| if (!allocation.To(&object)) return allocation;
|
| }
|
| object = EnsureDoubleAligned(this, object, size);
|
| @@ -4407,7 +4443,8 @@ AllocationResult Heap::AllocateEmptyConstantPoolArray() {
|
| int size = ConstantPoolArray::SizeFor(small);
|
| HeapObject* result = NULL;
|
| {
|
| - AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE);
|
| + AllocationResult allocation =
|
| + AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
| }
|
| result->set_map_no_write_barrier(constant_pool_array_map());
|
| @@ -4422,7 +4459,7 @@ AllocationResult Heap::AllocateSymbol() {
|
|
|
| HeapObject* result = NULL;
|
| AllocationResult allocation =
|
| - AllocateRaw(Symbol::kSize, OLD_SPACE, OLD_SPACE);
|
| + AllocateRaw(Symbol::kSize, OLD_POINTER_SPACE, OLD_POINTER_SPACE);
|
| if (!allocation.To(&result)) return allocation;
|
|
|
| result->set_map_no_write_barrier(symbol_map());
|
| @@ -4460,7 +4497,7 @@ AllocationResult Heap::AllocateStruct(InstanceType type) {
|
| return exception();
|
| }
|
| int size = map->instance_size();
|
| - AllocationSpace space = SelectSpace(size, TENURED);
|
| + AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED);
|
| Struct* result;
|
| {
|
| AllocationResult allocation = Allocate(map, space);
|
| @@ -4725,8 +4762,10 @@ void Heap::ReportHeapStatistics(const char* title) {
|
| isolate_->memory_allocator()->ReportStatistics();
|
| PrintF("To space : ");
|
| new_space_.ReportStatistics();
|
| - PrintF("Old space : ");
|
| - old_space_->ReportStatistics();
|
| + PrintF("Old pointer space : ");
|
| + old_pointer_space_->ReportStatistics();
|
| + PrintF("Old data space : ");
|
| + old_data_space_->ReportStatistics();
|
| PrintF("Code space : ");
|
| code_space_->ReportStatistics();
|
| PrintF("Map space : ");
|
| @@ -4746,9 +4785,11 @@ bool Heap::Contains(HeapObject* value) { return Contains(value->address()); }
|
| bool Heap::Contains(Address addr) {
|
| if (isolate_->memory_allocator()->IsOutsideAllocatedSpace(addr)) return false;
|
| return HasBeenSetUp() &&
|
| - (new_space_.ToSpaceContains(addr) || old_space_->Contains(addr) ||
|
| - code_space_->Contains(addr) || map_space_->Contains(addr) ||
|
| - cell_space_->Contains(addr) || lo_space_->SlowContains(addr));
|
| + (new_space_.ToSpaceContains(addr) ||
|
| + old_pointer_space_->Contains(addr) ||
|
| + old_data_space_->Contains(addr) || code_space_->Contains(addr) ||
|
| + map_space_->Contains(addr) || cell_space_->Contains(addr) ||
|
| + lo_space_->SlowContains(addr));
|
| }
|
|
|
|
|
| @@ -4764,8 +4805,10 @@ bool Heap::InSpace(Address addr, AllocationSpace space) {
|
| switch (space) {
|
| case NEW_SPACE:
|
| return new_space_.ToSpaceContains(addr);
|
| - case OLD_SPACE:
|
| - return old_space_->Contains(addr);
|
| + case OLD_POINTER_SPACE:
|
| + return old_pointer_space_->Contains(addr);
|
| + case OLD_DATA_SPACE:
|
| + return old_data_space_->Contains(addr);
|
| case CODE_SPACE:
|
| return code_space_->Contains(addr);
|
| case MAP_SPACE:
|
| @@ -4813,10 +4856,11 @@ void Heap::Verify() {
|
|
|
| new_space_.Verify();
|
|
|
| - old_space_->Verify(&visitor);
|
| + old_pointer_space_->Verify(&visitor);
|
| map_space_->Verify(&visitor);
|
|
|
| VerifyPointersVisitor no_dirty_regions_visitor;
|
| + old_data_space_->Verify(&no_dirty_regions_visitor);
|
| code_space_->Verify(&no_dirty_regions_visitor);
|
| cell_space_->Verify(&no_dirty_regions_visitor);
|
|
|
| @@ -5133,8 +5177,10 @@ void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
|
| *stats->end_marker = HeapStats::kEndMarker;
|
| *stats->new_space_size = new_space_.SizeAsInt();
|
| *stats->new_space_capacity = static_cast<int>(new_space_.Capacity());
|
| - *stats->old_space_size = old_space_->SizeOfObjects();
|
| - *stats->old_space_capacity = old_space_->Capacity();
|
| + *stats->old_pointer_space_size = old_pointer_space_->SizeOfObjects();
|
| + *stats->old_pointer_space_capacity = old_pointer_space_->Capacity();
|
| + *stats->old_data_space_size = old_data_space_->SizeOfObjects();
|
| + *stats->old_data_space_capacity = old_data_space_->Capacity();
|
| *stats->code_space_size = code_space_->SizeOfObjects();
|
| *stats->code_space_capacity = code_space_->Capacity();
|
| *stats->map_space_size = map_space_->SizeOfObjects();
|
| @@ -5163,7 +5209,8 @@ void Heap::RecordStats(HeapStats* stats, bool take_snapshot) {
|
|
|
|
|
| intptr_t Heap::PromotedSpaceSizeOfObjects() {
|
| - return old_space_->SizeOfObjects() + code_space_->SizeOfObjects() +
|
| + return old_pointer_space_->SizeOfObjects() +
|
| + old_data_space_->SizeOfObjects() + code_space_->SizeOfObjects() +
|
| map_space_->SizeOfObjects() + cell_space_->SizeOfObjects() +
|
| lo_space_->SizeOfObjects();
|
| }
|
| @@ -5287,11 +5334,17 @@ bool Heap::SetUp() {
|
| }
|
| new_space_top_after_last_gc_ = new_space()->top();
|
|
|
| - // Initialize old space.
|
| - old_space_ =
|
| - new OldSpace(this, max_old_generation_size_, OLD_SPACE, NOT_EXECUTABLE);
|
| - if (old_space_ == NULL) return false;
|
| - if (!old_space_->SetUp()) return false;
|
| + // Initialize old pointer space.
|
| + old_pointer_space_ = new OldSpace(this, max_old_generation_size_,
|
| + OLD_POINTER_SPACE, NOT_EXECUTABLE);
|
| + if (old_pointer_space_ == NULL) return false;
|
| + if (!old_pointer_space_->SetUp()) return false;
|
| +
|
| + // Initialize old data space.
|
| + old_data_space_ = new OldSpace(this, max_old_generation_size_, OLD_DATA_SPACE,
|
| + NOT_EXECUTABLE);
|
| + if (old_data_space_ == NULL) return false;
|
| + if (!old_data_space_->SetUp()) return false;
|
|
|
| if (!isolate_->code_range()->SetUp(code_range_size_)) return false;
|
|
|
| @@ -5414,8 +5467,12 @@ void Heap::TearDown() {
|
| MaximumCommittedMemory());
|
| PrintF("maximum_committed_by_new_space=%" V8_PTR_PREFIX "d ",
|
| new_space_.MaximumCommittedMemory());
|
| - PrintF("maximum_committed_by_old_space=%" V8_PTR_PREFIX "d ",
|
| - old_space_->MaximumCommittedMemory());
|
| + PrintF("maximum_committed_by_old_pointer_space=%" V8_PTR_PREFIX "d ",
|
| + old_data_space_->MaximumCommittedMemory());
|
| + PrintF("maximum_committed_by_old_data_space=%" V8_PTR_PREFIX "d ",
|
| + old_pointer_space_->MaximumCommittedMemory());
|
| + PrintF("maximum_committed_by_old_data_space=%" V8_PTR_PREFIX "d ",
|
| + old_pointer_space_->MaximumCommittedMemory());
|
| PrintF("maximum_committed_by_code_space=%" V8_PTR_PREFIX "d ",
|
| code_space_->MaximumCommittedMemory());
|
| PrintF("maximum_committed_by_map_space=%" V8_PTR_PREFIX "d ",
|
| @@ -5441,10 +5498,16 @@ void Heap::TearDown() {
|
|
|
| new_space_.TearDown();
|
|
|
| - if (old_space_ != NULL) {
|
| - old_space_->TearDown();
|
| - delete old_space_;
|
| - old_space_ = NULL;
|
| + if (old_pointer_space_ != NULL) {
|
| + old_pointer_space_->TearDown();
|
| + delete old_pointer_space_;
|
| + old_pointer_space_ = NULL;
|
| + }
|
| +
|
| + if (old_data_space_ != NULL) {
|
| + old_data_space_->TearDown();
|
| + delete old_data_space_;
|
| + old_data_space_ = NULL;
|
| }
|
|
|
| if (code_space_ != NULL) {
|
| @@ -5580,8 +5643,10 @@ Space* AllSpaces::next() {
|
| switch (counter_++) {
|
| case NEW_SPACE:
|
| return heap_->new_space();
|
| - case OLD_SPACE:
|
| - return heap_->old_space();
|
| + case OLD_POINTER_SPACE:
|
| + return heap_->old_pointer_space();
|
| + case OLD_DATA_SPACE:
|
| + return heap_->old_data_space();
|
| case CODE_SPACE:
|
| return heap_->code_space();
|
| case MAP_SPACE:
|
| @@ -5598,8 +5663,10 @@ Space* AllSpaces::next() {
|
|
|
| PagedSpace* PagedSpaces::next() {
|
| switch (counter_++) {
|
| - case OLD_SPACE:
|
| - return heap_->old_space();
|
| + case OLD_POINTER_SPACE:
|
| + return heap_->old_pointer_space();
|
| + case OLD_DATA_SPACE:
|
| + return heap_->old_data_space();
|
| case CODE_SPACE:
|
| return heap_->code_space();
|
| case MAP_SPACE:
|
| @@ -5614,8 +5681,10 @@ PagedSpace* PagedSpaces::next() {
|
|
|
| OldSpace* OldSpaces::next() {
|
| switch (counter_++) {
|
| - case OLD_SPACE:
|
| - return heap_->old_space();
|
| + case OLD_POINTER_SPACE:
|
| + return heap_->old_pointer_space();
|
| + case OLD_DATA_SPACE:
|
| + return heap_->old_data_space();
|
| case CODE_SPACE:
|
| return heap_->code_space();
|
| default:
|
| @@ -5674,8 +5743,12 @@ ObjectIterator* SpaceIterator::CreateIterator() {
|
| case NEW_SPACE:
|
| iterator_ = new SemiSpaceIterator(heap_->new_space(), size_func_);
|
| break;
|
| - case OLD_SPACE:
|
| - iterator_ = new HeapObjectIterator(heap_->old_space(), size_func_);
|
| + case OLD_POINTER_SPACE:
|
| + iterator_ =
|
| + new HeapObjectIterator(heap_->old_pointer_space(), size_func_);
|
| + break;
|
| + case OLD_DATA_SPACE:
|
| + iterator_ = new HeapObjectIterator(heap_->old_data_space(), size_func_);
|
| break;
|
| case CODE_SPACE:
|
| iterator_ = new HeapObjectIterator(heap_->code_space(), size_func_);
|
|
|