From f284d448e3edd428b6ade473d0993028638b2064 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Thu, 2 Jun 2016 11:48:30 -0700 Subject: Hold dex caches live in class table Prevents temporary dex caches being unloaded for the same dex file. Usually this is OK, but if someone resolved a string in that dex cache, it could leave stale pointers in BSS. Also it can use extra memory in linear alloc if we allocate dex cache arrays multiple times. Bug: 29083330 Change-Id: Ia44668f013ceef1f5eb80f653a48d0f8004548c9 --- compiler/driver/compiler_driver-inl.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'compiler/driver/compiler_driver-inl.h') diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index 3cb63e7082..94f5acc2b6 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -390,9 +390,8 @@ inline int CompilerDriver::IsFastInvoke( *devirt_target->dex_file, devirt_target->dex_method_index, dex_cache, class_loader, nullptr, kVirtual); } else { - auto target_dex_cache(hs.NewHandle(class_linker->RegisterDexFile( - *devirt_target->dex_file, - class_linker->GetOrCreateAllocatorForClassLoader(class_loader.Get())))); + auto target_dex_cache(hs.NewHandle(class_linker->RegisterDexFile(*devirt_target->dex_file, + class_loader.Get()))); called_method = class_linker->ResolveMethod( *devirt_target->dex_file, devirt_target->dex_method_index, target_dex_cache, class_loader, nullptr, kVirtual); -- cgit v1.2.3-59-g8ed1b