From 51333720cd73213b9fd7264428ea3922699b979a Mon Sep 17 00:00:00 2001 From: hpayer Date: Tue, 18 Aug 2015 02:02:27 -0700 Subject: [PATCH] Only evacuation candidate pages have a slots buffer, just visit these pages when filtering slots. BUG= Review URL: https://codereview.chromium.org/1299623003 Cr-Commit-Position: refs/heads/master@{#30211} --- src/heap/mark-compact.cc | 21 ++++----------------- src/heap/mark-compact.h | 1 - 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc index dbb2d9c..49bf104 100644 --- a/src/heap/mark-compact.cc +++ b/src/heap/mark-compact.cc @@ -284,26 +284,13 @@ bool MarkCompactCollector::StartCompaction(CompactionMode mode) { } -void MarkCompactCollector::ClearInvalidSlotsBufferEntries(PagedSpace* space) { - PageIterator it(space); - while (it.has_next()) { - Page* p = it.next(); - SlotsBuffer::RemoveInvalidSlots(heap_, p->slots_buffer()); - } -} - - void MarkCompactCollector::ClearInvalidStoreAndSlotsBufferEntries() { heap_->store_buffer()->ClearInvalidStoreBufferEntries(); - ClearInvalidSlotsBufferEntries(heap_->old_space()); - ClearInvalidSlotsBufferEntries(heap_->code_space()); - ClearInvalidSlotsBufferEntries(heap_->map_space()); - - LargeObjectIterator it(heap_->lo_space()); - for (HeapObject* object = it.Next(); object != NULL; object = it.Next()) { - MemoryChunk* chunk = MemoryChunk::FromAddress(object->address()); - SlotsBuffer::RemoveInvalidSlots(heap_, chunk->slots_buffer()); + int number_of_pages = evacuation_candidates_.length(); + for (int i = 0; i < number_of_pages; i++) { + Page* p = evacuation_candidates_[i]; + SlotsBuffer::RemoveInvalidSlots(heap_, p->slots_buffer()); } } diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h index 546a2ac..99a5048 100644 --- a/src/heap/mark-compact.h +++ b/src/heap/mark-compact.h @@ -684,7 +684,6 @@ class MarkCompactCollector { bool WillBeDeoptimized(Code* code); void EvictPopularEvacuationCandidate(Page* page); - void ClearInvalidSlotsBufferEntries(PagedSpace* space); void ClearInvalidStoreAndSlotsBufferEntries(); void StartSweeperThreads(); -- 2.7.4