[heap] Sweeper only needs to remove old-to-old-slots during GC
Only remove old-to-old slots during a GC, but DCHECK that the old-to-old-slot set is empty after a full GC. Previously we simply removed from the remembered set during and outside the full GC. We now have a flag to DCHECK this more precisely. Bug: v8:12760 Change-Id: Ie6adc3f47a700497aaa818da0e83d6cb94e3c75d Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3562981 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/main@{#79798}
This commit is contained in:
parent
0056f4ff33
commit
c2852992fc
@ -263,9 +263,14 @@ V8_INLINE void Sweeper::CleanupRememberedSetEntriesForFreedMemory(
|
||||
// sweeper thread would race with the main thread.
|
||||
RememberedSet<OLD_TO_NEW>::RemoveRange(page, free_start, free_end,
|
||||
SlotSet::KEEP_EMPTY_BUCKETS);
|
||||
|
||||
// While we only add old-to-old slots on live objects, we can still end up
|
||||
// with old-to-old slots in free memory with e.g. right-trimming of objects.
|
||||
RememberedSet<OLD_TO_OLD>::RemoveRange(page, free_start, free_end,
|
||||
SlotSet::KEEP_EMPTY_BUCKETS);
|
||||
} else {
|
||||
DCHECK_NULL(page->slot_set<OLD_TO_OLD>());
|
||||
}
|
||||
RememberedSet<OLD_TO_OLD>::RemoveRange(page, free_start, free_end,
|
||||
SlotSet::KEEP_EMPTY_BUCKETS);
|
||||
if (non_empty_typed_slots) {
|
||||
free_ranges_map->insert(std::pair<uint32_t, uint32_t>(
|
||||
static_cast<uint32_t>(free_start - page->address()),
|
||||
|
Loading…
Reference in New Issue
Block a user