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

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

Issue 1701963003: Filter invalid slots after array trimming. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compile Created 4 years, 10 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/heap.cc ('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.h
diff --git a/src/heap/remembered-set.h b/src/heap/remembered-set.h
index 505879758a2b26b192bba78865b5a4b07f6410db..351d76edb84c18706da7fede9003948d75562a59 100644
--- a/src/heap/remembered-set.h
+++ b/src/heap/remembered-set.h
@@ -41,6 +41,20 @@ class RememberedSet {
}
}
+ // Given a page and a range of slots in that page, this function removes the
+ // slots from the remembered set.
+ static void RemoveRange(Page* page, Address start, Address end) {
+ SlotSet* slot_set = GetSlotSet(page);
+ if (slot_set != nullptr) {
+ uintptr_t start_offset = start - page->address();
+ uintptr_t end_offset = end - page->address();
+ DCHECK_LT(start_offset, end_offset);
+ DCHECK_LE(end_offset, static_cast<uintptr_t>(Page::kPageSize));
+ slot_set->RemoveRange(static_cast<uint32_t>(start_offset),
+ static_cast<uint32_t>(end_offset));
+ }
+ }
+
// Iterates and filters the remembered set with the given callback.
// The callback should take (Address slot) and return SlotSet::CallbackResult.
template <typename Callback>
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/slot-set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698