1024 // However that wouldn't be right, because it's possible that
1025 // a safepoint is indeed in progress as a younger generation
1026 // stop-the-world GC happens even as we mark in this generation.
1027
1028 _restart_for_overflow = false;
1029
1030 // _g1h has _n_par_threads
1031 _parallel_marking_threads = calc_parallel_marking_threads();
1032 assert(parallel_marking_threads() <= max_parallel_marking_threads(),
1033 "Maximum number of marking threads exceeded");
1034
1035 uint active_workers = MAX2(1U, parallel_marking_threads());
1036 assert(active_workers > 0, "Should have been set");
1037
1038 // Parallel task terminator is set in "set_concurrency_and_phase()"
1039 set_concurrency_and_phase(active_workers, true /* concurrent */);
1040
1041 CMConcurrentMarkingTask markingTask(this, cmThread());
1042 _parallel_workers->set_active_workers(active_workers);
1043 _parallel_workers->run_task(&markingTask);
1044
1045 print_stats();
1046 }
1047
1048 void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
1049 // world is stopped at this checkpoint
1050 assert(SafepointSynchronize::is_at_safepoint(),
1051 "world should be stopped");
1052
1053 G1CollectedHeap* g1h = G1CollectedHeap::heap();
1054
1055 // If a full collection has happened, we shouldn't do this.
1056 if (has_aborted()) {
1057 g1h->collector_state()->set_mark_in_progress(false); // So bitmap clearing isn't confused
1058 return;
1059 }
1060
1061 SvcGCMarker sgcm(SvcGCMarker::OTHER);
1062
1063 if (VerifyDuringGC) {
1064 HandleMark hm; // handle scope
|
1024 // However that wouldn't be right, because it's possible that
1025 // a safepoint is indeed in progress as a younger generation
1026 // stop-the-world GC happens even as we mark in this generation.
1027
1028 _restart_for_overflow = false;
1029
1030 // _g1h has _n_par_threads
1031 _parallel_marking_threads = calc_parallel_marking_threads();
1032 assert(parallel_marking_threads() <= max_parallel_marking_threads(),
1033 "Maximum number of marking threads exceeded");
1034
1035 uint active_workers = MAX2(1U, parallel_marking_threads());
1036 assert(active_workers > 0, "Should have been set");
1037
1038 // Parallel task terminator is set in "set_concurrency_and_phase()"
1039 set_concurrency_and_phase(active_workers, true /* concurrent */);
1040
1041 CMConcurrentMarkingTask markingTask(this, cmThread());
1042 _parallel_workers->set_active_workers(active_workers);
1043 _parallel_workers->run_task(&markingTask);
1044 print_stats();
1045 }
1046
1047 void ConcurrentMark::checkpointRootsFinal(bool clear_all_soft_refs) {
1048 // world is stopped at this checkpoint
1049 assert(SafepointSynchronize::is_at_safepoint(),
1050 "world should be stopped");
1051
1052 G1CollectedHeap* g1h = G1CollectedHeap::heap();
1053
1054 // If a full collection has happened, we shouldn't do this.
1055 if (has_aborted()) {
1056 g1h->collector_state()->set_mark_in_progress(false); // So bitmap clearing isn't confused
1057 return;
1058 }
1059
1060 SvcGCMarker sgcm(SvcGCMarker::OTHER);
1061
1062 if (VerifyDuringGC) {
1063 HandleMark hm; // handle scope
|