Do not try to do OSR in transactional interpreter.
Test: testrunner.py --host --optimizing --jit
Bug: 175869411
Bug: 181943478
Change-Id: I005c532c23d34c16a8b6bd2f7dd464f9ef2a2b75
diff --git a/runtime/interpreter/interpreter_switch_impl-inl.h b/runtime/interpreter/interpreter_switch_impl-inl.h
index 07a04fe..8e16e04 100644
--- a/runtime/interpreter/interpreter_switch_impl-inl.h
+++ b/runtime/interpreter/interpreter_switch_impl-inl.h
@@ -237,16 +237,18 @@
if (UNLIKELY(Instrumentation()->HasBranchListeners())) {
Instrumentation()->Branch(Self(), shadow_frame_.GetMethod(), DexPC(), offset);
}
- // TODO: Do OSR only on back-edges and check if OSR code is ready here.
- JValue result;
- if (jit::Jit::MaybeDoOnStackReplacement(Self(),
- shadow_frame_.GetMethod(),
- DexPC(),
- offset,
- &result)) {
- ctx_->result = result;
- ExitInterpreterLoop();
- return false;
+ if (!transaction_active) {
+ // TODO: Do OSR only on back-edges and check if OSR code is ready here.
+ JValue result;
+ if (jit::Jit::MaybeDoOnStackReplacement(Self(),
+ shadow_frame_.GetMethod(),
+ DexPC(),
+ offset,
+ &result)) {
+ ctx_->result = result;
+ ExitInterpreterLoop();
+ return false;
+ }
}
SetNextInstruction(inst_->RelativeAt(offset));
if (offset <= 0) { // Back-edge.