588
589 void ParNewGenTask::work(uint worker_id) {
590 GenCollectedHeap* gch = GenCollectedHeap::heap();
591 // Since this is being done in a separate thread, need new resource
592 // and handle marks.
593 ResourceMark rm;
594 HandleMark hm;
595
596 ParScanThreadState& par_scan_state = _state_set->thread_state(worker_id);
597 assert(_state_set->is_valid(worker_id), "Should not have been called");
598
599 par_scan_state.set_young_old_boundary(_young_old_boundary);
600
601 KlassScanClosure klass_scan_closure(&par_scan_state.to_space_root_closure(),
602 gch->rem_set()->klass_rem_set());
603 CLDToKlassAndOopClosure cld_scan_closure(&klass_scan_closure,
604 &par_scan_state.to_space_root_closure(),
605 false);
606
607 par_scan_state.start_strong_roots();
608 gch->gen_process_roots(_strong_roots_scope,
609 GenCollectedHeap::YoungGen,
610 true, // Process younger gens, if any, as strong roots.
611 GenCollectedHeap::SO_ScavengeCodeCache,
612 GenCollectedHeap::StrongAndWeakRoots,
613 &par_scan_state.to_space_root_closure(),
614 &par_scan_state.older_gen_closure(),
615 &cld_scan_closure);
616
617 par_scan_state.end_strong_roots();
618
619 // "evacuate followers".
620 par_scan_state.evacuate_followers_closure().do_void();
621
622 // This will collapse this worker's promoted object list that's
623 // created during the main ParNew parallel phase of ParNew. This has
624 // to be called after all workers have finished promoting objects
625 // and scanning promoted objects. It should be safe calling it from
626 // here, given that we can only reach here after all thread have
627 // offered termination, i.e., after there is no more work to be
628 // done. It will also disable promotion tracking for the rest of
629 // this GC as it's not necessary to be on during reference processing.
630 _old_gen->par_oop_since_save_marks_iterate_done((int) worker_id);
631 }
632
|
588
589 void ParNewGenTask::work(uint worker_id) {
590 GenCollectedHeap* gch = GenCollectedHeap::heap();
591 // Since this is being done in a separate thread, need new resource
592 // and handle marks.
593 ResourceMark rm;
594 HandleMark hm;
595
596 ParScanThreadState& par_scan_state = _state_set->thread_state(worker_id);
597 assert(_state_set->is_valid(worker_id), "Should not have been called");
598
599 par_scan_state.set_young_old_boundary(_young_old_boundary);
600
601 KlassScanClosure klass_scan_closure(&par_scan_state.to_space_root_closure(),
602 gch->rem_set()->klass_rem_set());
603 CLDToKlassAndOopClosure cld_scan_closure(&klass_scan_closure,
604 &par_scan_state.to_space_root_closure(),
605 false);
606
607 par_scan_state.start_strong_roots();
608 gch->young_process_roots(_strong_roots_scope,
609 &par_scan_state.to_space_root_closure(),
610 &par_scan_state.older_gen_closure(),
611 &cld_scan_closure);
612
613 par_scan_state.end_strong_roots();
614
615 // "evacuate followers".
616 par_scan_state.evacuate_followers_closure().do_void();
617
618 // This will collapse this worker's promoted object list that's
619 // created during the main ParNew parallel phase of ParNew. This has
620 // to be called after all workers have finished promoting objects
621 // and scanning promoted objects. It should be safe calling it from
622 // here, given that we can only reach here after all thread have
623 // offered termination, i.e., after there is no more work to be
624 // done. It will also disable promotion tracking for the rest of
625 // this GC as it's not necessary to be on during reference processing.
626 _old_gen->par_oop_since_save_marks_iterate_done((int) worker_id);
627 }
628
|