summaryrefslogtreecommitdiff
path: root/compiler/driver/compiler_driver.cc
diff options
context:
space:
mode:
author Mathieu Chartier <mathieuc@google.com> 2016-06-02 11:48:30 -0700
committer Mathieu Chartier <mathieuc@google.com> 2016-06-03 12:45:04 -0700
commitd6d49e56c2b7b11f474acb80cb02bb1fe9b7861e (patch)
treeb6df3e71798c9a547e56dcbe7d7b7a6f3dc003a2 /compiler/driver/compiler_driver.cc
parentb089eccf503646e6ed2d5bb20d973d9131166655 (diff)
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 (cherry picked from commit f284d448e3edd428b6ade473d0993028638b2064) Change-Id: Ie1b0b0cf835a998e19227cbb90014011a6cd40c4
Diffstat (limited to 'compiler/driver/compiler_driver.cc')
-rw-r--r--compiler/driver/compiler_driver.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc
index e366e071f5..f88337ee6e 100644
--- a/compiler/driver/compiler_driver.cc
+++ b/compiler/driver/compiler_driver.cc
@@ -1113,9 +1113,8 @@ void CompilerDriver::LoadImageClasses(TimingLogger* timings) {
uint16_t exception_type_idx = exception_type.first;
const DexFile* dex_file = exception_type.second;
StackHandleScope<2> hs2(self);
- Handle<mirror::DexCache> dex_cache(hs2.NewHandle(class_linker->RegisterDexFile(
- *dex_file,
- Runtime::Current()->GetLinearAlloc())));
+ Handle<mirror::DexCache> dex_cache(hs2.NewHandle(class_linker->RegisterDexFile(*dex_file,
+ nullptr)));
Handle<mirror::Class> klass(hs2.NewHandle(
class_linker->ResolveType(*dex_file,
exception_type_idx,
@@ -2156,7 +2155,7 @@ class ResolveTypeVisitor : public CompilationVisitor {
hs.NewHandle(soa.Decode<mirror::ClassLoader*>(manager_->GetClassLoader())));
Handle<mirror::DexCache> dex_cache(hs.NewHandle(class_linker->RegisterDexFile(
dex_file,
- class_linker->GetOrCreateAllocatorForClassLoader(class_loader.Get()))));
+ class_loader.Get())));
mirror::Class* klass = class_linker->ResolveType(dex_file, type_idx, dex_cache, class_loader);
if (klass == nullptr) {