summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Aart Bik <ajcbik@google.com> 2016-05-18 15:44:07 -0700
committer Aart Bik <ajcbik@google.com> 2016-05-19 11:38:10 -0700
commit29bdaeef925f35eed68f3e52d04416daa0a62317 (patch)
tree252c4490c104a86416df84702b1d5fa702a2c0d8
parentfde261814318ba1fdab5cc371c9220286173d997 (diff)
Do not allow OSR jump while debugging is active.
Rationale: This prevents dangerous transitions between interpreter and osr compiled code while e.g. single stepping through a method that is becoming hot. BUG=28672961 Change-Id: Ife8e641c05b3e3eb01284212270595c8677d6673
-rw-r--r--runtime/jit/jit.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc
index b6b7eb1841..ae5a0f6777 100644
--- a/runtime/jit/jit.cc
+++ b/runtime/jit/jit.cc
@@ -444,6 +444,13 @@ bool Jit::MaybeDoOnStackReplacement(Thread* thread,
return false;
}
+ // Before allowing the jump, make sure the debugger is not active to avoid jumping from
+ // interpreter to OSR while e.g. single stepping. Note that we could selectively disable
+ // OSR when single stepping, but that's currently hard to know at this point.
+ if (Dbg::IsDebuggerActive()) {
+ return false;
+ }
+
// We found a stack map, now fill the frame with dex register values from the interpreter's
// shadow frame.
DexRegisterMap vreg_map =