8016325: JVM hangs verifying system dictionary

Minimize redundant verifications of Klasses.

Reviewed-by: hseigel, jmasa
This commit is contained in:
Coleen Phillimore 2013-06-24 18:55:46 -04:00
parent 196c8abc3d
commit 39a1c1d6c2
24 changed files with 30 additions and 68 deletions

View file

@ -377,7 +377,6 @@ void Klass::append_to_sibling_list() {
}
bool Klass::is_loader_alive(BoolObjectClosure* is_alive) {
assert(is_metadata(), "p is not meta-data");
assert(ClassLoaderDataGraph::contains((address)this), "is in the metaspace");
#ifdef ASSERT
@ -648,27 +647,24 @@ void Klass::collect_statistics(KlassSizeStats *sz) const {
// Verification
void Klass::verify_on(outputStream* st) {
guarantee(!Universe::heap()->is_in_reserved(this), "Shouldn't be");
guarantee(this->is_metadata(), "should be in metaspace");
void Klass::verify_on(outputStream* st, bool check_dictionary) {
// This can be expensive, but it is worth checking that this klass is actually
// in the CLD graph but not in production.
assert(ClassLoaderDataGraph::contains((address)this), "Should be");
guarantee(this->is_klass(),"should be klass");
if (super() != NULL) {
guarantee(super()->is_metadata(), "should be in metaspace");
guarantee(super()->is_klass(), "should be klass");
}
if (secondary_super_cache() != NULL) {
Klass* ko = secondary_super_cache();
guarantee(ko->is_metadata(), "should be in metaspace");
guarantee(ko->is_klass(), "should be klass");
}
for ( uint i = 0; i < primary_super_limit(); i++ ) {
Klass* ko = _primary_supers[i];
if (ko != NULL) {
guarantee(ko->is_metadata(), "should be in metaspace");
guarantee(ko->is_klass(), "should be klass");
}
}
@ -680,7 +676,6 @@ void Klass::verify_on(outputStream* st) {
void Klass::oop_verify_on(oop obj, outputStream* st) {
guarantee(obj->is_oop(), "should be oop");
guarantee(obj->klass()->is_metadata(), "should not be in Java heap");
guarantee(obj->klass()->is_klass(), "klass field is not a klass");
}