summaryrefslogtreecommitdiff
path: root/runtime/art_method.cc
diff options
context:
space:
mode:
author Eric Holk <eholk@google.com> 2019-05-16 08:33:12 -0700
committer Treehugger Robot <treehugger-gerrit@google.com> 2019-05-20 19:35:19 +0000
commitabdb4592fa28d6e75f1160f01cde58ad7c3fef37 (patch)
treee887df0046489008f318fce65909ab0535aa386c /runtime/art_method.cc
parent639e73b5ad1d96a1e67743735a13f7a268b455aa (diff)
Use string length from DEX instead of recomputing
This gives around a 2% improvement in startup time overall. Here are results from a selection of apps: com.android.gallery3d/.app.GalleryActivity: 203.2ms → 197.7ms (change: -5.4ms, -2.7%) com.android.messaging/.ui.conversationlist.ConversationListActivity: 202.1ms → 199.1ms (change: -3.0ms, -1.5%) com.android.contacts/.activities.PeopleActivity: 277.3ms → 270.7ms (change: -6.6ms, -2.4%) com.android.camera2/com.android.camera.CameraLauncher: 351.7ms → 344.1ms (change: -7.7ms, -2.2%) com.android.dialer/.main.impl.MainActivity: 259.5ms → 254.2ms (change: -5.3ms, -2.0%) com.android.settings/.Settings: 189.0ms → 186.5ms (change: -2.4ms, -1.3%) com.android.email/.activity.Welcome: 222.8ms → 219.3ms (change: -3.6ms, -1.6%) org.mozilla.firefox/.App: 370.2ms → 358.3ms (change: -11.9ms, -3.2%) This is the average of 100 runs on a Pixel 2 XL. Bug: 132691958 Test: device boots, start app many times Change-Id: I93b6eb5105e32788cfc8159c6c21b400a161f86c
Diffstat (limited to 'runtime/art_method.cc')
-rw-r--r--runtime/art_method.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index 18fcfb2eab..0890da8c83 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -839,6 +839,29 @@ std::string ArtMethod::JniLongName() {
return long_name;
}
+const char* ArtMethod::GetRuntimeMethodName() {
+ Runtime* const runtime = Runtime::Current();
+ if (this == runtime->GetResolutionMethod()) {
+ return "<runtime internal resolution method>";
+ } else if (this == runtime->GetImtConflictMethod()) {
+ return "<runtime internal imt conflict method>";
+ } else if (this == runtime->GetCalleeSaveMethod(CalleeSaveType::kSaveAllCalleeSaves)) {
+ return "<runtime internal callee-save all registers method>";
+ } else if (this == runtime->GetCalleeSaveMethod(CalleeSaveType::kSaveRefsOnly)) {
+ return "<runtime internal callee-save reference registers method>";
+ } else if (this == runtime->GetCalleeSaveMethod(CalleeSaveType::kSaveRefsAndArgs)) {
+ return "<runtime internal callee-save reference and argument registers method>";
+ } else if (this == runtime->GetCalleeSaveMethod(CalleeSaveType::kSaveEverything)) {
+ return "<runtime internal save-every-register method>";
+ } else if (this == runtime->GetCalleeSaveMethod(CalleeSaveType::kSaveEverythingForClinit)) {
+ return "<runtime internal save-every-register method for clinit>";
+ } else if (this == runtime->GetCalleeSaveMethod(CalleeSaveType::kSaveEverythingForSuspendCheck)) {
+ return "<runtime internal save-every-register method for suspend check>";
+ } else {
+ return "<unknown runtime internal method>";
+ }
+}
+
// AssertSharedHeld doesn't work in GetAccessFlags, so use a NO_THREAD_SAFETY_ANALYSIS helper.
// TODO: Figure out why ASSERT_SHARED_CAPABILITY doesn't work.
template <ReadBarrierOption kReadBarrierOption>