summaryrefslogtreecommitdiff
path: root/runtime/jit/jit_code_cache.h
diff options
context:
space:
mode:
authorDavid Srbecky <dsrbecky@google.com>2020-02-20 20:27:58 +0000
committerDavid Srbecky <dsrbecky@google.com>2020-03-12 12:10:49 +0000
commit30fd85157260c91327c6b5a0816d312dd505c0e0 (patch)
tree355823ab233177d529baa873911cf08bb5b5deec /runtime/jit/jit_code_cache.h
parent80dc7dc20855bf680fa598127f26e6047821bdd0 (diff)
downloadart-30fd85157260c91327c6b5a0816d312dd505c0e0.tar.gz
Refactor RemoveNativeDebugInfoForJit.
This is partial revert of CL/1099280 (Remove global maps). It somewhat resurrects the lazy method removal. The original goal was to only remove methods from the GC, and do all of them in bulk for simplicity and efficiency. However, this is proving infeasible since we have several corner cases which remove methods outside the GC code path. The behaviour for the GC code path is preserved by this CL. Instead of passing method array, the methods are individually marked for removal and then repacking is immediately forced. The only difference is that coroner cases are done lazily. Test: ./art/test.py -b -r --host --jit --64 Change-Id: I42729545d6b51df788d92f9cf149a6e065b90c68
Diffstat (limited to 'runtime/jit/jit_code_cache.h')
-rw-r--r--runtime/jit/jit_code_cache.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/jit/jit_code_cache.h b/runtime/jit/jit_code_cache.h
index d8216d2cf5..f46dc75d58 100644
--- a/runtime/jit/jit_code_cache.h
+++ b/runtime/jit/jit_code_cache.h
@@ -276,6 +276,9 @@ class JitCodeCache {
void Free(Thread* self, JitMemoryRegion* region, const uint8_t* code, const uint8_t* data)
REQUIRES_SHARED(Locks::mutator_lock_)
REQUIRES(!Locks::jit_lock_);
+ void FreeLocked(JitMemoryRegion* region, const uint8_t* code, const uint8_t* data)
+ REQUIRES_SHARED(Locks::mutator_lock_)
+ REQUIRES(Locks::jit_lock_);
// Perform a collection on the code cache.
void GarbageCollectCache(Thread* self)
@@ -422,6 +425,7 @@ class JitCodeCache {
// Remove CHA dependents and underlying allocations for entries in `method_headers`.
void FreeAllMethodHeaders(const std::unordered_set<OatQuickMethodHeader*>& method_headers)
+ REQUIRES_SHARED(Locks::mutator_lock_)
REQUIRES(!Locks::jit_lock_)
REQUIRES(!Locks::cha_lock_);
@@ -432,8 +436,9 @@ class JitCodeCache {
REQUIRES(Locks::mutator_lock_);
// Free code and data allocations for `code_ptr`.
- void FreeCodeAndData(const void* code_ptr, bool free_debug_info = true)
- REQUIRES(Locks::jit_lock_);
+ void FreeCodeAndData(const void* code_ptr)
+ REQUIRES(Locks::jit_lock_)
+ REQUIRES_SHARED(Locks::mutator_lock_);
// Number of bytes allocated in the code cache.
size_t CodeCacheSize() REQUIRES(!Locks::jit_lock_);