summaryrefslogtreecommitdiff
path: root/runtime/jit/jit_code_cache.cc
diff options
context:
space:
mode:
author David Srbecky <dsrbecky@google.com> 2018-01-19 17:38:06 +0000
committer David Srbecky <dsrbecky@google.com> 2018-01-19 17:42:54 +0000
commitc684f337eae6bd3d77fa44cb568d2bab113e4cee (patch)
tree21c3e40cc150da71d91aef03f33010813f3a8368 /runtime/jit/jit_code_cache.cc
parent26037dd60df16d84fbd5c0ee3215b78aa2bcb408 (diff)
Refactor jit debugger interface and its ELF creation.
Make it possible to store more then one method per entry, and ref-count the number of live methods per entry. Test: m test-art-host-gtest Change-Id: I45d69185e85e47fbee88a8d1f549ede9875a3c0a
Diffstat (limited to 'runtime/jit/jit_code_cache.cc')
-rw-r--r--runtime/jit/jit_code_cache.cc6
1 files changed, 5 insertions, 1 deletions
diff --git a/runtime/jit/jit_code_cache.cc b/runtime/jit/jit_code_cache.cc
index 659c55a289..e41667a5bf 100644
--- a/runtime/jit/jit_code_cache.cc
+++ b/runtime/jit/jit_code_cache.cc
@@ -549,7 +549,11 @@ void JitCodeCache::FreeCode(const void* code_ptr) {
uintptr_t allocation = FromCodeToAllocation(code_ptr);
// Notify native debugger that we are about to remove the code.
// It does nothing if we are not using native debugger.
- DeleteJITCodeEntryForAddress(reinterpret_cast<uintptr_t>(code_ptr));
+ MutexLock mu(Thread::Current(), g_jit_debug_mutex);
+ JITCodeEntry* entry = GetJITCodeEntry(reinterpret_cast<uintptr_t>(code_ptr));
+ if (entry != nullptr) {
+ DecrementJITCodeEntryRefcount(entry, reinterpret_cast<uintptr_t>(code_ptr));
+ }
if (OatQuickMethodHeader::FromCodePointer(code_ptr)->IsOptimized()) {
FreeData(GetRootTable(code_ptr));
} // else this is a JNI stub without any data.