From b995c0ab7d6313f32e704e79c1e7dd21f5f160d4 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Mon, 24 Aug 2015 14:27:01 +0200 Subject: [PATCH] Update instrumentation stack after exception event If instrumentation is updated on an exception event, we must update the instrumentation stack (to remove all frames that will be unwound by the exception) before doing the long jump. Bug: 23471864 Change-Id: Ic91552bb7280c54bcc58b7ba03a17040b0b0f5ef --- runtime/quick_exception_handler.cc | 3 +++ runtime/quick_exception_handler.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/quick_exception_handler.cc b/runtime/quick_exception_handler.cc index d1a408112..9d5ce9f38 100644 --- a/runtime/quick_exception_handler.cc +++ b/runtime/quick_exception_handler.cc @@ -152,6 +152,9 @@ void QuickExceptionHandler::FindCatch(mirror::Throwable* exception) { if (instrumentation->HasExceptionCaughtListeners() && self_->IsExceptionThrownByCurrentMethod(exception)) { instrumentation->ExceptionCaughtEvent(self_, exception_ref.Get()); + // Instrumentation may have been updated. + method_tracing_active_ = is_deoptimization_ || + Runtime::Current()->GetInstrumentation()->AreExitStubsInstalled(); } } diff --git a/runtime/quick_exception_handler.h b/runtime/quick_exception_handler.h index ce9085d70..e934834e3 100644 --- a/runtime/quick_exception_handler.h +++ b/runtime/quick_exception_handler.h @@ -85,7 +85,7 @@ class QuickExceptionHandler { Context* const context_; const bool is_deoptimization_; // Is method tracing active? - const bool method_tracing_active_; + bool method_tracing_active_; // Quick frame with found handler or last frame if no handler found. ArtMethod** handler_quick_frame_; // PC to branch to for the handler. -- 2.11.0