Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(335)

Unified Diff: src/heap/remembered-set.cc

Issue 2418053002: Revert of [heap] Move slot filtering logic into sweeper. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/remembered-set.h ('k') | src/heap/slot-set.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « src/heap/remembered-set.h ('k') | src/heap/slot-set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698