diff options
| author | 2016-06-04 00:22:32 +0000 | |
|---|---|---|
| committer | 2016-06-04 00:22:32 +0000 | |
| commit | f102faf1bcbdb2149e3e7bf27b1819f621b7894b (patch) | |
| tree | d3e9d667bc7d746a0800e95d4ce78918718a9636 /compiler | |
| parent | d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e (diff) | |
Revert "Hold dex caches live in class table"
This reverts commit d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e.
Bug: 29083330
Change-Id: Ie209b27897b8079f2d13fd0837fe5f83a7e61afc
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/driver/compiler_driver-inl.h | 5 | ||||
| -rw-r--r-- | compiler/driver/compiler_driver.cc | 7 | ||||
| -rw-r--r-- | compiler/oat_test.cc | 7 |
3 files changed, 12 insertions, 7 deletions
diff --git a/compiler/driver/compiler_driver-inl.h b/compiler/driver/compiler_driver-inl.h index 94f5acc2b6..3cb63e7082 100644 --- a/compiler/driver/compiler_driver-inl.h +++ b/compiler/driver/compiler_driver-inl.h @@ -390,8 +390,9 @@ 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_loader.Get()))); + auto target_dex_cache(hs.NewHandle(class_linker->RegisterDexFile( + *devirt_target->dex_file, + class_linker->GetOrCreateAllocatorForClassLoader(class_loader.Get())))); called_method = class_linker->ResolveMethod<ClassLinker::kNoICCECheckForCache>( *devirt_target->dex_file, devirt_target->dex_method_index, target_dex_cache, class_loader, nullptr, kVirtual); diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index f88337ee6e..e366e071f5 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -1113,8 +1113,9 @@ 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, - nullptr))); + Handle<mirror::DexCache> dex_cache(hs2.NewHandle(class_linker->RegisterDexFile( + *dex_file, + Runtime::Current()->GetLinearAlloc()))); Handle<mirror::Class> klass(hs2.NewHandle( class_linker->ResolveType(*dex_file, exception_type_idx, @@ -2155,7 +2156,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_loader.Get()))); + class_linker->GetOrCreateAllocatorForClassLoader(class_loader.Get())))); mirror::Class* klass = class_linker->ResolveType(dex_file, type_idx, dex_cache, class_loader); if (klass == nullptr) { diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index 6d1f94491e..21e198c12f 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -199,7 +199,7 @@ class OatTest : public CommonCompilerTest { for (const std::unique_ptr<const DexFile>& dex_file : opened_dex_files) { dex_files.push_back(dex_file.get()); ScopedObjectAccess soa(Thread::Current()); - class_linker->RegisterDexFile(*dex_file, nullptr); + class_linker->RegisterDexFile(*dex_file, runtime->GetLinearAlloc()); } linker::MultiOatRelativePatcher patcher(compiler_driver_->GetInstructionSet(), instruction_set_features_.get()); @@ -491,7 +491,10 @@ TEST_F(OatTest, EmptyTextSection) { ClassLinker* const class_linker = Runtime::Current()->GetClassLinker(); for (const DexFile* dex_file : dex_files) { ScopedObjectAccess soa(Thread::Current()); - class_linker->RegisterDexFile(*dex_file, soa.Decode<mirror::ClassLoader*>(class_loader)); + class_linker->RegisterDexFile( + *dex_file, + class_linker->GetOrCreateAllocatorForClassLoader( + soa.Decode<mirror::ClassLoader*>(class_loader))); } compiler_driver_->SetDexFilesForOatFile(dex_files); compiler_driver_->CompileAll(class_loader, dex_files, &timings); |