summaryrefslogtreecommitdiff
path: root/runtime/thread.h
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2019-01-10 18:10:18 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2019-01-10 18:10:18 +0000
commit2d22ffce2b2b97a323ea09ec3f5015fb256ec57f (patch)
tree658555def3f25508bd6b3777f712ca281e86a12b /runtime/thread.h
parentfe2886de2a9f06f286fe905ce8417981b9089c5c (diff)
parente5d2398fa5be5effbc552b244387119dc53a9671 (diff)
Merge "ART: Forward-declare Context"
Diffstat (limited to 'runtime/thread.h')
-rw-r--r--runtime/thread.h14
1 files changed, 3 insertions, 11 deletions
diff --git a/runtime/thread.h b/runtime/thread.h
index 592013bd03..7a14fd7b48 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -25,7 +25,6 @@
#include <memory>
#include <string>
-#include "arch/context.h"
#include "base/atomic.h"
#include "base/enums.h"
#include "base/locks.h"
@@ -471,16 +470,7 @@ class Thread {
Context* GetLongJumpContext();
void ReleaseLongJumpContext(Context* context) {
if (tlsPtr_.long_jump_context != nullptr) {
- // Each QuickExceptionHandler gets a long jump context and uses
- // it for doing the long jump, after finding catch blocks/doing deoptimization.
- // Both finding catch blocks and deoptimization can trigger another
- // exception such as a result of class loading. So there can be nested
- // cases of exception handling and multiple contexts being used.
- // ReleaseLongJumpContext tries to save the context in tlsPtr_.long_jump_context
- // for reuse so there is no need to always allocate a new one each time when
- // getting a context. Since we only keep one context for reuse, delete the
- // existing one since the passed in context is yet to be used for longjump.
- delete tlsPtr_.long_jump_context;
+ ReleaseLongJumpContextInternal();
}
tlsPtr_.long_jump_context = context;
}
@@ -1409,6 +1399,8 @@ class Thread {
static bool IsAotCompiler();
+ void ReleaseLongJumpContextInternal();
+
// 32 bits of atomically changed state and flags. Keeping as 32 bits allows and atomic CAS to
// change from being Suspended to Runnable without a suspend request occurring.
union PACKED(4) StateAndFlags {