Index: src/heap/remembered-set.cc |
diff --git a/src/heap/remembered-set.cc b/src/heap/remembered-set.cc |
index 786e1950765cc9d32fa25249de7cf0b6df705905..4e621611ac817abc6d356bba7e237f939014b4a8 100644 |
--- a/src/heap/remembered-set.cc |
+++ b/src/heap/remembered-set.cc |
@@ -13,6 +13,23 @@ |
namespace v8 { |
namespace internal { |
+ |
+template <PointerDirection direction> |
+void RememberedSet<direction>::ClearInvalidSlots(Heap* heap, |
+ MemoryChunk* chunk) { |
+ STATIC_ASSERT(direction == OLD_TO_NEW); |
+ DCHECK(chunk->owner()->identity() == OLD_SPACE || |
+ chunk->owner()->identity() == MAP_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; |
+ }, |
+ SlotSet::KEEP_EMPTY_BUCKETS); |
+ } |
+} |
template <PointerDirection direction> |
void RememberedSet<direction>::ClearInvalidTypedSlots(Heap* heap, |
@@ -43,6 +60,8 @@ |
chunk, reinterpret_cast<Address>(slot)); |
} |
+template void RememberedSet<OLD_TO_NEW>::ClearInvalidSlots(Heap* heap, |
+ MemoryChunk* chunk); |
template void RememberedSet<OLD_TO_NEW>::ClearInvalidTypedSlots( |
Heap* heap, MemoryChunk* chunk); |