diff options
| author | 2014-05-21 17:43:44 -0700 | |
|---|---|---|
| committer | 2014-06-09 12:46:32 -0700 | |
| commit | bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe (patch) | |
| tree | 3d3f667c8232a9c1bb6fe9daea0d364f9ae01d8c /runtime/utils.cc | |
| parent | 2e1ca953c7fb165da36cc26ea74d3045d7e272c8 (diff) | |
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
Diffstat (limited to 'runtime/utils.cc')
| -rw-r--r-- | runtime/utils.cc | 14 |
1 files changed, 6 insertions, 8 deletions
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()); |