diff options
Diffstat (limited to 'runtime/interpreter/interpreter.cc')
-rw-r--r-- | runtime/interpreter/interpreter.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index 4339120fa1..dc7e23ec06 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -476,13 +476,16 @@ void EnterInterpreterFromDeoptimize(Thread* self, const uint32_t dex_pc = shadow_frame->GetDexPC(); uint32_t new_dex_pc = dex_pc; if (UNLIKELY(self->IsExceptionPending())) { - // If we deoptimize from the QuickExceptionHandler, we already reported the exception to - // the instrumentation. To prevent from reporting it a second time, we simply pass a - // null Instrumentation*. - const instrumentation::Instrumentation* const instrumentation = - frame_cnt == 0 ? nullptr : Runtime::Current()->GetInstrumentation(); - new_dex_pc = MoveToExceptionHandler( - self, *shadow_frame, instrumentation) ? shadow_frame->GetDexPC() : dex::kDexNoIndex; + // If we deoptimize from the QuickExceptionHandler, we already reported the exception throw + // event to the instrumentation. Skip throw listeners for the first frame. The deopt check + // should happen after the throw listener is called as throw listener can trigger a + // deoptimization. + new_dex_pc = MoveToExceptionHandler(self, + *shadow_frame, + /* skip_listeners= */ false, + /* skip_throw_listener= */ frame_cnt == 0) ? + shadow_frame->GetDexPC() : + dex::kDexNoIndex; } else if (!from_code) { // Deoptimization is not called from code directly. const Instruction* instr = &accessor.InstructionAt(dex_pc); |