27 #include "classfile/classLoaderDataGraph.hpp" |
27 #include "classfile/classLoaderDataGraph.hpp" |
28 #include "classfile/stringTable.hpp" |
28 #include "classfile/stringTable.hpp" |
29 #include "gc/shared/strongRootsScope.hpp" |
29 #include "gc/shared/strongRootsScope.hpp" |
30 #include "jfr/leakprofiler/utilities/unifiedOop.hpp" |
30 #include "jfr/leakprofiler/utilities/unifiedOop.hpp" |
31 #include "jfr/leakprofiler/checkpoint/rootResolver.hpp" |
31 #include "jfr/leakprofiler/checkpoint/rootResolver.hpp" |
|
32 #include "jfr/utilities/jfrThreadIterator.hpp" |
32 #include "memory/iterator.hpp" |
33 #include "memory/iterator.hpp" |
33 #include "memory/universe.hpp" |
34 #include "memory/universe.hpp" |
34 #include "oops/klass.hpp" |
35 #include "oops/klass.hpp" |
35 #include "oops/oop.hpp" |
36 #include "oops/oop.hpp" |
36 #include "prims/jvmtiThreadState.hpp" |
37 #include "prims/jvmtiThreadState.hpp" |
37 #include "runtime/frame.inline.hpp" |
38 #include "runtime/frame.inline.hpp" |
38 #include "runtime/mutexLocker.hpp" |
39 #include "runtime/mutexLocker.hpp" |
39 #include "runtime/threadSMR.inline.hpp" |
|
40 #include "runtime/vframe_hp.hpp" |
40 #include "runtime/vframe_hp.hpp" |
41 #include "services/management.hpp" |
41 #include "services/management.hpp" |
42 #include "utilities/growableArray.hpp" |
42 #include "utilities/growableArray.hpp" |
43 |
43 |
44 class ReferenceLocateClosure : public OopClosure { |
44 class ReferenceLocateClosure : public OopClosure { |
254 bool do_thread_handle_area(JavaThread* jt); |
254 bool do_thread_handle_area(JavaThread* jt); |
255 |
255 |
256 public: |
256 public: |
257 ReferenceToThreadRootClosure(RootCallback& callback) :_callback(callback), _complete(false) { |
257 ReferenceToThreadRootClosure(RootCallback& callback) :_callback(callback), _complete(false) { |
258 assert_locked_or_safepoint(Threads_lock); |
258 assert_locked_or_safepoint(Threads_lock); |
259 for (JavaThreadIteratorWithHandle jtiwh; JavaThread *jt = jtiwh.next(); ) { |
259 JfrJavaThreadIterator iter; |
260 if (do_thread_roots(jt)) { |
260 while (iter.has_next()) { |
|
261 if (do_thread_roots(iter.next())) { |
261 return; |
262 return; |
262 } |
263 } |
263 } |
264 } |
264 } |
265 } |
265 |
266 |