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