diff options
| author | 2014-06-10 18:21:32 +0000 | |
|---|---|---|
| committer | 2014-06-10 18:21:32 +0000 | |
| commit | 5bf6a77944acdeb0a9464803c70d0c65cf15b68b (patch) | |
| tree | ee66c89cf844201630b47eb0c0c438b88e3ab866 /runtime/entrypoints/entrypoint_utils.cc | |
| parent | 335b91fb98d8004580e9a58335a873a1874fa5a5 (diff) | |
| parent | bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe (diff) | |
Merge "Change MethodHelper to use a Handle."
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.cc')
| -rw-r--r-- | runtime/entrypoints/entrypoint_utils.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.cc b/runtime/entrypoints/entrypoint_utils.cc index 320273d176..a0e32f520d 100644 --- a/runtime/entrypoints/entrypoint_utils.cc +++ b/runtime/entrypoints/entrypoint_utils.cc @@ -189,18 +189,21 @@ JValue InvokeProxyInvocationHandler(ScopedObjectAccessAlreadyRunnable& soa, cons // Do nothing. return zero; } else { + StackHandleScope<1> hs(soa.Self()); + MethodHelper mh_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::Object* result_ref = soa.Decode<mirror::Object*>(result); mirror::Object* rcvr = soa.Decode<mirror::Object*>(rcvr_jobj); - mirror::ArtMethod* interface_method = - soa.Decode<mirror::ArtMethod*>(interface_method_jobj); - mirror::Class* result_type = MethodHelper(interface_method).GetReturnType(); mirror::ArtMethod* proxy_method; - if (interface_method->GetDeclaringClass()->IsInterface()) { - proxy_method = rcvr->GetClass()->FindVirtualMethodForInterface(interface_method); + if (mh_interface_method.GetMethod()->GetDeclaringClass()->IsInterface()) { + proxy_method = rcvr->GetClass()->FindVirtualMethodForInterface( + mh_interface_method.GetMethod()); } else { // Proxy dispatch to a method defined in Object. - DCHECK(interface_method->GetDeclaringClass()->IsObjectClass()); - proxy_method = interface_method; + DCHECK(mh_interface_method.GetMethod()->GetDeclaringClass()->IsObjectClass()); + proxy_method = mh_interface_method.GetMethod(); } ThrowLocation throw_location(rcvr, proxy_method, -1); JValue result_unboxed; |