Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 6ce23da02908f33323bd8ce6a7b6b1ee4c7e319f..a725eaca448e75f6bce8f886ef079f223c31e916 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -84,8 +84,7 @@ Heap::Heap() |
global_ic_age_(0), |
scan_on_scavenge_pages_(0), |
new_space_(this), |
- old_pointer_space_(NULL), |
- old_data_space_(NULL), |
+ old_space_(NULL), |
code_space_(NULL), |
map_space_(NULL), |
cell_space_(NULL), |
@@ -173,18 +172,16 @@ Heap::Heap() |
intptr_t Heap::Capacity() { |
if (!HasBeenSetUp()) return 0; |
- return new_space_.Capacity() + old_pointer_space_->Capacity() + |
- old_data_space_->Capacity() + code_space_->Capacity() + |
- map_space_->Capacity() + cell_space_->Capacity() + |
- property_cell_space_->Capacity(); |
+ return new_space_.Capacity() + old_space_->Capacity() + |
+ code_space_->Capacity() + map_space_->Capacity() + |
+ cell_space_->Capacity() + property_cell_space_->Capacity(); |
} |
intptr_t Heap::CommittedOldGenerationMemory() { |
if (!HasBeenSetUp()) return 0; |
- return old_pointer_space_->CommittedMemory() + |
- old_data_space_->CommittedMemory() + code_space_->CommittedMemory() + |
+ return old_space_->CommittedMemory() + code_space_->CommittedMemory() + |
map_space_->CommittedMemory() + cell_space_->CommittedMemory() + |
property_cell_space_->CommittedMemory() + lo_space_->Size(); |
} |
@@ -201,8 +198,7 @@ size_t Heap::CommittedPhysicalMemory() { |
if (!HasBeenSetUp()) return 0; |
return new_space_.CommittedPhysicalMemory() + |
- old_pointer_space_->CommittedPhysicalMemory() + |
- old_data_space_->CommittedPhysicalMemory() + |
+ old_space_->CommittedPhysicalMemory() + |
code_space_->CommittedPhysicalMemory() + |
map_space_->CommittedPhysicalMemory() + |
cell_space_->CommittedPhysicalMemory() + |
@@ -231,17 +227,16 @@ void Heap::UpdateMaximumCommitted() { |
intptr_t Heap::Available() { |
if (!HasBeenSetUp()) return 0; |
- return new_space_.Available() + old_pointer_space_->Available() + |
- old_data_space_->Available() + code_space_->Available() + |
- map_space_->Available() + cell_space_->Available() + |
- property_cell_space_->Available(); |
+ return new_space_.Available() + old_space_->Available() + |
+ code_space_->Available() + map_space_->Available() + |
+ cell_space_->Available() + property_cell_space_->Available(); |
} |
bool Heap::HasBeenSetUp() { |
- return old_pointer_space_ != NULL && old_data_space_ != NULL && |
- code_space_ != NULL && map_space_ != NULL && cell_space_ != NULL && |
- property_cell_space_ != NULL && lo_space_ != NULL; |
+ return old_space_ != NULL && code_space_ != NULL && map_space_ != NULL && |
+ cell_space_ != NULL && property_cell_space_ != NULL && |
+ lo_space_ != NULL; |
} |
@@ -344,22 +339,13 @@ 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 pointers, used: %6" V8_PTR_PREFIX |
+ PrintPID("Old space, used: %6" V8_PTR_PREFIX |
"d KB" |
", available: %6" V8_PTR_PREFIX |
"d KB" |
", committed: %6" V8_PTR_PREFIX "d KB\n", |
- 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); |
+ old_space_->SizeOfObjects() / KB, old_space_->Available() / KB, |
+ old_space_->CommittedMemory() / KB); |
PrintPID("Code space, used: %6" V8_PTR_PREFIX |
"d KB" |
", available: %6" V8_PTR_PREFIX |
@@ -663,12 +649,8 @@ void Heap::GarbageCollectionEpilogue() { |
isolate_->counters()->heap_fraction_new_space()->AddSample(static_cast<int>( |
(new_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_old_space()->AddSample(static_cast<int>( |
+ (old_space()->CommittedMemory() * 100.0) / CommittedMemory())); |
isolate_->counters()->heap_fraction_code_space()->AddSample( |
static_cast<int>((code_space()->CommittedMemory() * 100.0) / |
CommittedMemory())); |
@@ -721,8 +703,7 @@ void Heap::GarbageCollectionEpilogue() { |
UPDATE_FRAGMENTATION_FOR_SPACE(space) |
UPDATE_COUNTERS_FOR_SPACE(new_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(old_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) |
@@ -800,7 +781,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_POINTER_SPACE, gc_reason, gc_callback_flags); |
+ CollectGarbage(OLD_SPACE, gc_reason, gc_callback_flags); |
mark_compact_collector_.SetFlags(kNoGCFlags); |
} |
@@ -1383,11 +1364,6 @@ 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 |
@@ -2184,13 +2160,7 @@ class ScavengingVisitor : public StaticVisitorBase { |
} |
AllocationResult allocation; |
- 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); |
- } |
+ allocation = heap->old_space()->AllocateRaw(allocation_size); |
HeapObject* target = NULL; // Initialization to please compiler. |
if (allocation.To(&target)) { |
@@ -2606,14 +2576,14 @@ bool Heap::CreateInitialMaps() { |
set_empty_fixed_array(FixedArray::cast(obj)); |
{ |
- AllocationResult allocation = Allocate(null_map(), OLD_POINTER_SPACE); |
+ AllocationResult allocation = Allocate(null_map(), OLD_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_POINTER_SPACE); |
+ AllocationResult allocation = Allocate(undefined_map(), OLD_SPACE); |
if (!allocation.To(&obj)) return false; |
} |
set_undefined_value(Oddball::cast(obj)); |
@@ -2850,11 +2820,11 @@ AllocationResult Heap::AllocateHeapNumber(double value, MutableMode mode, |
int size = HeapNumber::kSize; |
STATIC_ASSERT(HeapNumber::kSize <= Page::kMaxRegularHeapObjectSize); |
- AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
HeapObject* result; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
@@ -2904,8 +2874,7 @@ AllocationResult Heap::AllocateWeakCell(HeapObject* value) { |
STATIC_ASSERT(WeakCell::kSize <= Page::kMaxRegularHeapObjectSize); |
HeapObject* result; |
{ |
- AllocationResult allocation = |
- AllocateRaw(size, OLD_POINTER_SPACE, OLD_POINTER_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
result->set_map_no_write_barrier(weak_cell_map()); |
@@ -3460,7 +3429,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_DATA_SPACE : NEW_SPACE; |
+ AllocationSpace space = (pretenure == TENURED) ? OLD_SPACE : NEW_SPACE; |
Foreign* result; |
AllocationResult allocation = Allocate(foreign_map(), space); |
if (!allocation.To(&result)) return allocation; |
@@ -3474,10 +3443,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, OLD_DATA_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
HeapObject* result; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
@@ -3508,20 +3477,17 @@ 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 pointer or old data space, |
+ // (1) the object is not in old 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 (!is_in_old_pointer_space && !is_in_old_data_space) || |
- page->WasSwept() || page->SweepingCompleted(); |
+ return !InOldSpace(address) || page->WasSwept() || page->SweepingCompleted(); |
} |
@@ -3638,10 +3604,10 @@ AllocationResult Heap::AllocateExternalArray(int length, |
void* external_pointer, |
PretenureFlag pretenure) { |
int size = ExternalArray::kAlignedSize; |
- AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
HeapObject* result; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
@@ -3684,10 +3650,10 @@ AllocationResult Heap::AllocateFixedTypedArray(int length, |
size += kPointerSize; |
} |
#endif |
- AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
HeapObject* object; |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&object)) return allocation; |
if (array_type == kExternalFloat64Array) { |
@@ -3851,8 +3817,7 @@ 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 : TargetSpaceId(map->instance_type()); |
+ AllocationSpace retry_space = (space != NEW_SPACE) ? space : OLD_SPACE; |
int size = map->instance_size(); |
if (allocation_site != NULL) { |
size += AllocationMemento::kSize; |
@@ -3929,7 +3894,7 @@ AllocationResult Heap::AllocateJSObjectFromMap( |
// Allocate the JSObject. |
int size = map->instance_size(); |
- AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
JSObject* js_obj; |
AllocationResult allocation = Allocate(map, space, allocation_site); |
if (!allocation.To(&js_obj)) return allocation; |
@@ -3980,7 +3945,7 @@ AllocationResult Heap::CopyJSObject(JSObject* source, AllocationSite* site) { |
if (always_allocate()) { |
{ |
AllocationResult allocation = |
- AllocateRaw(object_size, NEW_SPACE, OLD_POINTER_SPACE); |
+ AllocateRaw(object_size, NEW_SPACE, OLD_SPACE); |
if (!allocation.To(&clone)) return allocation; |
} |
Address clone_address = clone->address(); |
@@ -4131,12 +4096,12 @@ AllocationResult Heap::AllocateInternalizedStringImpl(T t, int chars, |
map = internalized_string_map(); |
size = SeqTwoByteString::SizeFor(chars); |
} |
- AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, TENURED); |
+ AllocationSpace space = SelectSpace(size, TENURED); |
// Allocate string. |
HeapObject* result; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
@@ -4174,11 +4139,11 @@ AllocationResult Heap::AllocateRawOneByteString(int length, |
DCHECK_GE(String::kMaxLength, length); |
int size = SeqOneByteString::SizeFor(length); |
DCHECK(size <= SeqOneByteString::kMaxSize); |
- AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
HeapObject* result; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
@@ -4198,11 +4163,11 @@ AllocationResult Heap::AllocateRawTwoByteString(int length, |
DCHECK_GE(String::kMaxLength, length); |
int size = SeqTwoByteString::SizeFor(length); |
DCHECK(size <= SeqTwoByteString::kMaxSize); |
- AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
HeapObject* result; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
@@ -4219,8 +4184,7 @@ AllocationResult Heap::AllocateEmptyFixedArray() { |
int size = FixedArray::SizeFor(0); |
HeapObject* result; |
{ |
- AllocationResult allocation = |
- AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
// Initialize the object. |
@@ -4342,9 +4306,9 @@ AllocationResult Heap::AllocateRawFixedArray(int length, |
v8::internal::Heap::FatalProcessOutOfMemory("invalid array length", true); |
} |
int size = FixedArray::SizeFor(length); |
- AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
- return AllocateRaw(size, space, OLD_POINTER_SPACE); |
+ return AllocateRaw(size, space, OLD_SPACE); |
} |
@@ -4413,11 +4377,11 @@ AllocationResult Heap::AllocateRawFixedDoubleArray(int length, |
#ifndef V8_HOST_ARCH_64_BIT |
size += kPointerSize; |
#endif |
- AllocationSpace space = SelectSpace(size, OLD_DATA_SPACE, pretenure); |
+ AllocationSpace space = SelectSpace(size, pretenure); |
HeapObject* object; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&object)) return allocation; |
} |
@@ -4432,11 +4396,11 @@ AllocationResult Heap::AllocateConstantPoolArray( |
#ifndef V8_HOST_ARCH_64_BIT |
size += kPointerSize; |
#endif |
- AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED); |
+ AllocationSpace space = SelectSpace(size, TENURED); |
HeapObject* object; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_POINTER_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&object)) return allocation; |
} |
object = EnsureDoubleAligned(this, object, size); |
@@ -4458,11 +4422,11 @@ AllocationResult Heap::AllocateExtendedConstantPoolArray( |
#ifndef V8_HOST_ARCH_64_BIT |
size += kPointerSize; |
#endif |
- AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED); |
+ AllocationSpace space = SelectSpace(size, TENURED); |
HeapObject* object; |
{ |
- AllocationResult allocation = AllocateRaw(size, space, OLD_POINTER_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, space, OLD_SPACE); |
if (!allocation.To(&object)) return allocation; |
} |
object = EnsureDoubleAligned(this, object, size); |
@@ -4480,8 +4444,7 @@ AllocationResult Heap::AllocateEmptyConstantPoolArray() { |
int size = ConstantPoolArray::SizeFor(small); |
HeapObject* result; |
{ |
- AllocationResult allocation = |
- AllocateRaw(size, OLD_DATA_SPACE, OLD_DATA_SPACE); |
+ AllocationResult allocation = AllocateRaw(size, OLD_SPACE, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
} |
result->set_map_no_write_barrier(constant_pool_array_map()); |
@@ -4496,7 +4459,7 @@ AllocationResult Heap::AllocateSymbol() { |
HeapObject* result; |
AllocationResult allocation = |
- AllocateRaw(Symbol::kSize, OLD_POINTER_SPACE, OLD_POINTER_SPACE); |
+ AllocateRaw(Symbol::kSize, OLD_SPACE, OLD_SPACE); |
if (!allocation.To(&result)) return allocation; |
result->set_map_no_write_barrier(symbol_map()); |
@@ -4534,7 +4497,7 @@ AllocationResult Heap::AllocateStruct(InstanceType type) { |
return exception(); |
} |
int size = map->instance_size(); |
- AllocationSpace space = SelectSpace(size, OLD_POINTER_SPACE, TENURED); |
+ AllocationSpace space = SelectSpace(size, TENURED); |
Struct* result; |
{ |
AllocationResult allocation = Allocate(map, space); |
@@ -4798,10 +4761,8 @@ void Heap::ReportHeapStatistics(const char* title) { |
isolate_->memory_allocator()->ReportStatistics(); |
PrintF("To space : "); |
new_space_.ReportStatistics(); |
- PrintF("Old pointer space : "); |
- old_pointer_space_->ReportStatistics(); |
- PrintF("Old data space : "); |
- old_data_space_->ReportStatistics(); |
+ PrintF("Old space : "); |
+ old_space_->ReportStatistics(); |
PrintF("Code space : "); |
code_space_->ReportStatistics(); |
PrintF("Map space : "); |
@@ -4823,11 +4784,9 @@ 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_pointer_space_->Contains(addr) || |
- old_data_space_->Contains(addr) || code_space_->Contains(addr) || |
- map_space_->Contains(addr) || cell_space_->Contains(addr) || |
- property_cell_space_->Contains(addr) || |
+ (new_space_.ToSpaceContains(addr) || old_space_->Contains(addr) || |
+ code_space_->Contains(addr) || map_space_->Contains(addr) || |
+ cell_space_->Contains(addr) || property_cell_space_->Contains(addr) || |
lo_space_->SlowContains(addr)); |
} |
@@ -4844,10 +4803,8 @@ bool Heap::InSpace(Address addr, AllocationSpace space) { |
switch (space) { |
case NEW_SPACE: |
return new_space_.ToSpaceContains(addr); |
- case OLD_POINTER_SPACE: |
- return old_pointer_space_->Contains(addr); |
- case OLD_DATA_SPACE: |
- return old_data_space_->Contains(addr); |
+ case OLD_SPACE: |
+ return old_space_->Contains(addr); |
case CODE_SPACE: |
return code_space_->Contains(addr); |
case MAP_SPACE: |
@@ -4897,11 +4854,10 @@ void Heap::Verify() { |
new_space_.Verify(); |
- old_pointer_space_->Verify(&visitor); |
+ old_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); |
property_cell_space_->Verify(&no_dirty_regions_visitor); |
@@ -5219,10 +5175,8 @@ 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_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->old_space_size = old_space_->SizeOfObjects(); |
+ *stats->old_space_capacity = old_space_->Capacity(); |
*stats->code_space_size = code_space_->SizeOfObjects(); |
*stats->code_space_capacity = code_space_->Capacity(); |
*stats->map_space_size = map_space_->SizeOfObjects(); |
@@ -5253,8 +5207,7 @@ void Heap::RecordStats(HeapStats* stats, bool take_snapshot) { |
intptr_t Heap::PromotedSpaceSizeOfObjects() { |
- return old_pointer_space_->SizeOfObjects() + |
- old_data_space_->SizeOfObjects() + code_space_->SizeOfObjects() + |
+ return old_space_->SizeOfObjects() + code_space_->SizeOfObjects() + |
map_space_->SizeOfObjects() + cell_space_->SizeOfObjects() + |
property_cell_space_->SizeOfObjects() + lo_space_->SizeOfObjects(); |
} |
@@ -5378,17 +5331,11 @@ bool Heap::SetUp() { |
} |
new_space_top_after_last_gc_ = new_space()->top(); |
- // 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; |
+ // 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; |
if (!isolate_->code_range()->SetUp(code_range_size_)) return false; |
@@ -5517,12 +5464,8 @@ void Heap::TearDown() { |
MaximumCommittedMemory()); |
PrintF("maximum_committed_by_new_space=%" V8_PTR_PREFIX "d ", |
new_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_old_space=%" V8_PTR_PREFIX "d ", |
+ old_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 ", |
@@ -5550,16 +5493,10 @@ void Heap::TearDown() { |
new_space_.TearDown(); |
- 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 (old_space_ != NULL) { |
+ old_space_->TearDown(); |
+ delete old_space_; |
+ old_space_ = NULL; |
} |
if (code_space_ != NULL) { |
@@ -5701,10 +5638,8 @@ Space* AllSpaces::next() { |
switch (counter_++) { |
case NEW_SPACE: |
return heap_->new_space(); |
- case OLD_POINTER_SPACE: |
- return heap_->old_pointer_space(); |
- case OLD_DATA_SPACE: |
- return heap_->old_data_space(); |
+ case OLD_SPACE: |
+ return heap_->old_space(); |
case CODE_SPACE: |
return heap_->code_space(); |
case MAP_SPACE: |
@@ -5723,10 +5658,8 @@ Space* AllSpaces::next() { |
PagedSpace* PagedSpaces::next() { |
switch (counter_++) { |
- case OLD_POINTER_SPACE: |
- return heap_->old_pointer_space(); |
- case OLD_DATA_SPACE: |
- return heap_->old_data_space(); |
+ case OLD_SPACE: |
+ return heap_->old_space(); |
case CODE_SPACE: |
return heap_->code_space(); |
case MAP_SPACE: |
@@ -5743,10 +5676,8 @@ PagedSpace* PagedSpaces::next() { |
OldSpace* OldSpaces::next() { |
switch (counter_++) { |
- case OLD_POINTER_SPACE: |
- return heap_->old_pointer_space(); |
- case OLD_DATA_SPACE: |
- return heap_->old_data_space(); |
+ case OLD_SPACE: |
+ return heap_->old_space(); |
case CODE_SPACE: |
return heap_->code_space(); |
default: |
@@ -5805,12 +5736,8 @@ ObjectIterator* SpaceIterator::CreateIterator() { |
case NEW_SPACE: |
iterator_ = new SemiSpaceIterator(heap_->new_space(), size_func_); |
break; |
- 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_); |
+ case OLD_SPACE: |
+ iterator_ = new HeapObjectIterator(heap_->old_space(), size_func_); |
break; |
case CODE_SPACE: |
iterator_ = new HeapObjectIterator(heap_->code_space(), size_func_); |