diff options
-rw-r--r-- | runtime/jit/jit_code_cache-inl.h | 2 | ||||
-rw-r--r-- | runtime/jit/jit_code_cache.h | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/runtime/jit/jit_code_cache-inl.h b/runtime/jit/jit_code_cache-inl.h index fab2073e55..b4553a1ec3 100644 --- a/runtime/jit/jit_code_cache-inl.h +++ b/runtime/jit/jit_code_cache-inl.h @@ -38,7 +38,7 @@ EXPORT void JitCodeCache::VisitRootTables(ArtMethod* method, RootVisitorType& vi Thread* self = Thread::Current(); ScopedDebugDisallowReadBarriers sddrb(self); - MutexLock mu(self, *Locks::jit_lock_); + ReaderMutexLock mu(self, *Locks::jit_mutator_lock_); auto code_ptrs_it = method_code_map_reversed_.find(method); if (code_ptrs_it == method_code_map_reversed_.end()) { diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h index 2d2f841360..84b56f1247 100644 --- a/runtime/jit/jit_code_cache.h +++ b/runtime/jit/jit_code_cache.h @@ -359,8 +359,10 @@ class JitCodeCache { // Visit GC roots (except j.l.Class and j.l.String) held by JIT-ed code. template<typename RootVisitorType> - EXPORT void VisitRootTables(ArtMethod* method, - RootVisitorType& visitor) NO_THREAD_SAFETY_ANALYSIS; + EXPORT void VisitRootTables(ArtMethod* method, RootVisitorType& visitor) + REQUIRES(Locks::heap_bitmap_lock_) + REQUIRES(!Locks::jit_mutator_lock_) + REQUIRES_SHARED(Locks::mutator_lock_); void SweepRootTables(IsMarkedVisitor* visitor) REQUIRES(!Locks::jit_lock_) |