< prev index next >

src/hotspot/share/oops/instanceKlass.cpp

Print this page




3528   const Annotations* anno = annotations();
3529   if (anno) {
3530     anno->collect_statistics(sz);
3531   }
3532 
3533   const Array<Method*>* methods_array = methods();
3534   if (methods()) {
3535     for (int i = 0; i < methods_array->length(); i++) {
3536       Method* method = methods_array->at(i);
3537       if (method) {
3538         sz->_method_count ++;
3539         method->collect_statistics(sz);
3540       }
3541     }
3542   }
3543 
3544   const Array<RecordComponent*>* components = record_components();
3545   if (components != NULL) {
3546     for (int i = 0; i < components->length(); i++) {
3547       RecordComponent* component = components->at(i);
3548       if (component) {
3549         component->collect_statistics(sz);
3550       }
3551     }
3552   }
3553 
3554 }
3555 #endif // INCLUDE_SERVICES
3556 
3557 // Verification
3558 
3559 class VerifyFieldClosure: public BasicOopIterateClosure {
3560  protected:
3561   template <class T> void do_oop_work(T* p) {
3562     oop obj = RawAccess<>::oop_load(p);
3563     if (!oopDesc::is_oop_or_null(obj)) {
3564       tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p2i(p), p2i(obj));
3565       Universe::print_on(tty);
3566       guarantee(false, "boom");
3567     }
3568   }




3528   const Annotations* anno = annotations();
3529   if (anno) {
3530     anno->collect_statistics(sz);
3531   }
3532 
3533   const Array<Method*>* methods_array = methods();
3534   if (methods()) {
3535     for (int i = 0; i < methods_array->length(); i++) {
3536       Method* method = methods_array->at(i);
3537       if (method) {
3538         sz->_method_count ++;
3539         method->collect_statistics(sz);
3540       }
3541     }
3542   }
3543 
3544   const Array<RecordComponent*>* components = record_components();
3545   if (components != NULL) {
3546     for (int i = 0; i < components->length(); i++) {
3547       RecordComponent* component = components->at(i);
3548       if (component != NULL) {
3549         component->collect_statistics(sz);
3550       }
3551     }
3552   }
3553 
3554 }
3555 #endif // INCLUDE_SERVICES
3556 
3557 // Verification
3558 
3559 class VerifyFieldClosure: public BasicOopIterateClosure {
3560  protected:
3561   template <class T> void do_oop_work(T* p) {
3562     oop obj = RawAccess<>::oop_load(p);
3563     if (!oopDesc::is_oop_or_null(obj)) {
3564       tty->print_cr("Failed: " PTR_FORMAT " -> " PTR_FORMAT, p2i(p), p2i(obj));
3565       Universe::print_on(tty);
3566       guarantee(false, "boom");
3567     }
3568   }


< prev index next >