Index: src/heap/remembered-set.cc |
diff --git a/src/heap/remembered-set.cc b/src/heap/remembered-set.cc |
index 467f72500881643d87ed7e12e8d519995959b31a..c5dab905159b33be62906139efb79b64209ee46e 100644 |
--- a/src/heap/remembered-set.cc |
+++ b/src/heap/remembered-set.cc |
@@ -20,10 +20,12 @@ void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) { |
for (MemoryChunk* chunk : *heap->old_space()) { |
SlotSet* slots = GetSlotSet(chunk); |
if (slots != nullptr) { |
- slots->Iterate([heap, chunk](Address addr) { |
- Object** slot = reinterpret_cast<Object**>(addr); |
- return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT; |
- }); |
+ slots->Iterate( |
+ [heap, chunk](Address addr) { |
+ Object** slot = reinterpret_cast<Object**>(addr); |
+ return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT; |
+ }, |
+ SlotSet::PREFREE_EMPTY_BUCKETS); |
} |
} |
for (MemoryChunk* chunk : *heap->code_space()) { |
@@ -43,14 +45,17 @@ void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) { |
for (MemoryChunk* chunk : *heap->map_space()) { |
SlotSet* slots = GetSlotSet(chunk); |
if (slots != nullptr) { |
- slots->Iterate([heap, chunk](Address addr) { |
- Object** slot = reinterpret_cast<Object**>(addr); |
- // TODO(mlippautz): In map space all allocations would ideally be map |
- // aligned. After establishing this invariant IsValidSlot could just |
- // refer to the containing object using alignment and check the mark |
- // bits. |
- return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT; |
- }); |
+ slots->Iterate( |
+ [heap, chunk](Address addr) { |
+ Object** slot = reinterpret_cast<Object**>(addr); |
+ // TODO(mlippautz): In map space all allocations would ideally be |
+ // map |
+ // aligned. After establishing this invariant IsValidSlot could just |
+ // refer to the containing object using alignment and check the mark |
+ // bits. |
+ return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT; |
+ }, |
+ SlotSet::PREFREE_EMPTY_BUCKETS); |
} |
} |
} |