mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-16 10:53:31 +00:00
8211950: Deprecate the check if a JVMTI collector is present assertion
Deprecate assertion that a collector is there; it is now a nop Reviewed-by: eosterlund, phh, pliden
This commit is contained in:
parent
8c62c2e33a
commit
6ca3b39823
@ -198,15 +198,6 @@ void MemAllocator::Allocation::notify_allocation_jvmti_sampler() {
|
||||
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 @@ void MemAllocator::Allocation::notify_allocation_jvmti_sampler() {
|
||||
_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();
|
||||
}
|
||||
|
||||
@ -171,20 +171,3 @@ int ThreadHeapSampler::get_sampling_interval() {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -66,10 +66,6 @@ class ThreadHeapSampler {
|
||||
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user