ART: Fix interpreter single-step when doing OSR
Records an interpreter exit when in single-step mode and we've
finished processing the method via on-stack replacement.
Change-Id: I7a7d9ee9e4f3fbf7f829d9f54eca0e7c64395003
diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc
index 0488dbf..43889c6 100644
--- a/runtime/interpreter/interpreter_switch_impl.cc
+++ b/runtime/interpreter/interpreter_switch_impl.cc
@@ -37,6 +37,7 @@
shadow_frame.GetLockCountData(). \
CheckAllMonitorsReleasedOrThrow<do_assignability_check>(self); \
if (interpret_one_instruction) { \
+ /* Signal mterp to return to caller */ \
shadow_frame.SetDexPC(DexFile::kDexNoIndex); \
} \
return JValue(); /* Handled in caller. */ \
@@ -76,6 +77,10 @@
instrumentation->Branch(self, method, dex_pc, offset); \
JValue result; \
if (jit::Jit::MaybeDoOnStackReplacement(self, method, dex_pc, offset, &result)) { \
+ if (interpret_one_instruction) { \
+ /* OSR has completed execution of the method. Signal mterp to return to caller */ \
+ shadow_frame.SetDexPC(DexFile::kDexNoIndex); \
+ } \
return result; \
} \
} while (false)
@@ -205,6 +210,7 @@
result);
}
if (interpret_one_instruction) {
+ /* Signal mterp to return to caller */
shadow_frame.SetDexPC(DexFile::kDexNoIndex);
}
return result;
@@ -221,6 +227,7 @@
result);
}
if (interpret_one_instruction) {
+ /* Signal mterp to return to caller */
shadow_frame.SetDexPC(DexFile::kDexNoIndex);
}
return result;
@@ -238,6 +245,7 @@
result);
}
if (interpret_one_instruction) {
+ /* Signal mterp to return to caller */
shadow_frame.SetDexPC(DexFile::kDexNoIndex);
}
return result;
@@ -254,6 +262,7 @@
result);
}
if (interpret_one_instruction) {
+ /* Signal mterp to return to caller */
shadow_frame.SetDexPC(DexFile::kDexNoIndex);
}
return result;
@@ -292,6 +301,7 @@
result);
}
if (interpret_one_instruction) {
+ /* Signal mterp to return to caller */
shadow_frame.SetDexPC(DexFile::kDexNoIndex);
}
return result;