Only evacuation candidate pages have a slots buffer, just visit these pages when...
authorhpayer <hpayer@chromium.org>
Tue, 18 Aug 2015 09:02:27 +0000 (02:02 -0700)
committerCommit bot <commit-bot@chromium.org>
Tue, 18 Aug 2015 09:02:40 +0000 (09:02 +0000)
BUG=

Review URL: https://codereview.chromium.org/1299623003

Cr-Commit-Position: refs/heads/master@{#30211}

src/heap/mark-compact.cc
src/heap/mark-compact.h

index dbb2d9c..49bf104 100644 (file)
@@ -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());
   }
 }
 
index 546a2ac..99a5048 100644 (file)
@@ -684,7 +684,6 @@ class MarkCompactCollector {
 
   bool WillBeDeoptimized(Code* code);
   void EvictPopularEvacuationCandidate(Page* page);
-  void ClearInvalidSlotsBufferEntries(PagedSpace* space);
   void ClearInvalidStoreAndSlotsBufferEntries();
 
   void StartSweeperThreads();