8372610: G1: JDK-8297692 broke code roots scan measurements

Reviewed-by: iwalulya, sjohanss
This commit is contained in:
Thomas Schatzl 2025-12-01 11:28:22 +00:00
parent 5bd7db034a
commit 160148cc7b

View File

@ -611,23 +611,24 @@ void G1RemSet::scan_collection_set_code_roots(G1ParScanThreadState* pss,
G1GCPhaseTimes::GCParPhases coderoots_phase,
G1GCPhaseTimes::GCParPhases objcopy_phase) {
EventGCPhaseParallel event;
Tickspan code_root_scan_time;
Tickspan code_root_trim_partially_time;
G1EvacPhaseWithTrimTimeTracker timer(pss, code_root_scan_time, code_root_trim_partially_time);
G1GCPhaseTimes* p = _g1h->phase_times();
{
G1EvacPhaseWithTrimTimeTracker timer(pss, code_root_scan_time, code_root_trim_partially_time);
G1ScanCodeRootsClosure cl(_scan_state, pss, worker_id);
// Code roots work distribution occurs inside the iteration method. So scan all collection
// set regions for all threads.
_g1h->collection_set_iterate_increment_from(&cl, worker_id);
G1ScanCodeRootsClosure cl(_scan_state, pss, worker_id);
// Code roots work distribution occurs inside the iteration method. So scan all collection
// set regions for all threads.
_g1h->collection_set_iterate_increment_from(&cl, worker_id);
p->record_or_add_thread_work_item(coderoots_phase, worker_id, cl.code_roots_scanned(), G1GCPhaseTimes::CodeRootsScannedNMethods);
}
p->record_or_add_time_secs(coderoots_phase, worker_id, code_root_scan_time.seconds());
p->add_time_secs(objcopy_phase, worker_id, code_root_trim_partially_time.seconds());
p->record_or_add_thread_work_item(coderoots_phase, worker_id, cl.code_roots_scanned(), G1GCPhaseTimes::CodeRootsScannedNMethods);
event.commit(GCId::current(), worker_id, G1GCPhaseTimes::phase_name(coderoots_phase));
}