8211950: Deprecate the check if a JVMTI collector is present assertion
authorjcbeyler
Wed, 10 Oct 2018 08:26:49 -0700
changeset 52077 b6eaf7b7cd7f
parent 52076 f8626bcc1698
child 52078 4a63197816ce
8211950: Deprecate the check if a JVMTI collector is present assertion Summary: Deprecate assertion that a collector is there; it is now a nop Reviewed-by: eosterlund, phh, pliden
src/hotspot/share/gc/shared/memAllocator.cpp
src/hotspot/share/runtime/threadHeapSampler.cpp
src/hotspot/share/runtime/threadHeapSampler.hpp
--- a/src/hotspot/share/gc/shared/memAllocator.cpp	Wed Oct 10 10:18:52 2018 -0400
+++ b/src/hotspot/share/gc/shared/memAllocator.cpp	Wed Oct 10 08:26:49 2018 -0700
@@ -198,15 +198,6 @@
     return;
   }
 
-  assert(JavaThread::current()->heap_sampler().add_sampling_collector(),
-         "Should never return false.");
-
-  // Only check if the sampler could actually sample something in this path.
-  assert(!JvmtiExport::should_post_sampled_object_alloc() ||
-         !JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample() ||
-         _thread->heap_sampler().sampling_collector_present(),
-         "Sampling collector not present.");
-
   if (JvmtiExport::should_post_sampled_object_alloc()) {
     // If we want to be sampling, protect the allocated object with a Handle
     // before doing the callback. The callback is done in the destructor of
@@ -219,8 +210,6 @@
     _thread->heap_sampler().check_for_sampling(obj_h(), size_in_bytes, bytes_since_last);
   }
 
-  assert(JavaThread::current()->heap_sampler().remove_sampling_collector(), "Should never return false.");
-
   if (_tlab_end_reset_for_sample || _allocated_tlab_size != 0) {
     _thread->tlab().set_sample_end();
   }
--- a/src/hotspot/share/runtime/threadHeapSampler.cpp	Wed Oct 10 10:18:52 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.cpp	Wed Oct 10 08:26:49 2018 -0700
@@ -171,20 +171,3 @@
 void ThreadHeapSampler::set_sampling_interval(int sampling_interval) {
   OrderAccess::release_store(&_sampling_interval, sampling_interval);
 }
-
-// Methods used in assertion mode to check if a collector is present or not at
-// the moment of TLAB sampling, ie a slow allocation path.
-bool ThreadHeapSampler::sampling_collector_present() const {
-  return _collectors_present > 0;
-}
-
-bool ThreadHeapSampler::remove_sampling_collector() {
-  assert(_collectors_present > 0, "Problem with collector counter.");
-  _collectors_present--;
-  return true;
-}
-
-bool ThreadHeapSampler::add_sampling_collector() {
-  _collectors_present++;
-  return true;
-}
--- a/src/hotspot/share/runtime/threadHeapSampler.hpp	Wed Oct 10 10:18:52 2018 -0400
+++ b/src/hotspot/share/runtime/threadHeapSampler.hpp	Wed Oct 10 08:26:49 2018 -0700
@@ -66,10 +66,6 @@
 
   static void set_sampling_interval(int sampling_interval);
   static int get_sampling_interval();
-
-  bool sampling_collector_present() const;
-  bool remove_sampling_collector();
-  bool add_sampling_collector();
 };
 
 #endif // SHARE_RUNTIME_THREADHEAPSAMPLER_HPP