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.h | |
| parent | 335b91fb98d8004580e9a58335a873a1874fa5a5 (diff) | |
| parent | bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe (diff) | |
Merge "Change MethodHelper to use a Handle."
Diffstat (limited to 'runtime/entrypoints/entrypoint_utils.h')
| -rw-r--r-- | runtime/entrypoints/entrypoint_utils.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/runtime/entrypoints/entrypoint_utils.h b/runtime/entrypoints/entrypoint_utils.h index d0ae746b20..09899c05bd 100644 --- a/runtime/entrypoints/entrypoint_utils.h +++ b/runtime/entrypoints/entrypoint_utils.h @@ -433,9 +433,8 @@ static inline mirror::ArtMethod* FindMethodFromCode(uint32_t method_idx, if (access_check && (vtable == nullptr || vtable_index >= static_cast<uint32_t>(vtable->GetLength()))) { // Behavior to agree with that of the verifier. - MethodHelper mh(resolved_method); - ThrowNoSuchMethodError(type, resolved_method->GetDeclaringClass(), mh.GetName(), - mh.GetSignature()); + ThrowNoSuchMethodError(type, resolved_method->GetDeclaringClass(), + resolved_method->GetName(), resolved_method->GetSignature()); return nullptr; // Failure. } DCHECK(vtable != nullptr); @@ -450,9 +449,8 @@ static inline mirror::ArtMethod* FindMethodFromCode(uint32_t method_idx, vtable = (super_class != nullptr) ? super_class->GetVTable() : nullptr; if (vtable == nullptr || vtable_index >= static_cast<uint32_t>(vtable->GetLength())) { // Behavior to agree with that of the verifier. - MethodHelper mh(resolved_method); - ThrowNoSuchMethodError(type, resolved_method->GetDeclaringClass(), mh.GetName(), - mh.GetSignature()); + ThrowNoSuchMethodError(type, resolved_method->GetDeclaringClass(), + resolved_method->GetName(), resolved_method->GetSignature()); return nullptr; // Failure. } } else { @@ -682,11 +680,13 @@ static inline void CheckReferenceResult(mirror::Object* o, Thread* self) JniAbortF(NULL, "invalid reference returned from %s", PrettyMethod(m).c_str()); } // Make sure that the result is an instance of the type this method was expected to return. - mirror::Class* return_type = MethodHelper(m).GetReturnType(); + StackHandleScope<1> hs(self); + Handle<mirror::ArtMethod> h_m(hs.NewHandle(m)); + mirror::Class* return_type = MethodHelper(h_m).GetReturnType(); if (!o->InstanceOf(return_type)) { - JniAbortF(NULL, "attempt to return an instance of %s from %s", - PrettyTypeOf(o).c_str(), PrettyMethod(m).c_str()); + JniAbortF(NULL, "attempt to return an instance of %s from %s", PrettyTypeOf(o).c_str(), + PrettyMethod(h_m.Get()).c_str()); } } |