hotspot/src/share/vm/prims/jni.cpp
changeset 35900 d64cf9290fc4
parent 35519 9200162499f7
child 36183 15d5045f46c2
equal deleted inserted replaced
35899:0dbc821628fc 35900:d64cf9290fc4
  1129       // jni_GetMethodID makes sure class is linked and initialized
  1129       // jni_GetMethodID makes sure class is linked and initialized
  1130       // so m should have a valid vtable index.
  1130       // so m should have a valid vtable index.
  1131       assert(m->valid_vtable_index(), "no valid vtable index");
  1131       assert(m->valid_vtable_index(), "no valid vtable index");
  1132       int vtbl_index = m->vtable_index();
  1132       int vtbl_index = m->vtable_index();
  1133       if (vtbl_index != Method::nonvirtual_vtable_index) {
  1133       if (vtbl_index != Method::nonvirtual_vtable_index) {
  1134         Klass* k = h_recv->klass();
  1134         selected_method = h_recv->klass()->method_at_vtable(vtbl_index);
  1135         // k might be an arrayKlassOop but all vtables start at
       
  1136         // the same place. The cast is to avoid virtual call and assertion.
       
  1137         InstanceKlass *ik = (InstanceKlass*)k;
       
  1138         selected_method = ik->method_at_vtable(vtbl_index);
       
  1139       } else {
  1135       } else {
  1140         // final method
  1136         // final method
  1141         selected_method = m;
  1137         selected_method = m;
  1142       }
  1138       }
  1143     } else {
  1139     } else {