From 93e94f228f7a9ec5c2a29553010e585d583ac530 Mon Sep 17 00:00:00 2001 From: buzbee Date: Thu, 7 Apr 2016 13:52:48 -0700 Subject: 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 --- runtime/interpreter/interpreter_switch_impl.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runtime/interpreter/interpreter_switch_impl.cc') diff --git a/runtime/interpreter/interpreter_switch_impl.cc b/runtime/interpreter/interpreter_switch_impl.cc index 0488dbf028..43889c6666 100644 --- a/runtime/interpreter/interpreter_switch_impl.cc +++ b/runtime/interpreter/interpreter_switch_impl.cc @@ -37,6 +37,7 @@ namespace interpreter { shadow_frame.GetLockCountData(). \ CheckAllMonitorsReleasedOrThrow(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 @@ namespace interpreter { 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 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, result); } if (interpret_one_instruction) { + /* Signal mterp to return to caller */ shadow_frame.SetDexPC(DexFile::kDexNoIndex); } return result; @@ -221,6 +227,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, result); } if (interpret_one_instruction) { + /* Signal mterp to return to caller */ shadow_frame.SetDexPC(DexFile::kDexNoIndex); } return result; @@ -238,6 +245,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, result); } if (interpret_one_instruction) { + /* Signal mterp to return to caller */ shadow_frame.SetDexPC(DexFile::kDexNoIndex); } return result; @@ -254,6 +262,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, result); } if (interpret_one_instruction) { + /* Signal mterp to return to caller */ shadow_frame.SetDexPC(DexFile::kDexNoIndex); } return result; @@ -292,6 +301,7 @@ JValue ExecuteSwitchImpl(Thread* self, const DexFile::CodeItem* code_item, result); } if (interpret_one_instruction) { + /* Signal mterp to return to caller */ shadow_frame.SetDexPC(DexFile::kDexNoIndex); } return result; -- cgit v1.2.3-59-g8ed1b