# HG changeset patch # User jcbeyler # Date 1539112188 25200 # Tue Oct 09 12:09:48 2018 -0700 # Node ID 6ccf349e189293dfd15de9e4e19455b786a6bf07 # Parent 2630d51656aa8913914b5cca20bb1ea7d57de518 8211950: Deprecate the check if a JVMTI collector is present assertion Summary: Reviewed-by: diff --git a/src/hotspot/share/gc/shared/memAllocator.cpp b/src/hotspot/share/gc/shared/memAllocator.cpp --- a/src/hotspot/share/gc/shared/memAllocator.cpp +++ b/src/hotspot/share/gc/shared/memAllocator.cpp @@ -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(); } diff --git a/src/hotspot/share/runtime/threadHeapSampler.cpp b/src/hotspot/share/runtime/threadHeapSampler.cpp --- a/src/hotspot/share/runtime/threadHeapSampler.cpp +++ b/src/hotspot/share/runtime/threadHeapSampler.cpp @@ -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; -} diff --git a/src/hotspot/share/runtime/threadHeapSampler.hpp b/src/hotspot/share/runtime/threadHeapSampler.hpp --- a/src/hotspot/share/runtime/threadHeapSampler.hpp +++ b/src/hotspot/share/runtime/threadHeapSampler.hpp @@ -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