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) { if (ShenandoahVerify) {
ShenandoahRootVerifier::RootTypes types = ShenandoahRootVerifier::None; // If OOM while evacuating/updating of roots, there is no guarantee of their consistencies
if (ShenandoahConcurrentRoots::should_do_concurrent_roots()) { if (!cancelled_gc()) {
types = ShenandoahRootVerifier::combine(ShenandoahRootVerifier::JNIHandleRoots, ShenandoahRootVerifier::WeakRoots); ShenandoahRootVerifier::RootTypes types = ShenandoahRootVerifier::None;
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::CLDGRoots); if (ShenandoahConcurrentRoots::should_do_concurrent_roots()) {
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::StringDedupRoots); 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()) { if (ShenandoahConcurrentRoots::should_do_concurrent_class_unloading()) {
types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::CodeRoots); types = ShenandoahRootVerifier::combine(types, ShenandoahRootVerifier::CodeRoots);
}
verifier()->verify_roots_no_forwarded_except(types);
} }
verifier()->verify_roots_no_forwarded_except(types);
verifier()->verify_during_evacuation(); verifier()->verify_during_evacuation();
} }
} else { } else {