657 } 658 for ( uint i = 0; i < primary_super_limit(); i++ ) { 659 Klass* ko = _primary_supers[i]; 660 if (ko != NULL) { 661 guarantee(ko->is_klass(), "should be klass"); 662 } 663 } 664 665 if (java_mirror() != NULL) { 666 guarantee(java_mirror()->is_oop(), "should be instance"); 667 } 668 } 669 670 void Klass::oop_verify_on(oop obj, outputStream* st) { 671 guarantee(obj->is_oop(), "should be oop"); 672 guarantee(obj->klass()->is_klass(), "klass field is not a klass"); 673 } 674 675 #ifndef PRODUCT 676 677 void Klass::verify_vtable_index(int i) { 678 if (oop_is_instance()) { 679 assert(i>=0 && i<((InstanceKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds"); 680 } else { 681 assert(oop_is_array(), "Must be"); 682 assert(i>=0 && i<((ArrayKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds"); 683 } 684 } 685 686 #endif | 657 } 658 for ( uint i = 0; i < primary_super_limit(); i++ ) { 659 Klass* ko = _primary_supers[i]; 660 if (ko != NULL) { 661 guarantee(ko->is_klass(), "should be klass"); 662 } 663 } 664 665 if (java_mirror() != NULL) { 666 guarantee(java_mirror()->is_oop(), "should be instance"); 667 } 668 } 669 670 void Klass::oop_verify_on(oop obj, outputStream* st) { 671 guarantee(obj->is_oop(), "should be oop"); 672 guarantee(obj->klass()->is_klass(), "klass field is not a klass"); 673 } 674 675 #ifndef PRODUCT 676 677 bool Klass::verify_vtable_index(int i) { 678 if (oop_is_instance()) { 679 int limit = ((InstanceKlass*)this)->vtable_length()/vtableEntry::size(); 680 assert(i >= 0 && i < limit, err_msg("index %d out of bounds %d", i, limit)); 681 } else { 682 assert(oop_is_array(), "Must be"); 683 int limit = ((ArrayKlass*)this)->vtable_length()/vtableEntry::size(); 684 assert(i >= 0 && i < limit, err_msg("index %d out of bounds %d", i, limit)); 685 } 686 return true; 687 } 688 689 bool Klass::verify_itable_index(int i) { 690 assert(oop_is_instance(), ""); 691 int method_count = klassItable::method_count_for_interface(this); 692 assert(i >= 0 && i < method_count, "index out of bounds"); 693 return true; 694 } 695 696 #endif |