60 volatile bool _claimed;
61
62 public:
63 ZSerialWeakOopsDo(T* iter);
64 void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl);
65 };
66
67 template <typename T, void (T::*F)(BoolObjectClosure*, OopClosure*)>
68 class ZParallelWeakOopsDo {
69 private:
70 T* const _iter;
71 volatile bool _completed;
72
73 public:
74 ZParallelWeakOopsDo(T* iter);
75 void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl);
76 };
77
78 class ZRootsIterator {
79 private:
80 ZOopStorageIterator _vm_weak_handles_iter;
81 ZOopStorageIterator _jni_handles_iter;
82 ZOopStorageIterator _jni_weak_handles_iter;
83 ZOopStorageIterator _string_table_iter;
84
85 void do_universe(OopClosure* cl);
86 void do_vm_weak_handles(OopClosure* cl);
87 void do_jni_handles(OopClosure* cl);
88 void do_jni_weak_handles(OopClosure* cl);
89 void do_object_synchronizer(OopClosure* cl);
90 void do_management(OopClosure* cl);
91 void do_jvmti_export(OopClosure* cl);
92 void do_jvmti_weak_export(OopClosure* cl);
93 void do_jfr_weak(OopClosure* cl);
94 void do_system_dictionary(OopClosure* cl);
95 void do_class_loader_data_graph(OopClosure* cl);
96 void do_threads(OopClosure* cl);
97 void do_code_cache(OopClosure* cl);
98 void do_string_table(OopClosure* cl);
99
100 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_universe> _universe;
101 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_object_synchronizer> _object_synchronizer;
102 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_management> _management;
103 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_export> _jvmti_export;
104 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
105 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jfr_weak> _jfr_weak;
106 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_system_dictionary> _system_dictionary;
107 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_vm_weak_handles> _vm_weak_handles;
108 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_jni_handles> _jni_handles;
109 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_jni_weak_handles> _jni_weak_handles;
110 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_class_loader_data_graph> _class_loader_data_graph;
111 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_threads> _threads;
112 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_code_cache> _code_cache;
113 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_string_table> _string_table;
114
115 public:
116 ZRootsIterator();
117 ~ZRootsIterator();
118
119 void oops_do(OopClosure* cl, bool visit_jvmti_weak_export = false);
120 };
121
122 class ZWeakRootsIterator {
123 private:
124 ZOopStorageIterator _vm_weak_handles_iter;
125 ZOopStorageIterator _jni_weak_handles_iter;
126 ZOopStorageIterator _string_table_iter;
127
128 void do_vm_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
129 void do_jni_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
130 void do_jvmti_weak_export(BoolObjectClosure* is_alive, OopClosure* cl);
131 void do_jfr_weak(BoolObjectClosure* is_alive, OopClosure* cl);
132 void do_string_table(BoolObjectClosure* is_alive, OopClosure* cl);
133
134 ZSerialWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
135 ZSerialWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jfr_weak> _jfr_weak;
|
60 volatile bool _claimed;
61
62 public:
63 ZSerialWeakOopsDo(T* iter);
64 void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl);
65 };
66
67 template <typename T, void (T::*F)(BoolObjectClosure*, OopClosure*)>
68 class ZParallelWeakOopsDo {
69 private:
70 T* const _iter;
71 volatile bool _completed;
72
73 public:
74 ZParallelWeakOopsDo(T* iter);
75 void weak_oops_do(BoolObjectClosure* is_alive, OopClosure* cl);
76 };
77
78 class ZRootsIterator {
79 private:
80 bool _strong_only;
81 ZOopStorageIterator _vm_weak_handles_iter;
82 ZOopStorageIterator _jni_handles_iter;
83 ZOopStorageIterator _jni_weak_handles_iter;
84 ZOopStorageIterator _string_table_iter;
85
86 void do_universe(OopClosure* cl);
87 void do_vm_weak_handles(OopClosure* cl);
88 void do_jni_handles(OopClosure* cl);
89 void do_jni_weak_handles(OopClosure* cl);
90 void do_object_synchronizer(OopClosure* cl);
91 void do_management(OopClosure* cl);
92 void do_jvmti_export(OopClosure* cl);
93 void do_jvmti_weak_export(OopClosure* cl);
94 void do_jfr_weak(OopClosure* cl);
95 void do_system_dictionary(OopClosure* cl);
96 void do_class_loader_data_graph(OopClosure* cl);
97 void do_class_loader_data_graph_strong_only(OopClosure* cl);
98 void do_threads(OopClosure* cl);
99 void do_code_cache(OopClosure* cl);
100 void do_string_table(OopClosure* cl);
101
102 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_universe> _universe;
103 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_object_synchronizer> _object_synchronizer;
104 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_management> _management;
105 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_export> _jvmti_export;
106 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
107 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_jfr_weak> _jfr_weak;
108 ZSerialOopsDo<ZRootsIterator, &ZRootsIterator::do_system_dictionary> _system_dictionary;
109 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_vm_weak_handles> _vm_weak_handles;
110 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_jni_handles> _jni_handles;
111 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_jni_weak_handles> _jni_weak_handles;
112 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_class_loader_data_graph> _class_loader_data_graph;
113 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_class_loader_data_graph_strong_only> _class_loader_data_graph_strong_only;
114 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_threads> _threads;
115 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_code_cache> _code_cache;
116 ZParallelOopsDo<ZRootsIterator, &ZRootsIterator::do_string_table> _string_table;
117
118 public:
119 ZRootsIterator(bool strong_only);
120 ~ZRootsIterator();
121
122 void oops_do(OopClosure* cl, bool visit_jvmti_weak_export = false);
123 };
124
125 class ZWeakRootsIterator {
126 private:
127 ZOopStorageIterator _vm_weak_handles_iter;
128 ZOopStorageIterator _jni_weak_handles_iter;
129 ZOopStorageIterator _string_table_iter;
130
131 void do_vm_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
132 void do_jni_weak_handles(BoolObjectClosure* is_alive, OopClosure* cl);
133 void do_jvmti_weak_export(BoolObjectClosure* is_alive, OopClosure* cl);
134 void do_jfr_weak(BoolObjectClosure* is_alive, OopClosure* cl);
135 void do_string_table(BoolObjectClosure* is_alive, OopClosure* cl);
136
137 ZSerialWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jvmti_weak_export> _jvmti_weak_export;
138 ZSerialWeakOopsDo<ZWeakRootsIterator, &ZWeakRootsIterator::do_jfr_weak> _jfr_weak;
|