Commit c2852992 authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[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/+/3562981Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79798}
parent 0056f4ff
......@@ -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()),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment