8222130: Shenandoah should verify roots after pre-evacuation

Reviewed-by: rkennke, zgu
This commit is contained in:
Aleksey Shipilev 2019-04-08 19:43:04 +02:00
parent ae463150c0
commit 3592b7ea78
3 changed files with 24 additions and 0 deletions

View File

@ -1547,6 +1547,10 @@ void ShenandoahHeap::op_final_mark() {
if (ShenandoahPacing) {
pacer()->setup_for_evac();
}
if (ShenandoahVerify) {
verifier()->verify_during_evacuation();
}
} else {
if (ShenandoahVerify) {
verifier()->verify_after_concmark();

View File

@ -628,6 +628,10 @@ void ShenandoahVerifier::verify_at_safepoint(const char *label,
enabled = true;
expected = ShenandoahHeap::HAS_FORWARDED;
break;
case _verify_gcstate_evacuation:
enabled = true;
expected = ShenandoahHeap::HAS_FORWARDED | ShenandoahHeap::EVACUATION;
break;
case _verify_gcstate_stable:
enabled = true;
expected = ShenandoahHeap::STABLE;
@ -808,6 +812,18 @@ void ShenandoahVerifier::verify_before_evacuation() {
);
}
void ShenandoahVerifier::verify_during_evacuation() {
verify_at_safepoint(
"During Evacuation",
_verify_forwarded_allow, // some forwarded references are allowed
_verify_marked_disable, // walk only roots
_verify_cset_disable, // some cset references are not forwarded yet
_verify_liveness_disable, // liveness data might be already stale after pre-evacs
_verify_regions_disable, // trash regions not yet recycled
_verify_gcstate_evacuation // evacuation is in progress
);
}
void ShenandoahVerifier::verify_after_evacuation() {
verify_at_safepoint(
"After Evacuation",

View File

@ -135,6 +135,9 @@ public:
// Nothing is in progress, some objects are forwarded
_verify_gcstate_forwarded,
// Evacuation is in progress, some objects are forwarded
_verify_gcstate_evacuation,
} VerifyGCState;
struct VerifyOptions {
@ -173,6 +176,7 @@ public:
void verify_before_concmark();
void verify_after_concmark();
void verify_before_evacuation();
void verify_during_evacuation();
void verify_after_evacuation();
void verify_before_updaterefs();
void verify_after_updaterefs();