1.1 --- a/src/share/vm/jfr/leakprofiler/stopOperation.hpp Fri Sep 27 13:23:32 2019 +0800 1.2 +++ b/src/share/vm/jfr/leakprofiler/stopOperation.hpp Wed Oct 09 16:11:58 2019 +0800 1.3 @@ -25,30 +25,14 @@ 1.4 #ifndef SHARE_VM_LEAKPROFILER_STOPOPERATION_HPP 1.5 #define SHARE_VM_LEAKPROFILER_STOPOPERATION_HPP 1.6 1.7 -#include "jfr/leakprofiler/leakProfiler.hpp" 1.8 #include "jfr/leakprofiler/sampling/objectSampler.hpp" 1.9 -#include "jfr/recorder/service/jfrOptionSet.hpp" 1.10 -#include "runtime/vm_operations.hpp" 1.11 +#include "jfr/leakprofiler/utilities/vmOperation.hpp" 1.12 1.13 -// Safepoint operation for stopping leak profiler object sampler 1.14 -class StopOperation : public VM_Operation { 1.15 +// Safepoint operation for stopping and destroying the leak profiler object sampler 1.16 +class StopOperation : public OldObjectVMOperation { 1.17 public: 1.18 - StopOperation() {} 1.19 - 1.20 - Mode evaluation_mode() const { 1.21 - return _safepoint; 1.22 - } 1.23 - 1.24 - VMOp_Type type() const { 1.25 - return VMOp_GC_HeapInspection; 1.26 - } 1.27 - 1.28 virtual void doit() { 1.29 - assert(LeakProfiler::is_running(), "invariant"); 1.30 - ObjectSampler* object_sampler = LeakProfiler::object_sampler(); 1.31 - delete object_sampler; 1.32 - LeakProfiler::set_object_sampler(NULL); 1.33 - if (LogJFR && Verbose) tty->print_cr( "Object sampling stopped"); 1.34 + ObjectSampler::destroy(); 1.35 } 1.36 }; 1.37