diff options
| author | 2022-01-17 16:43:04 +0000 | |
|---|---|---|
| committer | 2022-02-02 15:19:18 +0000 | |
| commit | ab474880a4a6d9b57d142927cc8738c25b86cb86 (patch) | |
| tree | 381d477de1f2e28d67ace4a0ece7856866a63dae /runtime/interpreter/interpreter.cc | |
| parent | cc6026830c2715a8a424424a9ac1e97b7df92cd6 (diff) | |
Cleanup Instrumentation::IsActive
Instrumentation::IsActive is used to check if nterp should be disabled
because we have certain listeners that are processed only when running
in interpreter. Earlier this check included all listeners. However
- method entry / exit / unwind are handled by installing instrumentation
stubs, so nterp need not be disabled.
- exception events are handled in nterp too (see
art_quick_deliver_exception)
- dex_pc_listeners these are handled only in interpreter but the methods
that need these events are deoptimized.
This CL removes these listeners from IsActive and renames the IsActive.
Change-Id: Ie2e936207405d5c9057129b64ac382fcf9f0cbfb
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); |