8254315: Shenandoah: Concurrent weak reference processing

Reviewed-by: zgu, shade
This commit is contained in:
Roman Kennke 2020-11-03 18:58:46 +00:00
parent 83f3cf4298
commit f64a15d62e
55 changed files with 1864 additions and 802 deletions

View file

@ -141,7 +141,6 @@ void ShenandoahControlThread::run_service() {
policy->record_explicit_to_concurrent();
mode = default_mode;
// Unload and clean up everything
heap->set_process_references(heuristics->can_process_references());
heap->set_unload_classes(heuristics->can_unload_classes());
} else {
policy->record_explicit_to_full();
@ -158,7 +157,6 @@ void ShenandoahControlThread::run_service() {
mode = default_mode;
// Unload and clean up everything
heap->set_process_references(heuristics->can_process_references());
heap->set_unload_classes(heuristics->can_unload_classes());
} else {
policy->record_implicit_to_full();
@ -172,7 +170,6 @@ void ShenandoahControlThread::run_service() {
}
// Ask policy if this cycle wants to process references or unload classes
heap->set_process_references(heuristics->should_process_references());
heap->set_unload_classes(heuristics->should_unload_classes());
}
@ -404,14 +401,12 @@ void ShenandoahControlThread::service_concurrent_normal_cycle(GCCause::Cause cau
heap->entry_mark();
if (check_cancellation_or_degen(ShenandoahHeap::_degenerated_mark)) return;
// If not cancelled, can try to concurrently pre-clean
heap->entry_preclean();
// Complete marking under STW, and start evacuation
heap->vmop_entry_final_mark();
// Process weak roots that might still point to regions that would be broken by cleanup
if (heap->is_concurrent_weak_root_in_progress()) {
heap->entry_weak_refs();
heap->entry_weak_roots();
}