8246458: Shenandoah: TestAllocObjects.java test fail with -XX:+ShenandoahVerify

Reviewed-by: shade
This commit is contained in:
Zhengyu Gu 2020-06-03 12:09:04 -04:00
parent f1e1cb7055
commit d9fc44540e

View File

@ -1589,17 +1589,20 @@ void ShenandoahHeap::op_final_mark() {
}
if (ShenandoahVerify) {
ShenandoahRootVerifier::RootTypes types = ShenandoahRootVerifier::None;
if (ShenandoahConcurrentRoots::should_do_concurrent_roots()) {
types = ShenandoahRootVerifier::combine(ShenandoahRootVerifier::JNIHandleRoots, ShenandoahRootVerifier::WeakRoots);
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::CLDGRoots);
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::StringDedupRoots);
}
// If OOM while evacuating/updating of roots, there is no guarantee of their consistencies
if (!cancelled_gc()) {
ShenandoahRootVerifier::RootTypes types = ShenandoahRootVerifier::None;
if (ShenandoahConcurrentRoots::should_do_concurrent_roots()) {
types = ShenandoahRootVerifier::combine(ShenandoahRootVerifier::JNIHandleRoots, ShenandoahRootVerifier::WeakRoots);
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::CLDGRoots);
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::StringDedupRoots);
}
if (ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::CodeRoots);
if (ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::CodeRoots);
}
verifier()->verify_roots_no_forwarded_except(types);
}
verifier()->verify_roots_no_forwarded_except(types);
verifier()->verify_during_evacuation();
}
} else {