From eced692a34d2cf63d584c703704592984cc50394 Mon Sep 17 00:00:00 2001 From: Orion Hodson Date: Thu, 1 Jun 2017 10:54:28 +0100 Subject: ART: Add JIT cache race test Adds a test for the JIT code cache that attempts to trap races between threads generating code and executing it. Bug: 38417984 Test: run-test --jit 707 Change-Id: I408b2680b1d266ebe624d6e39113f0261d538e8a --- runtime/jit/jit_code_cache.h | 7 +++++++ 1 file changed, 7 insertions(+) (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 612d06ba1c..811b3c7d32 100644 --- a/runtime/jit/jit_code_cache.h +++ b/runtime/jit/jit_code_cache.h @@ -170,6 +170,13 @@ class JitCodeCache { REQUIRES(!lock_) REQUIRES_SHARED(Locks::mutator_lock_); + // Removes method from the cache for testing purposes. The caller + // must ensure that all threads are suspended and the method should + // not be in any thread's stack. + bool RemoveMethod(ArtMethod* method, bool release_memory) + REQUIRES(!lock_) + REQUIRES(Locks::mutator_lock_); + // Remove all methods in our cache that were allocated by 'alloc'. void RemoveMethodsIn(Thread* self, const LinearAlloc& alloc) REQUIRES(!lock_) -- cgit v1.2.3-59-g8ed1b