summaryrefslogtreecommitdiff
path: root/runtime/quick_exception_handler.h
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2015-09-08 17:03:36 +0200
committerSebastien Hertz <shertz@google.com>2015-09-10 17:39:56 +0200
commit520633bebd2bf4d70884d30f179dbde9f275aac6 (patch)
tree0006fb9db71545d9aaa88df3952a7488b30b2ae6 /runtime/quick_exception_handler.h
parente0a49e3a93aa54b9e603d797d9e925a98742753a (diff)
Support deoptimization on exception
Allows to deoptimize when an exception is being thrown. We only deoptimize if an executable frame (starting from the catch handler) needs to be executed with the interpreter. Before executing deoptimized frames, the exception is restored. The interpreter starts by handling this exception at the point of the throwing instruction. Bug: 23714835 Change-Id: I0c5f7d4b257644acf12210aae8e5b6bb0f4af1f7
Diffstat (limited to 'runtime/quick_exception_handler.h')
-rw-r--r--runtime/quick_exception_handler.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/runtime/quick_exception_handler.h b/runtime/quick_exception_handler.h
index e934834e3c..4db95a87ec 100644
--- a/runtime/quick_exception_handler.h
+++ b/runtime/quick_exception_handler.h
@@ -43,9 +43,18 @@ class QuickExceptionHandler {
UNREACHABLE();
}
+ // Find the catch handler for the given exception.
void FindCatch(mirror::Throwable* exception) SHARED_REQUIRES(Locks::mutator_lock_);
+
+ // Deoptimize the stack to the upcall. For every compiled frame, we create a "copy"
+ // shadow frame that will be executed with the interpreter.
void DeoptimizeStack() SHARED_REQUIRES(Locks::mutator_lock_);
+
+ // Update the instrumentation stack by removing all methods that will be unwound
+ // by the exception being thrown.
void UpdateInstrumentationStack() SHARED_REQUIRES(Locks::mutator_lock_);
+
+ // Long jump either to a catch handler or to the upcall.
NO_RETURN void DoLongJump() SHARED_REQUIRES(Locks::mutator_lock_);
void SetHandlerQuickFrame(ArtMethod** handler_quick_frame) {
@@ -83,9 +92,10 @@ class QuickExceptionHandler {
private:
Thread* const self_;
Context* const context_;
+ // Should we deoptimize the stack?
const bool is_deoptimization_;
// Is method tracing active?
- bool method_tracing_active_;
+ const 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.