1.1 --- a/src/share/vm/oops/instanceKlass.cpp Sun Jun 23 22:08:28 2013 -0700 1.2 +++ b/src/share/vm/oops/instanceKlass.cpp Mon Jun 24 18:55:46 2013 -0400 1.3 @@ -3088,27 +3088,26 @@ 1.4 virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); } 1.5 }; 1.6 1.7 -void InstanceKlass::verify_on(outputStream* st) { 1.8 - Klass::verify_on(st); 1.9 - Thread *thread = Thread::current(); 1.10 - 1.11 +void InstanceKlass::verify_on(outputStream* st, bool check_dictionary) { 1.12 #ifndef PRODUCT 1.13 - // Avoid redundant verifies 1.14 + // Avoid redundant verifies, this really should be in product. 1.15 if (_verify_count == Universe::verify_count()) return; 1.16 _verify_count = Universe::verify_count(); 1.17 #endif 1.18 - // Verify that klass is present in SystemDictionary 1.19 - if (is_loaded() && !is_anonymous()) { 1.20 + 1.21 + // Verify Klass 1.22 + Klass::verify_on(st, check_dictionary); 1.23 + 1.24 + // Verify that klass is present in SystemDictionary if not already 1.25 + // verifying the SystemDictionary. 1.26 + if (is_loaded() && !is_anonymous() && check_dictionary) { 1.27 Symbol* h_name = name(); 1.28 SystemDictionary::verify_obj_klass_present(h_name, class_loader_data()); 1.29 } 1.30 1.31 - // Verify static fields 1.32 - VerifyFieldClosure blk; 1.33 - 1.34 // Verify vtables 1.35 if (is_linked()) { 1.36 - ResourceMark rm(thread); 1.37 + ResourceMark rm; 1.38 // $$$ This used to be done only for m/s collections. Doing it 1.39 // always seemed a valid generalization. (DLD -- 6/00) 1.40 vtable()->verify(st); 1.41 @@ -3116,7 +3115,6 @@ 1.42 1.43 // Verify first subklass 1.44 if (subklass_oop() != NULL) { 1.45 - guarantee(subklass_oop()->is_metadata(), "should be in metaspace"); 1.46 guarantee(subklass_oop()->is_klass(), "should be klass"); 1.47 } 1.48 1.49 @@ -3128,7 +3126,6 @@ 1.50 fatal(err_msg("subclass points to itself " PTR_FORMAT, sib)); 1.51 } 1.52 1.53 - guarantee(sib->is_metadata(), "should be in metaspace"); 1.54 guarantee(sib->is_klass(), "should be klass"); 1.55 guarantee(sib->super() == super, "siblings should have same superklass"); 1.56 } 1.57 @@ -3164,7 +3161,6 @@ 1.58 if (methods() != NULL) { 1.59 Array<Method*>* methods = this->methods(); 1.60 for (int j = 0; j < methods->length(); j++) { 1.61 - guarantee(methods->at(j)->is_metadata(), "should be in metaspace"); 1.62 guarantee(methods->at(j)->is_method(), "non-method in methods array"); 1.63 } 1.64 for (int j = 0; j < methods->length() - 1; j++) { 1.65 @@ -3202,16 +3198,13 @@ 1.66 1.67 // Verify other fields 1.68 if (array_klasses() != NULL) { 1.69 - guarantee(array_klasses()->is_metadata(), "should be in metaspace"); 1.70 guarantee(array_klasses()->is_klass(), "should be klass"); 1.71 } 1.72 if (constants() != NULL) { 1.73 - guarantee(constants()->is_metadata(), "should be in metaspace"); 1.74 guarantee(constants()->is_constantPool(), "should be constant pool"); 1.75 } 1.76 const Klass* host = host_klass(); 1.77 if (host != NULL) { 1.78 - guarantee(host->is_metadata(), "should be in metaspace"); 1.79 guarantee(host->is_klass(), "should be klass"); 1.80 } 1.81 }