Revert "Revert "JVMTI Exception and ExceptionCatch events""
Fixed error where we were incorrectly not updating a ShadowFrame
dex_pc causing deoptimization errors.
Bug: 62821960
Bug: 65049545
Test: ./test.py --host -j50
Test: ./art/tools/run-libcore-tests.sh \
--mode=host --variant-X32 --debug
This reverts commit 959742483885779f106e000df6dd422fc8657931.
Change-Id: I91ab2bc3e645ddf0359c189b19a59a3ecf0d8921
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc
index 9cb74f7..3349833 100644
--- a/runtime/interpreter/interpreter.cc
+++ b/runtime/interpreter/interpreter.cc
@@ -522,10 +522,8 @@
// null Instrumentation*.
const instrumentation::Instrumentation* const instrumentation =
first ? nullptr : Runtime::Current()->GetInstrumentation();
- uint32_t found_dex_pc = FindNextInstructionFollowingException(self, *shadow_frame, dex_pc,
- instrumentation);
- new_dex_pc = found_dex_pc; // the dex pc of a matching catch handler
- // or DexFile::kDexNoIndex if there is none.
+ new_dex_pc = MoveToExceptionHandler(
+ self, *shadow_frame, instrumentation) ? shadow_frame->GetDexPC() : DexFile::kDexNoIndex;
} else if (!from_code) {
// For the debugger and full deoptimization stack, we must go past the invoke
// instruction, as it already executed.