diff options
author | Mathieu Chartier <mathieuc@google.com> | 2015-08-14 14:03:10 -0700 |
---|---|---|
committer | Mathieu Chartier <mathieuc@google.com> | 2015-08-25 18:00:47 -0700 |
commit | 3ae6b1d42523bb2a0ddb5edff1aaf05b592f28f4 (patch) | |
tree | 9ae990956db3d2d5970fb15bf264aeeb73e2bfe0 /compiler/driver/compiler_driver-inl.h | |
parent | dcff51a0079c5e3abaf0335f7cb9a3dd44044456 (diff) |
Change dex caches to be weak roots
Changed dex caches to be weak roots. This is necessary for class
unloading since the resolved types arrays would keep classes live
when they should be unloaded. Currently the dex caches still don't
get freed due to the class loader roots.
Also deleted some unused functionality in image writer.
Bug: 22720414
Change-Id: If22cb3cad7e3baabc8158a77d7f20799faf4c341
Diffstat (limited to 'compiler/driver/compiler_driver-inl.h')
-rw-r--r-- | compiler/driver/compiler_driver-inl.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index 80387f2842..83f391de1a 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -31,7 +31,7 @@ namespace art { inline mirror::DexCache* CompilerDriver::GetDexCache(const DexCompilationUnit* mUnit) { - return mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile()); + return mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile(), false); } inline mirror::ClassLoader* CompilerDriver::GetClassLoader(ScopedObjectAccess& soa, @@ -87,7 +87,7 @@ inline ArtField* CompilerDriver::ResolveFieldWithDexFile( } inline mirror::DexCache* CompilerDriver::FindDexCache(const DexFile* dex_file) { - return Runtime::Current()->GetClassLinker()->FindDexCache(*dex_file); + return Runtime::Current()->GetClassLinker()->FindDexCache(*dex_file, false); } inline ArtField* CompilerDriver::ResolveField( @@ -339,7 +339,7 @@ inline int CompilerDriver::IsFastInvoke( // Sharpen a virtual call into a direct call. The method_idx is into referrer's // dex cache, check that this resolved method is where we expect it. CHECK_EQ(target_method->dex_file, mUnit->GetDexFile()); - DCHECK_EQ(dex_cache.Get(), mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile())); + DCHECK_EQ(dex_cache.Get(), mUnit->GetClassLinker()->FindDexCache(*mUnit->GetDexFile(), false)); CHECK_EQ(referrer_class->GetDexCache()->GetResolvedMethod( target_method->dex_method_index, pointer_size), resolved_method) << PrettyMethod(resolved_method); @@ -369,7 +369,7 @@ inline int CompilerDriver::IsFastInvoke( nullptr, kVirtual); } else { StackHandleScope<1> hs(soa.Self()); - auto target_dex_cache(hs.NewHandle(class_linker->FindDexCache(*devirt_target->dex_file))); + auto target_dex_cache(hs.NewHandle(class_linker->RegisterDexFile(*devirt_target->dex_file))); called_method = class_linker->ResolveMethod( *devirt_target->dex_file, devirt_target->dex_method_index, target_dex_cache, class_loader, nullptr, kVirtual); |