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

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

Issue 2403423007: [heap] Reland concurrent slot filtering in sweeper threads. (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.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/slot-set.h
diff --git a/src/heap/slot-set.h b/src/heap/slot-set.h
index 2d7525f56cd41ec0e1529c7440d968d9385374bd..78688654367ec8dec536d34d2e6bac63bab152bc 100644
--- a/src/heap/slot-set.h
+++ b/src/heap/slot-set.h
@@ -179,7 +179,7 @@ class SlotSet : public Malloced {
if (current_bucket[i].Value()) {
uint32_t cell = current_bucket[i].Value();
uint32_t old_cell = cell;
- uint32_t new_cell = cell;
+ uint32_t mask = 0;
while (cell) {
int bit_offset = base::bits::CountTrailingZeros32(cell);
uint32_t bit_mask = 1u << bit_offset;
@@ -187,10 +187,11 @@ class SlotSet : public Malloced {
if (callback(page_start_ + slot) == KEEP_SLOT) {
++in_bucket_count;
} else {
- new_cell ^= bit_mask;
+ mask |= bit_mask;
}
cell ^= bit_mask;
}
+ uint32_t new_cell = old_cell & ~mask;
if (old_cell != new_cell) {
while (!current_bucket[i].TrySetValue(old_cell, new_cell)) {
// If TrySetValue fails, the cell must have changed. We just
@@ -199,7 +200,7 @@ class SlotSet : public Malloced {
// method will only be called on the main thread and filtering
// threads will only remove slots.
old_cell = current_bucket[i].Value();
- new_cell &= old_cell;
+ new_cell = old_cell & ~mask;
}
}
}
« no previous file with comments | « src/heap/remembered-set.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698