137 bool is_scavenging, 138 ScanningOption so, 139 OopClosure* roots, 140 CodeBlobClosure* code_roots, 141 KlassClosure* klass_closure) { 142 StrongRootsScope srs(this, activate_scope); 143 144 // General strong roots. 145 assert(_strong_roots_parity != 0, "must have called prologue code"); 146 // _n_termination for _process_strong_tasks should be set up stream 147 // in a method not running in a GC worker. Otherwise the GC worker 148 // could be trying to change the termination condition while the task 149 // is executing in another GC worker. 150 if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) { 151 Universe::oops_do(roots); 152 } 153 // Global (strong) JNI handles 154 if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do)) 155 JNIHandles::oops_do(roots); 156 // All threads execute this; the individual threads are task groups. 157 if (ParallelGCThreads > 0) { 158 Threads::possibly_parallel_oops_do(roots, code_roots); 159 } else { 160 Threads::oops_do(roots, code_roots); 161 } 162 if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do)) 163 ObjectSynchronizer::oops_do(roots); 164 if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do)) 165 FlatProfiler::oops_do(roots); 166 if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do)) 167 Management::oops_do(roots); 168 if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do)) 169 JvmtiExport::oops_do(roots); 170 171 if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) { 172 if (so & SO_AllClasses) { 173 SystemDictionary::oops_do(roots); 174 ClassLoaderDataGraph::oops_do(roots, klass_closure, !is_scavenging); 175 } else if (so & SO_SystemClasses) { 176 SystemDictionary::always_strong_oops_do(roots); 177 ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging); 178 } else { 179 ShouldNotReachHere2("We should always have selected either SO_AllClasses or SO_SystemClasses"); 180 } | 137 bool is_scavenging, 138 ScanningOption so, 139 OopClosure* roots, 140 CodeBlobClosure* code_roots, 141 KlassClosure* klass_closure) { 142 StrongRootsScope srs(this, activate_scope); 143 144 // General strong roots. 145 assert(_strong_roots_parity != 0, "must have called prologue code"); 146 // _n_termination for _process_strong_tasks should be set up stream 147 // in a method not running in a GC worker. Otherwise the GC worker 148 // could be trying to change the termination condition while the task 149 // is executing in another GC worker. 150 if (!_process_strong_tasks->is_task_claimed(SH_PS_Universe_oops_do)) { 151 Universe::oops_do(roots); 152 } 153 // Global (strong) JNI handles 154 if (!_process_strong_tasks->is_task_claimed(SH_PS_JNIHandles_oops_do)) 155 JNIHandles::oops_do(roots); 156 // All threads execute this; the individual threads are task groups. 157 CLDToOopClosure roots_from_clds(roots); 158 CLDToOopClosure* roots_from_clds_p = (is_scavenging ? NULL : &roots_from_clds); 159 if (ParallelGCThreads > 0) { 160 Threads::possibly_parallel_oops_do(roots, roots_from_clds_p ,code_roots); 161 } else { 162 Threads::oops_do(roots, roots_from_clds_p, code_roots); 163 } 164 if (!_process_strong_tasks-> is_task_claimed(SH_PS_ObjectSynchronizer_oops_do)) 165 ObjectSynchronizer::oops_do(roots); 166 if (!_process_strong_tasks->is_task_claimed(SH_PS_FlatProfiler_oops_do)) 167 FlatProfiler::oops_do(roots); 168 if (!_process_strong_tasks->is_task_claimed(SH_PS_Management_oops_do)) 169 Management::oops_do(roots); 170 if (!_process_strong_tasks->is_task_claimed(SH_PS_jvmti_oops_do)) 171 JvmtiExport::oops_do(roots); 172 173 if (!_process_strong_tasks->is_task_claimed(SH_PS_SystemDictionary_oops_do)) { 174 if (so & SO_AllClasses) { 175 SystemDictionary::oops_do(roots); 176 ClassLoaderDataGraph::oops_do(roots, klass_closure, !is_scavenging); 177 } else if (so & SO_SystemClasses) { 178 SystemDictionary::always_strong_oops_do(roots); 179 ClassLoaderDataGraph::always_strong_oops_do(roots, klass_closure, !is_scavenging); 180 } else { 181 ShouldNotReachHere2("We should always have selected either SO_AllClasses or SO_SystemClasses"); 182 } |