572 class AssertNonScavengableClosure: public OopClosure {
573 public:
574 virtual void do_oop(oop* p) {
575 assert(!Universe::heap()->is_in_partial_collection(*p),
576 "Referent should not be scavengable."); }
577 virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
578 };
579 static AssertNonScavengableClosure assert_is_non_scavengable_closure;
580 #endif
581
582 void GenCollectedHeap::process_roots(bool activate_scope,
583 ScanningOption so,
584 OopClosure* strong_roots,
585 OopClosure* weak_roots,
586 CLDClosure* strong_cld_closure,
587 CLDClosure* weak_cld_closure,
588 CodeBlobClosure* code_roots) {
589 StrongRootsScope srs(this, activate_scope);
590
591 // General roots.
592 assert(_strong_roots_parity != 0, "must have called prologue code");
593 assert(code_roots != NULL, "code root closure should always be set");
594 // _n_termination for _process_strong_tasks should be set up stream
595 // in a method not running in a GC worker. Otherwise the GC worker
596 // could be trying to change the termination condition while the task
597 // is executing in another GC worker.
598
599 if (!_process_strong_tasks->is_task_claimed(GCH_PS_ClassLoaderDataGraph_oops_do)) {
600 ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
601 }
602
603 // Some CLDs contained in the thread frames should be considered strong.
604 // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
605 CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
606 // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
607 CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
608
609 Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
610
611 if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
612 Universe::oops_do(strong_roots);
|
572 class AssertNonScavengableClosure: public OopClosure {
573 public:
574 virtual void do_oop(oop* p) {
575 assert(!Universe::heap()->is_in_partial_collection(*p),
576 "Referent should not be scavengable."); }
577 virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
578 };
579 static AssertNonScavengableClosure assert_is_non_scavengable_closure;
580 #endif
581
582 void GenCollectedHeap::process_roots(bool activate_scope,
583 ScanningOption so,
584 OopClosure* strong_roots,
585 OopClosure* weak_roots,
586 CLDClosure* strong_cld_closure,
587 CLDClosure* weak_cld_closure,
588 CodeBlobClosure* code_roots) {
589 StrongRootsScope srs(this, activate_scope);
590
591 // General roots.
592 assert(Threads::thread_claim_parity() != 0, "must have called prologue code");
593 assert(code_roots != NULL, "code root closure should always be set");
594 // _n_termination for _process_strong_tasks should be set up stream
595 // in a method not running in a GC worker. Otherwise the GC worker
596 // could be trying to change the termination condition while the task
597 // is executing in another GC worker.
598
599 if (!_process_strong_tasks->is_task_claimed(GCH_PS_ClassLoaderDataGraph_oops_do)) {
600 ClassLoaderDataGraph::roots_cld_do(strong_cld_closure, weak_cld_closure);
601 }
602
603 // Some CLDs contained in the thread frames should be considered strong.
604 // Don't process them if they will be processed during the ClassLoaderDataGraph phase.
605 CLDClosure* roots_from_clds_p = (strong_cld_closure != weak_cld_closure) ? strong_cld_closure : NULL;
606 // Only process code roots from thread stacks if we aren't visiting the entire CodeCache anyway
607 CodeBlobClosure* roots_from_code_p = (so & SO_AllCodeCache) ? NULL : code_roots;
608
609 Threads::possibly_parallel_oops_do(strong_roots, roots_from_clds_p, roots_from_code_p);
610
611 if (!_process_strong_tasks->is_task_claimed(GCH_PS_Universe_oops_do)) {
612 Universe::oops_do(strong_roots);
|