cppgc: young-gen: Fix generational barrier when value is not present

params.start was not set when marker was present, however the barrier
relies on params.start.

Bug: chromium:1029379
Change-Id: I12cfbdbdec63518cfc0d0d174085ea8aefb3a375
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3605822
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Commit-Queue: Anton Bikineev <bikineev@chromium.org>
Cr-Commit-Position: refs/heads/main@{#80207}
This commit is contained in:
Anton Bikineev 2022-04-27 10:20:35 +02:00 committed by V8 LUCI CQ
parent e6d2edd710
commit 353e95daa2

View File

@ -188,16 +188,13 @@ bool WriteBarrierTypeForNonCagedHeapPolicy::IsMarking(HeapHandle& heap_handle) {
bool WriteBarrierTypeForCagedHeapPolicy::IsMarking(
const HeapHandle& heap_handle, WriteBarrier::Params& params) {
const auto& heap_base = internal::HeapBase::From(heap_handle);
if (const MarkerBase* marker = heap_base.marker()) {
return marker->IsMarking();
}
const bool is_marking = heap_base.marker() && heap_base.marker()->IsMarking();
// Also set caged heap start here to avoid another call immediately after
// checking IsMarking().
#if defined(CPPGC_YOUNG_GENERATION)
params.start =
reinterpret_cast<uintptr_t>(&heap_base.caged_heap().local_data());
params.start = reinterpret_cast<uintptr_t>(heap_base.caged_heap().base());
#endif // !CPPGC_YOUNG_GENERATION
return false;
return is_marking;
}
#endif // CPPGC_CAGED_HEAP