diff options
| author | 2018-06-19 09:45:05 -0700 | |
|---|---|---|
| committer | 2018-07-10 08:44:52 -0700 | |
| commit | 3e36a9c24f591097b4403fe77b1d426c03aeb56a (patch) | |
| tree | 64f9c8896038ada2f7a17bd7cc62c488027dd548 /runtime/base/mutex.h | |
| parent | 25bf44622d6359c1d49c2a8a8b45938ff099f811 (diff) | |
Move back to jit code on trace removal
This changes the lock hierarchy so the lock checker is able to
correctly determine that we will not deadlock. This lets us replace
the jit code in the method when tracing is removed.
Test: ./test.py --host
Change-Id: I14dd4eb9814c73fa3639239bb56d91c8303cec60
Diffstat (limited to 'runtime/base/mutex.h')
| -rw-r--r-- | runtime/base/mutex.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/runtime/base/mutex.h b/runtime/base/mutex.h index ee47e7ce56..ced0cb1d91 100644 --- a/runtime/base/mutex.h +++ b/runtime/base/mutex.h @@ -65,10 +65,14 @@ enum LockLevel : uint8_t { kAbortLock, kNativeDebugInterfaceLock, kSignalHandlingLock, + // A generic lock level for mutexs that should not allow any additional mutexes to be gained after + // acquiring it. + kGenericBottomLock, kJdwpAdbStateLock, kJdwpSocketLock, kRegionSpaceRegionLock, kMarkSweepMarkStackLock, + kJitCodeCacheLock, kRosAllocGlobalLock, kRosAllocBracketLock, kRosAllocBulkFreeLock, @@ -94,7 +98,6 @@ enum LockLevel : uint8_t { kOatFileManagerLock, kTracingUniqueMethodsLock, kTracingStreamingLock, - kDeoptimizedMethodsLock, kClassLoaderClassesLock, kDefaultMutexLevel, kDexLock, @@ -105,7 +108,6 @@ enum LockLevel : uint8_t { kMonitorPoolLock, kClassLinkerClassesLock, // TODO rename. kDexToDexCompilerLock, - kJitCodeCacheLock, kCHALock, kSubtypeCheckLock, kBreakpointLock, @@ -736,6 +738,12 @@ class Locks { // Guard accesses to the JNI function table override. static Mutex* jni_function_table_lock_ ACQUIRED_AFTER(jni_weak_globals_lock_); + // When declaring any Mutex add BOTTOM_MUTEX_ACQUIRED_AFTER to use annotalysis to check the code + // doesn't try to acquire a higher level Mutex. NB Due to the way the annotalysis works this + // actually only encodes the mutex being below jni_function_table_lock_ although having + // kGenericBottomLock level is lower than this. + #define BOTTOM_MUTEX_ACQUIRED_AFTER ACQUIRED_AFTER(art::Locks::jni_function_table_lock_) + // Have an exclusive aborting thread. static Mutex* abort_lock_ ACQUIRED_AFTER(jni_function_table_lock_); |