Index: src/spaces.cc |
diff --git a/src/spaces.cc b/src/spaces.cc |
index eeb7ea81d1fb387a87d5a335c78cb01ce6ff1986..adb8dee334df554d223089ce5e830eb6eaae5378 100644 |
--- a/src/spaces.cc |
+++ b/src/spaces.cc |
@@ -582,10 +582,6 @@ void MemoryChunk::InsertAfter(MemoryChunk* other) { |
void MemoryChunk::Unlink() { |
- if (!InNewSpace() && IsFlagSet(SCAN_ON_SCAVENGE)) { |
- heap_->decrement_scan_on_scavenge_pages(); |
- ClearFlag(SCAN_ON_SCAVENGE); |
- } |
MemoryChunk* next_element = next_chunk(); |
MemoryChunk* prev_element = prev_chunk(); |
next_element->set_prev_chunk(prev_element); |
@@ -953,7 +949,8 @@ PagedSpace::PagedSpace(Heap* heap, |
: Space(heap, id, executable), |
free_list_(this), |
was_swept_conservatively_(false), |
- unswept_free_bytes_(0) { |
+ unswept_free_bytes_(0), |
+ end_of_unswept_pages_(NULL) { |
if (id == CODE_SPACE) { |
area_size_ = heap->isolate()->memory_allocator()-> |
CodePageAreaSize(); |
@@ -1126,7 +1123,7 @@ void PagedSpace::IncreaseCapacity(int size) { |
} |
-void PagedSpace::ReleasePage(Page* page, bool unlink) { |
+void PagedSpace::ReleasePage(Page* page) { |
ASSERT(page->LiveBytes() == 0); |
ASSERT(AreaSize() == page->area_size()); |
@@ -1138,19 +1135,19 @@ void PagedSpace::ReleasePage(Page* page, bool unlink) { |
DecreaseUnsweptFreeBytes(page); |
} |
- // TODO(hpayer): This check is just used for debugging purpose and |
- // should be removed or turned into an assert after investigating the |
- // crash in concurrent sweeping. |
- CHECK(!free_list_.ContainsPageFreeListItems(page)); |
+ if (page->IsFlagSet(MemoryChunk::SCAN_ON_SCAVENGE)) { |
+ heap()->decrement_scan_on_scavenge_pages(); |
+ page->ClearFlag(MemoryChunk::SCAN_ON_SCAVENGE); |
+ } |
+ |
+ ASSERT(!free_list_.ContainsPageFreeListItems(page)); |
if (Page::FromAllocationTop(allocation_info_.top()) == page) { |
allocation_info_.set_top(NULL); |
allocation_info_.set_limit(NULL); |
} |
- if (unlink) { |
- page->Unlink(); |
- } |
+ page->Unlink(); |
if (page->IsFlagSet(MemoryChunk::CONTAINS_ONLY_DATA)) { |
heap()->isolate()->memory_allocator()->Free(page); |
} else { |