8236681: Shenandoah: Disable concurrent class unloading flag if no class unloading for the GC cycle

Reviewed-by: rkennke
This commit is contained in:
Zhengyu Gu 2020-01-07 08:53:37 -05:00
parent ffe68bcb24
commit ee5729ac21

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, Red Hat, Inc. All rights reserved.
* Copyright (c) 2019, 2020, Red Hat, Inc. All rights reserved.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
@ -47,6 +47,8 @@ bool ShenandoahConcurrentRoots::can_do_concurrent_class_unloading() {
}
bool ShenandoahConcurrentRoots::should_do_concurrent_class_unloading() {
ShenandoahHeap* const heap = ShenandoahHeap::heap();
return can_do_concurrent_class_unloading() &&
!ShenandoahHeap::heap()->is_stw_gc_in_progress();
heap->unload_classes() &&
!heap->is_stw_gc_in_progress();
}