cppgc: young-gen: Pass remembered sets by refs

Accidentally, remembered sets for slots and source objects were passed
by value when visiting.

Bug: chromium:1029379
Change-Id: I1942a13605990c0b13c378d33d3ace602daddf0d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3545318
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Auto-Submit: Anton Bikineev <bikineev@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79591}
This commit is contained in:
Anton Bikineev 2022-03-23 22:23:04 +01:00 committed by V8 LUCI CQ
parent 19633c4e2c
commit 3f10fbb96b

View File

@ -17,7 +17,7 @@ namespace internal {
namespace {
// Visit remembered set that was recorded in the generational barrier.
void VisitRememberedSlots(std::set<void*> slots, const HeapBase& heap,
void VisitRememberedSlots(const std::set<void*>& slots, const HeapBase& heap,
MutatorMarkingState& mutator_marking_state) {
for (void* slot : slots) {
// Slot must always point to a valid, not freed object.
@ -51,7 +51,8 @@ void VisitRememberedSlots(std::set<void*> slots, const HeapBase& heap,
// Visits source objects that were recorded in the generational barrier for
// slots.
void VisitRememberedSourceObjects(
std::set<HeapObjectHeader*> remembered_source_objects, Visitor& visitor) {
const std::set<HeapObjectHeader*>& remembered_source_objects,
Visitor& visitor) {
for (HeapObjectHeader* source_hoh : remembered_source_objects) {
DCHECK(source_hoh);
// The age checking in the generational barrier is imprecise, since a card