< prev index next >

src/hotspot/share/oops/instanceKlass.cpp

Print this page




2456     itable().initialize_itable(false, CHECK);
2457   }
2458 
2459   // restore constant pool resolved references
2460   constants()->restore_unshareable_info(CHECK);
2461 
2462   if (array_klasses() != NULL) {
2463     // Array classes have null protection domain.
2464     // --> see ArrayKlass::complete_create_array_klass()
2465     array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK);
2466   }
2467 
2468   // Initialize current biased locking state.
2469   if (UseBiasedLocking && BiasedLocking::enabled()) {
2470     set_prototype_header(markWord::biased_locking_prototype());
2471   }
2472 }
2473 
2474 // returns true IFF is_in_error_state() has been changed as a result of this call.
2475 bool InstanceKlass::check_sharing_error_state() {
2476   assert(DumpSharedSpaces, "should only be called during dumping");
2477   bool old_state = is_in_error_state();
2478 
2479   if (!is_in_error_state()) {
2480     bool bad = false;
2481     for (InstanceKlass* sup = java_super(); sup; sup = sup->java_super()) {
2482       if (sup->is_in_error_state()) {
2483         bad = true;
2484         break;
2485       }
2486     }
2487     if (!bad) {
2488       Array<InstanceKlass*>* interfaces = transitive_interfaces();
2489       for (int i = 0; i < interfaces->length(); i++) {
2490         InstanceKlass* iface = interfaces->at(i);
2491         if (iface->is_in_error_state()) {
2492           bad = true;
2493           break;
2494         }
2495       }
2496     }


3559  public:
3560   virtual void do_oop(oop* p)       { VerifyFieldClosure::do_oop_work(p); }
3561   virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); }
3562 };
3563 
3564 void InstanceKlass::verify_on(outputStream* st) {
3565 #ifndef PRODUCT
3566   // Avoid redundant verifies, this really should be in product.
3567   if (_verify_count == Universe::verify_count()) return;
3568   _verify_count = Universe::verify_count();
3569 #endif
3570 
3571   // Verify Klass
3572   Klass::verify_on(st);
3573 
3574   // Verify that klass is present in ClassLoaderData
3575   guarantee(class_loader_data()->contains_klass(this),
3576             "this class isn't found in class loader data");
3577 
3578   // Verify vtables
3579   if (is_linked()) {
3580     // $$$ This used to be done only for m/s collections.  Doing it
3581     // always seemed a valid generalization.  (DLD -- 6/00)
3582     vtable().verify(st);
3583   }
3584 
3585   // Verify first subklass
3586   if (subklass() != NULL) {
3587     guarantee(subklass()->is_klass(), "should be klass");
3588   }
3589 
3590   // Verify siblings
3591   Klass* super = this->super();
3592   Klass* sib = next_sibling();
3593   if (sib != NULL) {
3594     if (sib == this) {
3595       fatal("subclass points to itself " PTR_FORMAT, p2i(sib));
3596     }
3597 
3598     guarantee(sib->is_klass(), "should be klass");
3599     guarantee(sib->super() == super, "siblings should have same superklass");




2456     itable().initialize_itable(false, CHECK);
2457   }
2458 
2459   // restore constant pool resolved references
2460   constants()->restore_unshareable_info(CHECK);
2461 
2462   if (array_klasses() != NULL) {
2463     // Array classes have null protection domain.
2464     // --> see ArrayKlass::complete_create_array_klass()
2465     array_klasses()->restore_unshareable_info(ClassLoaderData::the_null_class_loader_data(), Handle(), CHECK);
2466   }
2467 
2468   // Initialize current biased locking state.
2469   if (UseBiasedLocking && BiasedLocking::enabled()) {
2470     set_prototype_header(markWord::biased_locking_prototype());
2471   }
2472 }
2473 
2474 // returns true IFF is_in_error_state() has been changed as a result of this call.
2475 bool InstanceKlass::check_sharing_error_state() {
2476   Arguments::assert_is_dumping_archive();
2477   bool old_state = is_in_error_state();
2478 
2479   if (!is_in_error_state()) {
2480     bool bad = false;
2481     for (InstanceKlass* sup = java_super(); sup; sup = sup->java_super()) {
2482       if (sup->is_in_error_state()) {
2483         bad = true;
2484         break;
2485       }
2486     }
2487     if (!bad) {
2488       Array<InstanceKlass*>* interfaces = transitive_interfaces();
2489       for (int i = 0; i < interfaces->length(); i++) {
2490         InstanceKlass* iface = interfaces->at(i);
2491         if (iface->is_in_error_state()) {
2492           bad = true;
2493           break;
2494         }
2495       }
2496     }


3559  public:
3560   virtual void do_oop(oop* p)       { VerifyFieldClosure::do_oop_work(p); }
3561   virtual void do_oop(narrowOop* p) { VerifyFieldClosure::do_oop_work(p); }
3562 };
3563 
3564 void InstanceKlass::verify_on(outputStream* st) {
3565 #ifndef PRODUCT
3566   // Avoid redundant verifies, this really should be in product.
3567   if (_verify_count == Universe::verify_count()) return;
3568   _verify_count = Universe::verify_count();
3569 #endif
3570 
3571   // Verify Klass
3572   Klass::verify_on(st);
3573 
3574   // Verify that klass is present in ClassLoaderData
3575   guarantee(class_loader_data()->contains_klass(this),
3576             "this class isn't found in class loader data");
3577 
3578   // Verify vtables
3579   if (is_linked() && !is_in_error_state()) {
3580     // $$$ This used to be done only for m/s collections.  Doing it
3581     // always seemed a valid generalization.  (DLD -- 6/00)
3582     vtable().verify(st);
3583   }
3584 
3585   // Verify first subklass
3586   if (subklass() != NULL) {
3587     guarantee(subklass()->is_klass(), "should be klass");
3588   }
3589 
3590   // Verify siblings
3591   Klass* super = this->super();
3592   Klass* sib = next_sibling();
3593   if (sib != NULL) {
3594     if (sib == this) {
3595       fatal("subclass points to itself " PTR_FORMAT, p2i(sib));
3596     }
3597 
3598     guarantee(sib->is_klass(), "should be klass");
3599     guarantee(sib->super() == super, "siblings should have same superklass");


< prev index next >