diff options
author | Vladimir Marko <vmarko@google.com> | 2014-05-20 15:46:29 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2014-05-20 15:46:30 +0000 |
commit | 27a2b70f612af9afc0fb5392fb10059f6a0a3569 (patch) | |
tree | 6744c8d49b4753a92e425abed512a5d770f1ea1b /runtime/entrypoints | |
parent | 9593976c3753b6ff6390cd022d70ed7e116dc847 (diff) | |
parent | 4c1c510bea6f20f4d8b09e15547cd2967ad51c88 (diff) | |
download | art-27a2b70f612af9afc0fb5392fb10059f6a0a3569.zip art-27a2b70f612af9afc0fb5392fb10059f6a0a3569.tar.gz art-27a2b70f612af9afc0fb5392fb10059f6a0a3569.tar.bz2 |
Merge "Improve stack walk performance."
Diffstat (limited to 'runtime/entrypoints')
-rw-r--r-- | runtime/entrypoints/quick/quick_field_entrypoints.cc | 8 | ||||
-rw-r--r-- | runtime/entrypoints/quick/quick_instrumentation_entrypoints.cc | 7 |
2 files changed, 10 insertions, 5 deletions
diff --git a/runtime/entrypoints/quick/quick_field_entrypoints.cc b/runtime/entrypoints/quick/quick_field_entrypoints.cc index 2d5c07d..c38a595 100644 --- a/runtime/entrypoints/quick/quick_field_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_field_entrypoints.cc @@ -242,9 +242,11 @@ extern "C" int artSet32InstanceFromCode(uint32_t field_idx, mirror::Object* obj, extern "C" int artSet64InstanceFromCode(uint32_t field_idx, mirror::Object* obj, uint64_t new_value, Thread* self, mirror::ArtMethod** sp) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) { - mirror::ArtMethod* callee_save = Runtime::Current()->GetCalleeSaveMethod(Runtime::kRefsOnly); - mirror::ArtMethod* referrer = - sp[callee_save->GetFrameSizeInBytes() / sizeof(mirror::ArtMethod*)]; + Runtime* runtime = Runtime::Current(); + mirror::ArtMethod* callee_save = runtime->GetCalleeSaveMethod(Runtime::kRefsOnly); + uint32_t frame_size = + runtime->GetCalleeSaveMethodFrameInfo(Runtime::kRefsOnly).FrameSizeInBytes(); + mirror::ArtMethod* referrer = sp[frame_size / sizeof(mirror::ArtMethod*)]; mirror::ArtField* field = FindFieldFast(field_idx, referrer, InstancePrimitiveWrite, sizeof(int64_t)); if (LIKELY(field != NULL && obj != NULL)) { diff --git a/runtime/entrypoints/quick/quick_instrumentation_entrypoints.cc b/runtime/entrypoints/quick/quick_instrumentation_entrypoints.cc index 60c5377..11a4b3b 100644 --- a/runtime/entrypoints/quick/quick_instrumentation_entrypoints.cc +++ b/runtime/entrypoints/quick/quick_instrumentation_entrypoints.cc @@ -48,10 +48,13 @@ extern "C" uint64_t artInstrumentationMethodExitFromCode(Thread* self, mirror::A // stack. // Be aware the store below may well stomp on an incoming argument. Locks::mutator_lock_->AssertSharedHeld(self); - mirror::ArtMethod* callee_save = Runtime::Current()->GetCalleeSaveMethod(Runtime::kRefsOnly); + Runtime* runtime = Runtime::Current(); + mirror::ArtMethod* callee_save = runtime->GetCalleeSaveMethod(Runtime::kRefsOnly); *sp = callee_save; + uint32_t return_pc_offset = callee_save->GetReturnPcOffsetInBytes( + runtime->GetCalleeSaveMethodFrameInfo(Runtime::kRefsOnly).FrameSizeInBytes()); uintptr_t* return_pc = reinterpret_cast<uintptr_t*>(reinterpret_cast<byte*>(sp) + - callee_save->GetReturnPcOffsetInBytes()); + return_pc_offset); CHECK_EQ(*return_pc, 0U); self->SetTopOfStack(sp, 0); self->VerifyStack(); |