From e5d2398fa5be5effbc552b244387119dc53a9671 Mon Sep 17 00:00:00 2001 From: Andreas Gampe Date: Tue, 8 Jan 2019 10:34:26 -0800 Subject: ART: Forward-declare Context Move deletion to thread.cc, which allows to forward-declare Context. Bug: 119869270 Test: mmma art Change-Id: Ifd9006cd3457d4ab708a289a7f6e1cdf2591c596 --- runtime/thread.h | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'runtime/thread.h') 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 #include -#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 { -- cgit v1.2.3-59-g8ed1b