From bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 21 May 2014 17:43:44 -0700 Subject: Change MethodHelper to use a Handle. Added ConstHandle to help prevent errors where you modify the value stored in the handle of the caller. Also fixed compaction bugs related to not knowing MethodHelper::GetReturnType can resolve types. This bug was present in interpreter RETURN_OBJECT. Bug: 13077697 Change-Id: I71f964d4d810ab4debda1a09bc968af8f3c874a3 --- runtime/utils.cc | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'runtime/utils.cc') diff --git a/runtime/utils.cc b/runtime/utils.cc index ef2047b8c5..7700658fea 100644 --- a/runtime/utils.cc +++ b/runtime/utils.cc @@ -365,15 +365,14 @@ std::string PrettyMethod(mirror::ArtMethod* m, bool with_signature) { if (m == nullptr) { return "null"; } - MethodHelper mh(m); - std::string result(PrettyDescriptor(mh.GetDeclaringClassDescriptor())); + std::string result(PrettyDescriptor(m->GetDeclaringClassDescriptor())); result += '.'; - result += mh.GetName(); + result += m->GetName(); if (UNLIKELY(m->IsFastNative())) { result += "!"; } if (with_signature) { - const Signature signature = mh.GetSignature(); + const Signature signature = m->GetSignature(); std::string sig_as_string(signature.ToString()); if (signature == Signature::NoSignature()) { return result + sig_as_string; @@ -642,15 +641,14 @@ std::string DescriptorToName(const char* descriptor) { } std::string JniShortName(mirror::ArtMethod* m) { - MethodHelper mh(m); - std::string class_name(mh.GetDeclaringClassDescriptor()); + std::string class_name(m->GetDeclaringClassDescriptor()); // Remove the leading 'L' and trailing ';'... CHECK_EQ(class_name[0], 'L') << class_name; CHECK_EQ(class_name[class_name.size() - 1], ';') << class_name; class_name.erase(0, 1); class_name.erase(class_name.size() - 1, 1); - std::string method_name(mh.GetName()); + std::string method_name(m->GetName()); std::string short_name; short_name += "Java_"; @@ -665,7 +663,7 @@ std::string JniLongName(mirror::ArtMethod* m) { long_name += JniShortName(m); long_name += "__"; - std::string signature(MethodHelper(m).GetSignature().ToString()); + std::string signature(m->GetSignature().ToString()); signature.erase(0, 1); signature.erase(signature.begin() + signature.find(')'), signature.end()); -- cgit v1.2.3-59-g8ed1b