summaryrefslogtreecommitdiff
path: root/runtime/class_linker.cc
diff options
context:
space:
mode:
author Treehugger Robot <treehugger-gerrit@google.com> 2017-07-25 04:49:59 +0000
committer Gerrit Code Review <noreply-gerritcodereview@google.com> 2017-07-25 04:49:59 +0000
commit5864ab200f0dc39a8a25e8c6328f70832bfd1a41 (patch)
tree4a498d4ace71fd1639435714dcad86eb44b89369 /runtime/class_linker.cc
parentc512a0f8961711c617a346263e5e7c59c514deff (diff)
parentcf79cf51feeea395a965c8dc452f86be60c00aab (diff)
Merge "Remove CHA dependencies for class unloading when JIT is disabled"
Diffstat (limited to 'runtime/class_linker.cc')
-rw-r--r--runtime/class_linker.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index c5e11f134e..74c04d19b6 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -2315,11 +2315,16 @@ void ClassLinker::DeleteClassLoader(Thread* self, const ClassLoaderData& data) {
JavaVMExt* const vm = runtime->GetJavaVM();
vm->DeleteWeakGlobalRef(self, data.weak_root);
// Notify the JIT that we need to remove the methods and/or profiling info.
+ ClassHierarchyAnalysis* const cha = runtime->GetClassHierarchyAnalysis();
if (runtime->GetJit() != nullptr) {
jit::JitCodeCache* code_cache = runtime->GetJit()->GetCodeCache();
if (code_cache != nullptr) {
+ // For the JIT case, RemoveMethodsIn removes the CHA dependencies.
code_cache->RemoveMethodsIn(self, *data.allocator);
}
+ } else {
+ // If we don't have a JIT, we need to manually remove the CHA dependencies manually.
+ cha->RemoveDependenciesForLinearAlloc(data.allocator);
}
delete data.allocator;
delete data.class_table;