From 213ee2da6a1c58d0fc12c937bbd9c9974ca00aca Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 22 Jun 2018 11:56:34 +0100 Subject: Move dex_files_for_oat_file_ to CompilerOptions. A step toward removing the CompilerDriver dependency from several classes, including HSharpening and ImageWriter. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: I364ef66511fdf855cb11b12c818a40572b037727 --- compiler/optimizing/sharpening.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'compiler/optimizing/sharpening.cc') diff --git a/compiler/optimizing/sharpening.cc b/compiler/optimizing/sharpening.cc index ebac3f6854..1e29c21313 100644 --- a/compiler/optimizing/sharpening.cc +++ b/compiler/optimizing/sharpening.cc @@ -191,14 +191,14 @@ HLoadClass::LoadKind HSharpening::ComputeLoadClassKind( desired_load_kind = HLoadClass::LoadKind::kBootImageLinkTimePcRelative; } else { // Not a boot image class. - DCHECK(ContainsElement(compiler_driver->GetDexFilesForOatFile(), &dex_file)); + DCHECK(ContainsElement(compiler_options.GetDexFilesForOatFile(), &dex_file)); desired_load_kind = HLoadClass::LoadKind::kBssEntry; } } else { is_in_boot_image = (klass != nullptr) && runtime->GetHeap()->ObjectIsInBootImageSpace(klass.Get()); if (runtime->UseJitCompilation()) { - DCHECK(!codegen->GetCompilerOptions().GetCompilePic()); + DCHECK(!compiler_options.GetCompilePic()); if (is_in_boot_image) { // TODO: Use direct pointers for all non-moving spaces, not just boot image. Bug: 29530787 desired_load_kind = HLoadClass::LoadKind::kBootImageAddress; @@ -331,14 +331,15 @@ void HSharpening::ProcessLoadString( : hs.NewHandle(class_linker->FindDexCache(soa.Self(), dex_file)); ObjPtr string = nullptr; - if (codegen->GetCompilerOptions().IsBootImage()) { + const CompilerOptions& compiler_options = codegen->GetCompilerOptions(); + if (compiler_options.IsBootImage()) { // Compiling boot image. Resolve the string and allocate it if needed, to ensure // the string will be added to the boot image. DCHECK(!runtime->UseJitCompilation()); string = class_linker->ResolveString(string_index, dex_cache); CHECK(string != nullptr); if (compiler_driver->GetSupportBootImageFixup()) { - DCHECK(ContainsElement(compiler_driver->GetDexFilesForOatFile(), &dex_file)); + DCHECK(ContainsElement(compiler_options.GetDexFilesForOatFile(), &dex_file)); desired_load_kind = HLoadString::LoadKind::kBootImageLinkTimePcRelative; } else { // compiler_driver_test. Do not sharpen. -- cgit v1.2.3-59-g8ed1b