From 521644beb8f0a100b08a4cfb91c6aafb469925aa Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Sat, 21 Mar 2020 13:17:52 +0000 Subject: Call JitCodeCache::FreeAllMethodHeaders under JIT lock. This ensures that both ArtMethods and the code are removed from the JIT atomically (otherwise other thread can interfere). I am not sure if this is partial issue, but keeping the allocated code and methods in sync makes sanity check happier. Bug: 151137723 Test: test.py -b -r --host --jit --64 Change-Id: I8580a9112c86b277631c0b2f9dd245fd55a73559 --- runtime/jit/jit_code_cache.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'runtime/jit/jit_code_cache.h') diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h index 1bbe2a4cfe..9ef1e4f98b 100644 --- a/runtime/jit/jit_code_cache.h +++ b/runtime/jit/jit_code_cache.h @@ -431,7 +431,7 @@ class JitCodeCache { // Remove CHA dependents and underlying allocations for entries in `method_headers`. void FreeAllMethodHeaders(const std::unordered_set& method_headers) REQUIRES_SHARED(Locks::mutator_lock_) - REQUIRES(!Locks::jit_lock_) + REQUIRES(Locks::jit_lock_) REQUIRES(!Locks::cha_lock_); // Removes method from the cache. The caller must ensure that all threads -- cgit v1.2.3-59-g8ed1b