8014013: CallInfo structure no longer accurately reports the result of a LinkResolver operation

Enhance method resolution and resulting data structures, plus some refactoring.

Reviewed-by: twisti, acorn, jrose
This commit is contained in:
David Chase 2013-09-13 22:38:02 -04:00
parent 98d8f57603
commit 222c735458
40 changed files with 715 additions and 601 deletions

View file

@ -1336,6 +1336,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive
if (call_type == JNI_VIRTUAL) {
// jni_GetMethodID makes sure class is linked and initialized
// so m should have a valid vtable index.
assert(!m->has_itable_index(), "");
int vtbl_index = m->vtable_index();
if (vtbl_index != Method::nonvirtual_vtable_index) {
Klass* k = h_recv->klass();
@ -1355,12 +1356,7 @@ static void jni_invoke_nonstatic(JNIEnv *env, JavaValue* result, jobject receive
// interface call
KlassHandle h_holder(THREAD, holder);
int itbl_index = m->cached_itable_index();
if (itbl_index == -1) {
itbl_index = klassItable::compute_itable_index(m);
m->set_cached_itable_index(itbl_index);
// the above may have grabbed a lock, 'm' and anything non-handlized can't be used again
}
int itbl_index = m->itable_index();
Klass* k = h_recv->klass();
selected_method = InstanceKlass::cast(k)->method_at_itable(h_holder(), itbl_index, CHECK);
}