From 673ed3d8aedc5462a47ded827c99f35d46525457 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Fri, 28 Aug 2015 14:56:43 -0700 Subject: Revert "Revert "Change dex caches to be weak roots"" This reverts commit 81a9087f0df0518c39405b7d18ba5858a6d8b77b. Boot.oat creation time goes from 4.7s to 4.9s on host due to extra locking. Will try to improve this in another CL. Bug: 23602225 Bug: 22720414 Change-Id: I7e25b75cfb63faa196c7b0f60e46cce50bf12021 --- compiler/optimizing/builder.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'compiler/optimizing/builder.cc') diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc index 7b42db8a7f..23ab94e5fe 100644 --- a/compiler/optimizing/builder.cc +++ b/compiler/optimizing/builder.cc @@ -902,7 +902,7 @@ HClinitCheck* HGraphBuilder::ProcessClinitCheckForInvoke( StackHandleScope<4> hs(soa.Self()); Handle dex_cache(hs.NewHandle( dex_compilation_unit_->GetClassLinker()->FindDexCache( - *dex_compilation_unit_->GetDexFile()))); + soa.Self(), *dex_compilation_unit_->GetDexFile()))); Handle class_loader(hs.NewHandle( soa.Decode(dex_compilation_unit_->GetClassLoader()))); ArtMethod* resolved_method = compiler_driver_->ResolveMethod( @@ -912,7 +912,7 @@ HClinitCheck* HGraphBuilder::ProcessClinitCheckForInvoke( const DexFile& outer_dex_file = *outer_compilation_unit_->GetDexFile(); Handle outer_dex_cache(hs.NewHandle( - outer_compilation_unit_->GetClassLinker()->FindDexCache(outer_dex_file))); + outer_compilation_unit_->GetClassLinker()->FindDexCache(soa.Self(), outer_dex_file))); Handle outer_class(hs.NewHandle(GetOutermostCompilingClass())); // The index at which the method's class is stored in the DexCache's type array. @@ -1228,7 +1228,7 @@ static mirror::Class* GetClassFrom(CompilerDriver* driver, Handle class_loader(hs.NewHandle( soa.Decode(compilation_unit.GetClassLoader()))); Handle dex_cache(hs.NewHandle( - compilation_unit.GetClassLinker()->FindDexCache(dex_file))); + compilation_unit.GetClassLinker()->FindDexCache(soa.Self(), dex_file))); return driver->ResolveCompilingMethodsClass(soa, dex_cache, class_loader, &compilation_unit); } @@ -1245,7 +1245,8 @@ bool HGraphBuilder::IsOutermostCompilingClass(uint16_t type_index) const { ScopedObjectAccess soa(Thread::Current()); StackHandleScope<4> hs(soa.Self()); Handle dex_cache(hs.NewHandle( - dex_compilation_unit_->GetClassLinker()->FindDexCache(*dex_compilation_unit_->GetDexFile()))); + dex_compilation_unit_->GetClassLinker()->FindDexCache( + soa.Self(), *dex_compilation_unit_->GetDexFile()))); Handle class_loader(hs.NewHandle( soa.Decode(dex_compilation_unit_->GetClassLoader()))); Handle cls(hs.NewHandle(compiler_driver_->ResolveClass( @@ -1264,7 +1265,8 @@ bool HGraphBuilder::BuildStaticFieldAccess(const Instruction& instruction, ScopedObjectAccess soa(Thread::Current()); StackHandleScope<4> hs(soa.Self()); Handle dex_cache(hs.NewHandle( - dex_compilation_unit_->GetClassLinker()->FindDexCache(*dex_compilation_unit_->GetDexFile()))); + dex_compilation_unit_->GetClassLinker()->FindDexCache( + soa.Self(), *dex_compilation_unit_->GetDexFile()))); Handle class_loader(hs.NewHandle( soa.Decode(dex_compilation_unit_->GetClassLoader()))); ArtField* resolved_field = compiler_driver_->ResolveField( @@ -1277,7 +1279,7 @@ bool HGraphBuilder::BuildStaticFieldAccess(const Instruction& instruction, const DexFile& outer_dex_file = *outer_compilation_unit_->GetDexFile(); Handle outer_dex_cache(hs.NewHandle( - outer_compilation_unit_->GetClassLinker()->FindDexCache(outer_dex_file))); + outer_compilation_unit_->GetClassLinker()->FindDexCache(soa.Self(), outer_dex_file))); Handle outer_class(hs.NewHandle(GetOutermostCompilingClass())); // The index at which the field's class is stored in the DexCache's type array. -- cgit v1.2.3-59-g8ed1b