OSDN Git Service

Deoptimization support in optimizing compiler for setting local values
authorMingyao Yang <mingyao@google.com>
Mon, 6 Jul 2015 18:10:37 +0000 (11:10 -0700)
committerSebastien Hertz <shertz@google.com>
Thu, 17 Sep 2015 15:07:22 +0000 (17:07 +0200)
commit99170c636dfae4908b102347cfe9f92bad1881cc
tree1ecff5dd69ea20b09e622cb88e7835a55dfa4be8
parent5836f8465ddd0a7f5cbeec9c30d739bd0619867f
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
12 files changed:
runtime/asm_support.h
runtime/debugger.cc
runtime/debugger.h
runtime/entrypoints_order_test.cc
runtime/instrumentation.cc
runtime/instrumentation.h
runtime/oat.h
runtime/quick_exception_handler.cc
runtime/stack.cc
runtime/stack.h
runtime/thread.cc
runtime/thread.h