summaryrefslogtreecommitdiffstats
path: root/runtime/instrumentation.cc
diff options
context:
space:
mode:
authorMingyao Yang <mingyao@google.com>2015-07-06 11:10:37 -0700
committerSebastien Hertz <shertz@google.com>2015-09-17 17:07:22 +0200
commit99170c636dfae4908b102347cfe9f92bad1881cc (patch)
tree1ecff5dd69ea20b09e622cb88e7835a55dfa4be8 /runtime/instrumentation.cc
parent5836f8465ddd0a7f5cbeec9c30d739bd0619867f (diff)
downloadart-99170c636dfae4908b102347cfe9f92bad1881cc.tar.gz
art-99170c636dfae4908b102347cfe9f92bad1881cc.tar.bz2
art-99170c636dfae4908b102347cfe9f92bad1881cc.zip
Deoptimization support in optimizing compiler for setting local values
Due to compiler optimizations, we may not always be able to update the value of a local variable in a compiled frame (like a variable seen as constant by the compiler). To avoid that situation, we simply deoptimize compiled frames updated by the debugger so they are executed by the interpreter with the updated value. When the debugger attempts to set a local variable (actually a DEX register or a pair of registers) in a compiled frame, we allocate a ShadowFrame associated to that frame (using its frame id) and set the new value in that ShadowFrame. When we know we are about to continue the execution of the compiled frame, we deoptimize the stack using the preallocated ShadowFrame (instead of creating a new one). We initialize it with the current value of all DEX registers except the ones that have been set by the debugger. Therefore, the ShadowFrame represent the runtime context modified by the debugger. Bumps oat version to force recompilation. Bug: 19944235 Change-Id: I0ebe6241264f7a3be0f14ee4516c1f7436e04da6
Diffstat (limited to 'runtime/instrumentation.cc')
-rw-r--r--runtime/instrumentation.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/instrumentation.cc b/runtime/instrumentation.cc
index 7e2a84df2c..deada4c5dc 100644
--- a/runtime/instrumentation.cc
+++ b/runtime/instrumentation.cc
@@ -297,6 +297,11 @@ static void InstrumentationInstallStack(Thread* thread, void* arg)
thread->VerifyStack();
}
+void Instrumentation::InstrumentThreadStack(Thread* thread) {
+ instrumentation_stubs_installed_ = true;
+ InstrumentationInstallStack(thread, this);
+}
+
// Removes the instrumentation exit pc as the return PC for every quick frame.
static void InstrumentationRestoreStack(Thread* thread, void* arg)
SHARED_REQUIRES(Locks::mutator_lock_) {
@@ -1001,7 +1006,8 @@ TwoWordReturn Instrumentation::PopInstrumentationStackFrame(Thread* self, uintpt
ArtMethod* method = instrumentation_frame.method_;
uint32_t length;
- char return_shorty = method->GetShorty(&length)[0];
+ const size_t pointer_size = Runtime::Current()->GetClassLinker()->GetImagePointerSize();
+ char return_shorty = method->GetInterfaceMethodIfProxy(pointer_size)->GetShorty(&length)[0];
JValue return_value;
if (return_shorty == 'V') {
return_value.SetJ(0);