diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc index 4cbf1604d5..f9bb68776b 100644 --- a/src/heap/spaces.cc +++ b/src/heap/spaces.cc @@ -1249,10 +1249,10 @@ template void MemoryChunk::ReleaseSlotSet(); template void MemoryChunk::ReleaseSlotSet() { - SlotSet* slot_set = base::AsAtomicWord::Acquire_Load(&slot_set_[type]); + SlotSet* slot_set = slot_set_[type]; if (slot_set) { + slot_set_[type] = nullptr; delete[] slot_set; - base::AsAtomicWord::Release_Store(&slot_set_[type], nullptr); } } @@ -1277,11 +1277,10 @@ template void MemoryChunk::ReleaseTypedSlotSet(); template void MemoryChunk::ReleaseTypedSlotSet() { - TypedSlotSet* typed_slot_set = - base::AsAtomicWord::Acquire_Load(&typed_slot_set_[type]); + TypedSlotSet* typed_slot_set = typed_slot_set_[type]; if (typed_slot_set) { + typed_slot_set_[type] = nullptr; delete typed_slot_set; - base::AsAtomicWord::Release_Store(&typed_slot_set_[type], nullptr); } } diff --git a/src/heap/spaces.h b/src/heap/spaces.h index 1071a3898d..13a483da66 100644 --- a/src/heap/spaces.h +++ b/src/heap/spaces.h @@ -461,19 +461,22 @@ class MemoryChunk { return typed_slot_set_[type]; } - inline LocalArrayBufferTracker* local_tracker() { return local_tracker_; } - bool contains_array_buffers(); - template SlotSet* AllocateSlotSet(); + // Not safe to be called concurrently. template void ReleaseSlotSet(); template TypedSlotSet* AllocateTypedSlotSet(); + // Not safe to be called concurrently. template void ReleaseTypedSlotSet(); + void AllocateLocalTracker(); void ReleaseLocalTracker(); + inline LocalArrayBufferTracker* local_tracker() { return local_tracker_; } + bool contains_array_buffers(); + void AllocateYoungGenerationBitmap(); void ReleaseYoungGenerationBitmap();