Commit d390b0c2 authored by Michael Lippautz's avatar Michael Lippautz Committed by V8 LUCI CQ

heap: Add check for always_promote_young_mc

Add CHECK ensuring that the young generation is indeed empty for
pointers updating. This is necessary as otherwise iterating an
object may race with updating a slot in a Map for WasmStruct.

Bug: v8:12185
Change-Id: Id590cf267fedf95d97df2464a638352696ad53db
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3260514Reviewed-by: 's avatarDominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#77709}
parent e9d36117
......@@ -4260,6 +4260,11 @@ void MarkCompactCollector::UpdatePointersAfterEvacuation() {
CollectRememberedSetUpdatingItems(&updating_items, heap()->map_space(),
RememberedSetUpdatingMode::ALL);
// In order to update pointers in map space at the same time as other spaces
// we need to ensure that young generation is empty. Otherwise, iterating
// to space may require a valid body descriptor for e.g. WasmStruct which
// races with updating a slot in Map.
CHECK(FLAG_always_promote_young_mc);
CollectToSpaceUpdatingItems(&updating_items);
updating_items.push_back(
std::make_unique<EphemeronTableUpdatingItem>(heap()));
......
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