summaryrefslogtreecommitdiff
path: root/runtime/method_handles.cc
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/method_handles.cc')
-rw-r--r--runtime/method_handles.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/runtime/method_handles.cc b/runtime/method_handles.cc
index 82370c4631..64ab78997f 100644
--- a/runtime/method_handles.cc
+++ b/runtime/method_handles.cc
@@ -674,13 +674,15 @@ ArtMethod* RefineTargetMethod(Thread* self,
return WellKnownClasses::StringInitToStringFactory(target_method);
}
} else if (handle_kind == mirror::MethodHandle::Kind::kInvokeSuper) {
- ObjPtr<mirror::Class> declaring_class = target_method->GetDeclaringClass();
-
// Note that we're not dynamically dispatching on the type of the receiver
// here. We use the static type of the "receiver" object that we've
// recorded in the method handle's type, which will be the same as the
// special caller that was specified at the point of lookup.
ObjPtr<mirror::Class> referrer_class = handle_type->GetPTypes()->Get(0);
+ ObjPtr<mirror::Class> declaring_class = target_method->GetDeclaringClass();
+ if (referrer_class == declaring_class) {
+ return target_method;
+ }
if (!declaring_class->IsInterface()) {
ObjPtr<mirror::Class> super_class = referrer_class->GetSuperClass();
uint16_t vtable_index = target_method->GetMethodIndex();
@@ -690,8 +692,6 @@ ArtMethod* RefineTargetMethod(Thread* self,
// will always be declared by super_class (or one of its super classes).
DCHECK_LT(vtable_index, super_class->GetVTableLength());
return super_class->GetVTableEntry(vtable_index, kRuntimePointerSize);
- } else {
- return referrer_class->FindVirtualMethodForInterfaceSuper(target_method, kRuntimePointerSize);
}
}
return target_method;