8202018: Move card table clear before enqueuing pending references

Move card table clearing in preparation of removal of the Reference enqueue phase.

Reviewed-by: sangheki, sjohanss
This commit is contained in:
Thomas Schatzl 2018-05-03 14:09:39 +02:00
parent 91ba4b5676
commit 73771f97e9
2 changed files with 7 additions and 13 deletions

View File

@ -4053,12 +4053,17 @@ void G1CollectedHeap::evacuate_collection_set(G1ParScanThreadStateSet* per_threa
}
void G1CollectedHeap::post_evacuate_collection_set(EvacuationInfo& evacuation_info, G1ParScanThreadStateSet* per_thread_states) {
// Also cleans the card table from temporary duplicate detection information used
// during UpdateRS/ScanRS.
g1_rem_set()->cleanup_after_oops_into_collection_set_do();
// Process any discovered reference objects - we have
// to do this _before_ we retire the GC alloc regions
// as we may have to copy some 'reachable' referent
// objects (and their reachable sub-graphs) that were
// not copied during the pause.
process_discovered_references(per_thread_states);
enqueue_discovered_references(per_thread_states);
G1STWIsAliveClosure is_alive(this);
G1KeepAliveClosure keep_alive(this);
@ -4081,8 +4086,6 @@ void G1CollectedHeap::post_evacuate_collection_set(EvacuationInfo& evacuation_in
g1_policy()->phase_times()->record_string_dedup_fixup_time(fixup_time_ms);
}
g1_rem_set()->cleanup_after_oops_into_collection_set_do();
if (evacuation_failed()) {
restore_after_evac_failure();
@ -4094,15 +4097,6 @@ void G1CollectedHeap::post_evacuate_collection_set(EvacuationInfo& evacuation_in
_preserved_marks_set.assert_empty();
// Enqueue any remaining references remaining on the STW
// reference processor's discovered lists. We need to do
// this after the card table is cleaned (and verified) as
// the act of enqueueing entries on to the pending list
// will log these updates (and dirty their associated
// cards). We need these updates logged to update any
// RSets.
enqueue_discovered_references(per_thread_states);
_allocator->release_gc_alloc_regions(evacuation_info);
merge_per_thread_state_info(per_thread_states);

View File

@ -397,6 +397,8 @@ double G1GCPhaseTimes::print_post_evacuate_collection_set() const {
debug_time("Code Roots Fixup", _cur_collection_code_root_fixup_time_ms);
debug_time("Clear Card Table", _cur_clear_ct_time_ms);
debug_time_for_reference("Reference Processing", _cur_ref_proc_time_ms);
_ref_phase_times.print_all_references(2, false);
@ -408,8 +410,6 @@ double G1GCPhaseTimes::print_post_evacuate_collection_set() const {
debug_phase(_gc_par_phases[StringDedupTableFixup]);
}
debug_time("Clear Card Table", _cur_clear_ct_time_ms);
if (G1CollectedHeap::heap()->evacuation_failed()) {
debug_time("Evacuation Failure", evac_fail_handling);
trace_time("Recalculate Used", _cur_evac_fail_recalc_used);