Index: src/heap/spaces.cc |
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc |
index b5b7d12c946f41ffe8c2dc621abb3d9a3d242094..f3c2eb0abb0134f9f96da51d2d52960c088fcd69 100644 |
--- a/src/heap/spaces.cc |
+++ b/src/heap/spaces.cc |
@@ -41,7 +41,8 @@ HeapObjectIterator::HeapObjectIterator(PagedSpace* space, |
HeapObjectIterator::HeapObjectIterator(Page* page, |
HeapObjectCallback size_func) { |
Space* owner = page->owner(); |
- DCHECK(owner == page->heap()->old_space() || |
+ DCHECK(owner == page->heap()->old_pointer_space() || |
+ owner == page->heap()->old_data_space() || |
owner == page->heap()->map_space() || |
owner == page->heap()->cell_space() || |
owner == page->heap()->code_space()); |
@@ -509,6 +510,10 @@ MemoryChunk* MemoryChunk::Initialize(Heap* heap, Address base, size_t size, |
chunk->SetFlag(IS_EXECUTABLE); |
} |
+ if (owner == heap->old_data_space()) { |
+ chunk->SetFlag(CONTAINS_ONLY_DATA); |
+ } |
+ |
return chunk; |
} |
@@ -920,8 +925,11 @@ void MemoryChunk::IncrementLiveBytesFromMutator(Address address, int by) { |
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::NEW_SPACE) == |
ObjectSpace::kObjectSpaceNewSpace); |
-STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::OLD_SPACE) == |
- ObjectSpace::kObjectSpaceOldSpace); |
+STATIC_ASSERT(static_cast<ObjectSpace>(1 |
+ << AllocationSpace::OLD_POINTER_SPACE) == |
+ ObjectSpace::kObjectSpaceOldPointerSpace); |
+STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::OLD_DATA_SPACE) == |
+ ObjectSpace::kObjectSpaceOldDataSpace); |
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CODE_SPACE) == |
ObjectSpace::kObjectSpaceCodeSpace); |
STATIC_ASSERT(static_cast<ObjectSpace>(1 << AllocationSpace::CELL_SPACE) == |
@@ -1109,7 +1117,11 @@ void PagedSpace::ReleasePage(Page* page) { |
page->Unlink(); |
} |
- heap()->QueueMemoryChunkForFree(page); |
+ if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) { |
+ heap()->isolate()->memory_allocator()->Free(page); |
+ } else { |
+ heap()->QueueMemoryChunkForFree(page); |
+ } |
DCHECK(Capacity() > 0); |
accounting_stats_.ShrinkSpace(AreaSize()); |