diff options
| author | 2014-10-28 18:12:55 -0700 | |
|---|---|---|
| committer | 2014-10-28 18:36:32 -0700 | |
| commit | ded66a01f81812e0129d17c3d08d5eda18433062 (patch) | |
| tree | 74a3f7bad1c020b0136d6c173633a361a479f5cb /runtime/entrypoints/entrypoint_utils.cc | |
| parent | e0205d519dd417f749243b42b8711dfa313e5390 (diff) | |
Move MethodHelper::GetReturnType to mirror::ArtMethod.
Also, fix missing handle in HasSameSignatureWithDifferentClassLoaders.
Change-Id: I9e1ffd09be950ecc8346fc3c485760d82d9ecab3
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.cc')
| -rw-r--r-- | runtime/entrypoints/entrypoint_utils.cc | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc index 7b90339b68..da2dfe11d0 100644 --- a/runtime/entrypoints/entrypoint_utils.cc +++ b/runtime/entrypoints/entrypoint_utils.cc @@ -218,17 +218,14 @@ void CheckReferenceResult(mirror::Object* o, Thread* self) { if (o == nullptr) { return; } - mirror::ArtMethod* m = self->GetCurrentMethod(nullptr); // Make sure that the result is an instance of the type this method was expected to return. - StackHandleScope<1> hs(self); - Handle<mirror::ArtMethod> h_m(hs.NewHandle(m)); - mirror::Class* return_type = MethodHelper(h_m).GetReturnType(); + mirror::Class* return_type = self->GetCurrentMethod(nullptr)->GetReturnType(); if (!o->InstanceOf(return_type)) { Runtime::Current()->GetJavaVM()->JniAbortF(nullptr, "attempt to return an instance of %s from %s", PrettyTypeOf(o).c_str(), - PrettyMethod(h_m.Get()).c_str()); + PrettyMethod(self->GetCurrentMethod(nullptr)).c_str()); } } @@ -283,20 +280,19 @@ JValue InvokeProxyInvocationHandler(ScopedObjectAccessAlreadyRunnable& soa, cons return zero; } else { StackHandleScope<1> hs(soa.Self()); - MethodHelper mh_interface_method( + Handle<mirror::ArtMethod> h_interface_method( hs.NewHandle(soa.Decode<mirror::ArtMethod*>(interface_method_jobj))); // This can cause thread suspension. - mirror::Class* result_type = mh_interface_method.GetReturnType(); + mirror::Class* result_type = h_interface_method->GetReturnType(); mirror::Object* result_ref = soa.Decode<mirror::Object*>(result); mirror::Object* rcvr = soa.Decode<mirror::Object*>(rcvr_jobj); mirror::ArtMethod* proxy_method; - if (mh_interface_method.GetMethod()->GetDeclaringClass()->IsInterface()) { - proxy_method = rcvr->GetClass()->FindVirtualMethodForInterface( - mh_interface_method.GetMethod()); + if (h_interface_method->GetDeclaringClass()->IsInterface()) { + proxy_method = rcvr->GetClass()->FindVirtualMethodForInterface(h_interface_method.Get()); } else { // Proxy dispatch to a method defined in Object. - DCHECK(mh_interface_method.GetMethod()->GetDeclaringClass()->IsObjectClass()); - proxy_method = mh_interface_method.GetMethod(); + DCHECK(h_interface_method->GetDeclaringClass()->IsObjectClass()); + proxy_method = h_interface_method.Get(); } ThrowLocation throw_location(rcvr, proxy_method, -1); JValue result_unboxed; |