Skip to content

Commit 160148c

Browse files
author
Thomas Schatzl
committed
8372610: G1: JDK-8297692 broke code roots scan measurements
Reviewed-by: iwalulya, sjohanss
1 parent 5bd7db0 commit 160148c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

src/hotspot/share/gc/g1/g1RemSet.cpp

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -611,23 +611,24 @@ void G1RemSet::scan_collection_set_code_roots(G1ParScanThreadState* pss,
611611
G1GCPhaseTimes::GCParPhases coderoots_phase,
612612
G1GCPhaseTimes::GCParPhases objcopy_phase) {
613613
EventGCPhaseParallel event;
614-
615614
Tickspan code_root_scan_time;
616615
Tickspan code_root_trim_partially_time;
617-
G1EvacPhaseWithTrimTimeTracker timer(pss, code_root_scan_time, code_root_trim_partially_time);
618616

619617
G1GCPhaseTimes* p = _g1h->phase_times();
618+
{
619+
G1EvacPhaseWithTrimTimeTracker timer(pss, code_root_scan_time, code_root_trim_partially_time);
620620

621-
G1ScanCodeRootsClosure cl(_scan_state, pss, worker_id);
622-
// Code roots work distribution occurs inside the iteration method. So scan all collection
623-
// set regions for all threads.
624-
_g1h->collection_set_iterate_increment_from(&cl, worker_id);
621+
G1ScanCodeRootsClosure cl(_scan_state, pss, worker_id);
622+
// Code roots work distribution occurs inside the iteration method. So scan all collection
623+
// set regions for all threads.
624+
_g1h->collection_set_iterate_increment_from(&cl, worker_id);
625+
626+
p->record_or_add_thread_work_item(coderoots_phase, worker_id, cl.code_roots_scanned(), G1GCPhaseTimes::CodeRootsScannedNMethods);
627+
}
625628

626629
p->record_or_add_time_secs(coderoots_phase, worker_id, code_root_scan_time.seconds());
627630
p->add_time_secs(objcopy_phase, worker_id, code_root_trim_partially_time.seconds());
628631

629-
p->record_or_add_thread_work_item(coderoots_phase, worker_id, cl.code_roots_scanned(), G1GCPhaseTimes::CodeRootsScannedNMethods);
630-
631632
event.commit(GCId::current(), worker_id, G1GCPhaseTimes::phase_name(coderoots_phase));
632633
}
633634

0 commit comments

Comments
 (0)