Index: src/heap/remembered-set.h |
diff --git a/src/heap/remembered-set.h b/src/heap/remembered-set.h |
index 919da9ff6f4fd9cc96ebac625d71419c7df48213..74791b926bb7772a4646dcec507abbe561c7f85b 100644 |
--- a/src/heap/remembered-set.h |
+++ b/src/heap/remembered-set.h |
@@ -116,10 +116,13 @@ class RememberedSet { |
size_t pages = (chunk->size() + Page::kPageSize - 1) / Page::kPageSize; |
int new_count = 0; |
for (size_t page = 0; page < pages; page++) { |
- new_count += slots[page].Iterate(callback); |
+ new_count += |
+ slots[page].Iterate(callback, SlotSet::PREFREE_EMPTY_BUCKETS); |
} |
- if (new_count == 0) { |
- ReleaseSlotSet(chunk); |
+ // Only old-to-old slot sets are released eagerly. Old-new-slot sets are |
+ // released by the sweeper threads. |
+ if (direction == OLD_TO_OLD && new_count == 0) { |
+ chunk->ReleaseOldToOldSlots(); |
} |
} |
} |
@@ -219,14 +222,6 @@ class RememberedSet { |
} |
} |
- static void ReleaseSlotSet(MemoryChunk* chunk) { |
- if (direction == OLD_TO_OLD) { |
- chunk->ReleaseOldToOldSlots(); |
- } else { |
- chunk->ReleaseOldToNewSlots(); |
- } |
- } |
- |
static void ReleaseTypedSlotSet(MemoryChunk* chunk) { |
if (direction == OLD_TO_OLD) { |
chunk->ReleaseTypedOldToOldSlots(); |