summaryrefslogtreecommitdiff
path: root/runtime/utils.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2015-04-22 13:56:20 -0700
committer Mathieu Chartier <mathieuc@google.com> 2015-05-29 18:45:49 -0700
commite401d146407d61eeb99f8d6176b2ac13c4df1e33 (patch)
tree17927f9bfe7d2041b5942c89832d55f9dedb24c5 /runtime/utils.cc
parent2006b7b9b8e32722bd0d640c62549d8a0ac624b6 (diff)
Move mirror::ArtMethod to native
Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
Diffstat (limited to 'runtime/utils.cc')
-rw-r--r--runtime/utils.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/runtime/utils.cc b/runtime/utils.cc
index 2671b46bad..4923342e8e 100644
--- a/runtime/utils.cc
+++ b/runtime/utils.cc
@@ -26,10 +26,10 @@
#include <memory>
#include "art_field-inl.h"
+#include "art_method-inl.h"
#include "base/stl_util.h"
#include "base/unix_file/fd_file.h"
#include "dex_file-inl.h"
-#include "mirror/art_method-inl.h"
#include "mirror/class-inl.h"
#include "mirror/class_loader.h"
#include "mirror/object-inl.h"
@@ -344,10 +344,13 @@ std::string PrettyReturnType(const char* signature) {
return PrettyDescriptor(return_type);
}
-std::string PrettyMethod(mirror::ArtMethod* m, bool with_signature) {
+std::string PrettyMethod(ArtMethod* m, bool with_signature) {
if (m == nullptr) {
return "null";
}
+ if (!m->IsRuntimeMethod()) {
+ m = m->GetInterfaceMethodIfProxy(Runtime::Current()->GetClassLinker()->GetImagePointerSize());
+ }
std::string result(PrettyDescriptor(m->GetDeclaringClassDescriptor()));
result += '.';
result += m->GetName();
@@ -595,7 +598,7 @@ std::string DescriptorToName(const char* descriptor) {
return descriptor;
}
-std::string JniShortName(mirror::ArtMethod* m) {
+std::string JniShortName(ArtMethod* m) {
std::string class_name(m->GetDeclaringClassDescriptor());
// Remove the leading 'L' and trailing ';'...
CHECK_EQ(class_name[0], 'L') << class_name;
@@ -613,7 +616,7 @@ std::string JniShortName(mirror::ArtMethod* m) {
return short_name;
}
-std::string JniLongName(mirror::ArtMethod* m) {
+std::string JniLongName(ArtMethod* m) {
std::string long_name;
long_name += JniShortName(m);
long_name += "__";
@@ -1088,7 +1091,7 @@ static void Addr2line(const std::string& map_src, uintptr_t offset, std::ostream
#endif
void DumpNativeStack(std::ostream& os, pid_t tid, const char* prefix,
- mirror::ArtMethod* current_method, void* ucontext_ptr) {
+ ArtMethod* current_method, void* ucontext_ptr) {
#if __linux__
// b/18119146
if (RUNNING_ON_VALGRIND != 0) {