heap: Fix concurrently acquiring stress marking limit

Bug: v8:12717
Change-Id: I0ffe277dda3eed2073f166f2b93a2f2c611c6d01
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3532232
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#79519}
This commit is contained in:
Michael Lippautz 2022-03-17 15:46:37 +01:00 committed by V8 LUCI CQ
parent 0a5fcd8a78
commit a15e2b579f

View File

@ -5879,6 +5879,9 @@ void Heap::PrintMaxNewSpaceSizeReached() {
}
int Heap::NextStressMarkingLimit() {
// Reuse Heap-global mutex as this getter is called from different threads on
// allocation slow paths.
base::MutexGuard guard(relocation_mutex());
return isolate()->fuzzer_rng()->NextInt(FLAG_stress_marking + 1);
}