8226690: SIGSEGV in MetadataOnStackClosure::do_metadata

Dont create nmethod if classes have been redefined since compilation start.

Reviewed-by: sspitsyn, dlong, eosterlund, gdub
This commit is contained in:
Coleen Phillimore 2019-09-26 09:22:49 -04:00
parent 848614a01c
commit 6e1aa9065c
9 changed files with 43 additions and 7 deletions

View file

@ -2192,6 +2192,17 @@ public:
virtual void do_oop(narrowOop* p) { ShouldNotReachHere(); }
};
class VerifyMetadataClosure: public MetadataClosure {
public:
void do_metadata(Metadata* md) {
if (md->is_method()) {
Method* method = (Method*)md;
assert(!method->is_old(), "Should not be installing old methods");
}
}
};
void nmethod::verify() {
// Hmm. OSR methods can be deopted but not marked as zombie or not_entrant
@ -2255,6 +2266,10 @@ void nmethod::verify() {
Universe::heap()->verify_nmethod(this);
verify_scopes();
CompiledICLocker nm_verify(this);
VerifyMetadataClosure vmc;
metadata_do(&vmc);
}