src/share/vm/oops/klass.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/oops/klass.cpp	Wed Sep 11 19:08:47 2013
--- new/src/share/vm/oops/klass.cpp	Wed Sep 11 19:08:47 2013

*** 672,686 **** --- 672,696 ---- guarantee(obj->klass()->is_klass(), "klass field is not a klass"); } #ifndef PRODUCT ! void Klass::verify_vtable_index(int i) { ! bool Klass::verify_vtable_index(int i) { if (oop_is_instance()) { ! assert(i>=0 && i<((InstanceKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds"); ! int limit = ((InstanceKlass*)this)->vtable_length()/vtableEntry::size(); + assert(i >= 0 && i < limit, err_msg("index %d out of bounds %d", i, limit)); } else { assert(oop_is_array(), "Must be"); ! assert(i>=0 && i<((ArrayKlass*)this)->vtable_length()/vtableEntry::size(), "index out of bounds"); ! int limit = ((ArrayKlass*)this)->vtable_length()/vtableEntry::size(); + assert(i >= 0 && i < limit, err_msg("index %d out of bounds %d", i, limit)); } + return true; + } + + bool Klass::verify_itable_index(int i) { + assert(oop_is_instance(), ""); + int method_count = klassItable::method_count_for_interface(this); + assert(i >= 0 && i < method_count, "index out of bounds"); + return true; } #endif

src/share/vm/oops/klass.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File