diff options
author | Sebastien Hertz <shertz@google.com> | 2014-04-23 10:32:43 +0200 |
---|---|---|
committer | Sebastien Hertz <shertz@google.com> | 2014-04-25 10:36:05 +0200 |
commit | fd3077e4b9ebadd281777310d26e64443858f653 (patch) | |
tree | c63911af29580ab8c0fc8dd29171e626871449aa /runtime/thread.h | |
parent | a08ec9b372d4f5e918b3d68499fbd1731180cd98 (diff) | |
download | art-fd3077e4b9ebadd281777310d26e64443858f653.zip art-fd3077e4b9ebadd281777310d26e64443858f653.tar.gz art-fd3077e4b9ebadd281777310d26e64443858f653.tar.bz2 |
Refactor exception handling for deoptimization
This CL refactors the exception handling (on the quick side) by isolating the
search of catch handler and the preparation of deoptimization.
We rename the CatchFinder class to QuickExceptionHandler so it's less specific
to catch handler search.
Finding catch handler happens in QuickExceptionHandler::FindCatch. Since the
CatchBlockStackVisitor resolves exception types, it may cause thread suspension
and breaks the assertion current thread can't be suspended. Therefore, we place
the exception in a SirtRef (while it is detached from the current thread) and
remove the thread suspension assertion.
Deoptimization now happens in QuickExceptionHandler::DeoptimizeStack. It uses
the new DeoptimizeStackVisitor class to create shadow frames.
We also add the Thread::GetDeoptimizationException method to get the definition
of the fake exception in only one place.
Change-Id: I01b19fa72af64329b5c3b6c7f0c3339d2d724978
Diffstat (limited to 'runtime/thread.h')
-rw-r--r-- | runtime/thread.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/thread.h b/runtime/thread.h index d25bbe9..e5e4cae 100644 --- a/runtime/thread.h +++ b/runtime/thread.h @@ -686,6 +686,11 @@ class Thread { return tlsPtr_.single_step_control; } + // Returns the fake exception used to activate deoptimization. + static mirror::Throwable* GetDeoptimizationException() { + return reinterpret_cast<mirror::Throwable*>(-1); + } + void SetDeoptimizationShadowFrame(ShadowFrame* sf); void SetDeoptimizationReturnValue(const JValue& ret_val); |