< prev index next >

src/share/vm/gc_implementation/g1/g1RootProcessor.cpp

Print this page




 236 void G1RootProcessor::process_java_roots(OopClosure* strong_roots,
 237                                          CLDClosure* thread_stack_clds,
 238                                          CLDClosure* strong_clds,
 239                                          CLDClosure* weak_clds,
 240                                          CodeBlobClosure* strong_code,
 241                                          G1GCPhaseTimes* phase_times,
 242                                          uint worker_i) {
 243   assert(thread_stack_clds == NULL || weak_clds == NULL, "There is overlap between those, only one may be set");
 244   // Iterating over the CLDG and the Threads are done early to allow us to
 245   // first process the strong CLDs and nmethods and then, after a barrier,
 246   // let the thread process the weak CLDs and nmethods.
 247   {
 248     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
 249     if (!_process_strong_tasks->is_task_claimed(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
 250       ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds);
 251     }
 252   }
 253 
 254   {
 255     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
 256     Threads::possibly_parallel_oops_do(strong_roots, thread_stack_clds, strong_code);

 257   }
 258 }
 259 
 260 void G1RootProcessor::process_vm_roots(OopClosure* strong_roots,
 261                                        OopClosure* weak_roots,
 262                                        G1GCPhaseTimes* phase_times,
 263                                        uint worker_i) {
 264   {
 265     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_i);
 266     if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Universe_oops_do)) {
 267       Universe::oops_do(strong_roots);
 268     }
 269   }
 270 
 271   {
 272     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_i);
 273     if (!_process_strong_tasks->is_task_claimed(G1RP_PS_JNIHandles_oops_do)) {
 274       JNIHandles::oops_do(strong_roots);
 275     }
 276   }




 236 void G1RootProcessor::process_java_roots(OopClosure* strong_roots,
 237                                          CLDClosure* thread_stack_clds,
 238                                          CLDClosure* strong_clds,
 239                                          CLDClosure* weak_clds,
 240                                          CodeBlobClosure* strong_code,
 241                                          G1GCPhaseTimes* phase_times,
 242                                          uint worker_i) {
 243   assert(thread_stack_clds == NULL || weak_clds == NULL, "There is overlap between those, only one may be set");
 244   // Iterating over the CLDG and the Threads are done early to allow us to
 245   // first process the strong CLDs and nmethods and then, after a barrier,
 246   // let the thread process the weak CLDs and nmethods.
 247   {
 248     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::CLDGRoots, worker_i);
 249     if (!_process_strong_tasks->is_task_claimed(G1RP_PS_ClassLoaderDataGraph_oops_do)) {
 250       ClassLoaderDataGraph::roots_cld_do(strong_clds, weak_clds);
 251     }
 252   }
 253 
 254   {
 255     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::ThreadRoots, worker_i);
 256     bool is_par = _g1h->n_par_threads() > 0;
 257     Threads::possibly_parallel_oops_do(is_par, strong_roots, thread_stack_clds, strong_code);
 258   }
 259 }
 260 
 261 void G1RootProcessor::process_vm_roots(OopClosure* strong_roots,
 262                                        OopClosure* weak_roots,
 263                                        G1GCPhaseTimes* phase_times,
 264                                        uint worker_i) {
 265   {
 266     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::UniverseRoots, worker_i);
 267     if (!_process_strong_tasks->is_task_claimed(G1RP_PS_Universe_oops_do)) {
 268       Universe::oops_do(strong_roots);
 269     }
 270   }
 271 
 272   {
 273     G1GCParPhaseTimesTracker x(phase_times, G1GCPhaseTimes::JNIRoots, worker_i);
 274     if (!_process_strong_tasks->is_task_claimed(G1RP_PS_JNIHandles_oops_do)) {
 275       JNIHandles::oops_do(strong_roots);
 276     }
 277   }


< prev index next >