--- old/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-04-27 10:19:35.775186016 +0200 +++ new/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2020-04-27 10:19:35.587182956 +0200 @@ -160,9 +160,13 @@ reset_from_card_cache(start_idx, num_regions); } -Tickspan G1CollectedHeap::run_task(AbstractGangTask* task) { - Ticks start = Ticks::now(); +void G1CollectedHeap::run_task(AbstractGangTask* task) { workers()->run_task(task, workers()->active_workers()); +} + +Tickspan G1CollectedHeap::run_task_timed(AbstractGangTask* task) { + Ticks start = Ticks::now(); + run_task(task); return Ticks::now() - start; } @@ -3767,7 +3771,7 @@ { G1PrepareEvacuationTask g1_prep_task(this); - Tickspan task_time = run_task(&g1_prep_task); + Tickspan task_time = run_task_timed(&g1_prep_task); phase_times()->record_register_regions(task_time.seconds() * 1000.0, g1_prep_task.humongous_total(), @@ -3914,7 +3918,7 @@ { G1RootProcessor root_processor(this, num_workers); G1EvacuateRegionsTask g1_par_task(this, per_thread_states, _task_queues, &root_processor, num_workers); - task_time = run_task(&g1_par_task); + task_time = run_task_timed(&g1_par_task); // Closing the inner scope will execute the destructor for the G1RootProcessor object. // To extract its code root fixup time we measure total time of this scope and // subtract from the time the WorkGang task took. @@ -3953,7 +3957,7 @@ { G1MarkScope code_mark_scope; G1EvacuateOptionalRegionsTask task(per_thread_states, _task_queues, workers()->active_workers()); - task_time = run_task(&task); + task_time = run_task_timed(&task); // See comment in evacuate_collection_set() for the reason of the scope. } Tickspan total_processing = Ticks::now() - start_processing;