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

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

Issue 2390743005: [heap] Concurrently free empty slot set buckets. (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.cc
diff --git a/src/heap/remembered-set.cc b/src/heap/remembered-set.cc
index 467f72500881643d87ed7e12e8d519995959b31a..c5dab905159b33be62906139efb79b64209ee46e 100644
--- a/src/heap/remembered-set.cc
+++ b/src/heap/remembered-set.cc
@@ -20,10 +20,12 @@ void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) {
for (MemoryChunk* chunk : *heap->old_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;
- });
+ slots->Iterate(
+ [heap, chunk](Address addr) {
+ Object** slot = reinterpret_cast<Object**>(addr);
+ return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT;
+ },
+ SlotSet::PREFREE_EMPTY_BUCKETS);
}
}
for (MemoryChunk* chunk : *heap->code_space()) {
@@ -43,14 +45,17 @@ void RememberedSet<direction>::ClearInvalidSlots(Heap* heap) {
for (MemoryChunk* chunk : *heap->map_space()) {
SlotSet* slots = GetSlotSet(chunk);
if (slots != nullptr) {
- slots->Iterate([heap, chunk](Address addr) {
- Object** slot = reinterpret_cast<Object**>(addr);
- // TODO(mlippautz): In map space all allocations would ideally be map
- // aligned. After establishing this invariant IsValidSlot could just
- // refer to the containing object using alignment and check the mark
- // bits.
- return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT;
- });
+ slots->Iterate(
+ [heap, chunk](Address addr) {
+ Object** slot = reinterpret_cast<Object**>(addr);
+ // TODO(mlippautz): In map space all allocations would ideally be
+ // map
+ // aligned. After establishing this invariant IsValidSlot could just
+ // refer to the containing object using alignment and check the mark
+ // bits.
+ return IsValidSlot(heap, chunk, slot) ? KEEP_SLOT : REMOVE_SLOT;
+ },
+ SlotSet::PREFREE_EMPTY_BUCKETS);
}
}
}
« no previous file with comments | « src/heap/remembered-set.h ('k') | src/heap/slot-set.h » ('j') | src/heap/slot-set.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698