[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/+/3317424 Reviewed-by: Michael Lippautz <mlippautz@chromium.org> Commit-Queue: Dominik Inführ <dinfuehr@chromium.org> Cr-Commit-Position: refs/heads/main@{#78273}
This commit is contained in:
parent
5f4a7052e6
commit
fd23e91464
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user