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

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

Issue 2397373002: [heap] Use the thread-safe free modes also for RemoveRange in SlotSet. (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
Index: src/heap/remembered-set.h
diff --git a/src/heap/remembered-set.h b/src/heap/remembered-set.h
index 74791b926bb7772a4646dcec507abbe561c7f85b..978f1c421670d1654f27fac21b45a07acfce5986 100644
--- a/src/heap/remembered-set.h
+++ b/src/heap/remembered-set.h
@@ -45,7 +45,8 @@ 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(MemoryChunk* chunk, Address start, Address end) {
+ static void RemoveRange(MemoryChunk* chunk, Address start, Address end,
+ SlotSet::EmptyBucketMode mode) {
SlotSet* slot_set = GetSlotSet(chunk);
if (slot_set != nullptr) {
uintptr_t start_offset = start - chunk->address();
@@ -53,7 +54,7 @@ class RememberedSet {
DCHECK_LT(start_offset, end_offset);
if (end_offset < static_cast<uintptr_t>(Page::kPageSize)) {
slot_set->RemoveRange(static_cast<int>(start_offset),
- static_cast<int>(end_offset));
+ static_cast<int>(end_offset), mode);
} else {
// The large page has multiple slot sets.
// Compute slot set indicies for the range [start_offset, end_offset).
@@ -67,17 +68,17 @@ class RememberedSet {
end_offset - static_cast<uintptr_t>(end_chunk) * Page::kPageSize);
if (start_chunk == end_chunk) {
slot_set[start_chunk].RemoveRange(offset_in_start_chunk,
- offset_in_end_chunk);
+ offset_in_end_chunk, mode);
} else {
// Clear all slots from start_offset to the end of first chunk.
slot_set[start_chunk].RemoveRange(offset_in_start_chunk,
- Page::kPageSize);
+ Page::kPageSize, mode);
// Clear all slots in intermediate chunks.
for (int i = start_chunk + 1; i < end_chunk; i++) {
- slot_set[i].RemoveRange(0, Page::kPageSize);
+ slot_set[i].RemoveRange(0, Page::kPageSize, mode);
}
// Clear slots from the beginning of the last page to end_offset.
- slot_set[end_chunk].RemoveRange(0, offset_in_end_chunk);
+ slot_set[end_chunk].RemoveRange(0, offset_in_end_chunk, mode);
}
}
}
« src/heap/heap.cc ('K') | « src/heap/mark-compact.cc ('k') | src/heap/slot-set.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698