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

[heap] Make active_safepoint_scopes_ non-atomic

Field used to be atomic for AssertActive() but now that this method
uses another approach, we can make that field non-atomic again.

Bug: v8:11708
Change-Id: I5254aa5e655844739082144fc75ba9f0c13d1ba0
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3317424Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#78273}
parent 5f4a7052
......@@ -56,7 +56,7 @@ void IsolateSafepoint::EnterGlobalSafepointScope(Isolate* initiator) {
IgnoreLocalGCRequests ignore_gc_requests(initiator->heap());
LockMutex(initiator->main_thread_local_heap());
}
CHECK_EQ(active_safepoint_scopes_.exchange(1), 0);
CHECK_EQ(++active_safepoint_scopes_, 1);
barrier_.Arm();
......@@ -106,7 +106,7 @@ void IsolateSafepoint::LockMutex(LocalHeap* local_heap) {
void IsolateSafepoint::LeaveGlobalSafepointScope(Isolate* initiator) {
local_heaps_mutex_.AssertHeld();
CHECK_EQ(active_safepoint_scopes_.exchange(0), 1);
CHECK_EQ(--active_safepoint_scopes_, 0);
ClearSafepointRequestedFlags(IncludeMainThreadUnlessInitiator(initiator));
barrier_.Disarm();
local_heaps_mutex_.Unlock();
......
......@@ -131,7 +131,7 @@ class IsolateSafepoint final {
base::RecursiveMutex local_heaps_mutex_;
LocalHeap* local_heaps_head_;
std::atomic<int> active_safepoint_scopes_;
int active_safepoint_scopes_;
friend class Heap;
friend class GlobalSafepoint;
......
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