From 29bdaeef925f35eed68f3e52d04416daa0a62317 Mon Sep 17 00:00:00 2001 From: Aart Bik Date: Wed, 18 May 2016 15:44:07 -0700 Subject: 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 --- runtime/jit/jit.cc | 7 +++++++ 1 file changed, 7 insertions(+) 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 = -- cgit v1.2.3-59-g8ed1b