src/hotspot/share/runtime/safepointVerifiers.hpp
changeset 57501 a297f7ab46c3
parent 53244 9807daeb47c4
child 57603 f9d9bed12d1a
--- a/src/hotspot/share/runtime/safepointVerifiers.hpp	Thu Jul 18 13:58:34 2019 -0700
+++ b/src/hotspot/share/runtime/safepointVerifiers.hpp	Tue Jul 23 13:56:41 2019 -0400
@@ -91,14 +91,12 @@
     _activated(activated) {
     _thread = Thread::current();
     if (_activated) {
-      _thread->_allow_allocation_count++;
       _thread->_allow_safepoint_count++;
     }
   }
 
   ~NoSafepointVerifier() {
     if (_activated) {
-      _thread->_allow_allocation_count--;
       _thread->_allow_safepoint_count--;
     }
   }
@@ -126,14 +124,12 @@
 
     _nsv = nsv;
     if (_nsv->_activated) {
-      _nsv->_thread->_allow_allocation_count--;
       _nsv->_thread->_allow_safepoint_count--;
     }
   }
 
   ~PauseNoSafepointVerifier() {
     if (_nsv->_activated) {
-      _nsv->_thread->_allow_allocation_count++;
       _nsv->_thread->_allow_safepoint_count++;
     }
   }
@@ -144,32 +140,4 @@
 #endif
 };
 
-// A NoAllocVerifier object can be placed in methods where one assumes that
-// no allocation will occur. The destructor will verify this property
-// unless the constructor is called with argument false (not activated).
-//
-// The check will only be done in debug mode and if activated.
-// Note: this only makes sense at safepoints (otherwise, other threads may
-// allocate concurrently.)
-
-class NoAllocVerifier : public StackObj {
- private:
-  bool  _activated;
-
- public:
-#ifdef ASSERT
-  NoAllocVerifier(bool activated = true) {
-    _activated = activated;
-    if (_activated) Thread::current()->_allow_allocation_count++;
-  }
-
-  ~NoAllocVerifier() {
-    if (_activated) Thread::current()->_allow_allocation_count--;
-  }
-#else
-  NoAllocVerifier(bool activated = true) {}
-  ~NoAllocVerifier() {}
-#endif
-};
-
 #endif // SHARE_RUNTIME_SAFEPOINTVERIFIERS_HPP