summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver-inl.h
diff options
context:
space:
mode:
authorMathieu Chartier <mathieuc@google.com>2015-10-14 10:55:30 -0700
committerMathieu Chartier <mathieuc@google.com>2015-10-15 08:38:29 -0700
commitd57d454a11ac6f49eaa397ec14d6231e3a2727b7 (patch)
treeab8e705584702d73a6f943a02838a3225b1a5118 /compiler/driver/compiler_driver-inl.h
parent2248d278460f18db9bcdc5a1bdb2dcdfdde2d301 (diff)
Allocate dex cache arrays in their class loader's linear alloc
Fixes memory leak for class unloading where the dex cache arrays used to be in the runtime linear alloc which never got freed. TODO: Some of the callers like the compiler just use the runtime linear alloc. We could clean this up if we want to have class unloading during compilation for some reason. Added regression test. Bug: 22720414 Change-Id: Ia50333a06a339efbdaedb5ad94b7a1ae841124ec
Diffstat (limited to 'compiler/driver/compiler_driver-inl.h')
-rw-r--r--compiler/driver/compiler_driver-inl.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h
index e535afd272..1a7dbe3a9f 100644
--- a/compiler/driver/compiler_driver-inl.h
+++ b/compiler/driver/compiler_driver-inl.h
@@ -370,7 +370,9 @@ inline int CompilerDriver::IsFastInvoke(
nullptr, kVirtual);
} else {
StackHandleScope<1> hs(soa.Self());
- auto target_dex_cache(hs.NewHandle(class_linker->RegisterDexFile(*devirt_target->dex_file)));
+ auto target_dex_cache(hs.NewHandle(class_linker->RegisterDexFile(
+ *devirt_target->dex_file,
+ class_linker->GetOrCreateAllocatorForClassLoader(class_loader.Get()))));
called_method = class_linker->ResolveMethod(
*devirt_target->dex_file, devirt_target->dex_method_index, target_dex_cache,
class_loader, nullptr, kVirtual);