From: Jeff Hao Date: Wed, 18 Jan 2017 01:43:29 +0000 (-0800) Subject: Merge layout-speed compiler filter into speed-profile. X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=c155b05481e5995a0aa1d8edaa5047bbdb631c6e;p=android-x86%2Fart.git Merge layout-speed compiler filter into speed-profile. Bug: 29921113 Test: mm test-art-host Change-Id: I2a22cbec7172f05e61b5e6d3d5dfc09026f92ec3 --- diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index e8a92c191..19f0f1c18 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -277,7 +277,6 @@ NO_RETURN static void Usage(const char* fmt, ...) { "|balanced" "|speed-profile" "|speed" - "|layout-profile" "|everything-profile" "|everything):"); UsageError(" select compiler filter."); @@ -1540,9 +1539,9 @@ class Dex2Oat FINAL { std::unique_ptr opened_dex_files_map; std::vector> opened_dex_files; // No need to verify the dex file for: - // 1) dexlayout, which already verified it + // 1) kSpeedProfile, since it includes dexlayout, which does the verification. // 2) when we have a vdex file, which means it was already verified. - bool verify = compiler_options_->GetCompilerFilter() != CompilerFilter::kLayoutProfile && + bool verify = compiler_options_->GetCompilerFilter() != CompilerFilter::kSpeedProfile && (input_vdex_file_ == nullptr); if (!oat_writers_[i]->WriteAndOpenDexFiles( kIsVdexEnabled ? vdex_files_[i].get() : oat_files_[i].get(), @@ -2349,7 +2348,7 @@ class Dex2Oat FINAL { compiler_options_.get(), oat_file.get())); elf_writers_.back()->Start(); - bool do_dexlayout = compiler_options_->GetCompilerFilter() == CompilerFilter::kLayoutProfile; + bool do_dexlayout = compiler_options_->GetCompilerFilter() == CompilerFilter::kSpeedProfile; oat_writers_.emplace_back(new OatWriter( IsBootImage(), timings_, do_dexlayout ? profile_compilation_info_.get() : nullptr)); } diff --git a/dex2oat/dex2oat_test.cc b/dex2oat/dex2oat_test.cc index e86e560b1..8933dd0f7 100644 --- a/dex2oat/dex2oat_test.cc +++ b/dex2oat/dex2oat_test.cc @@ -591,7 +591,7 @@ class Dex2oatLayoutTest : public Dex2oatTest { GenerateProfile(profile_location, dex_location, dex_file->GetLocationChecksum()); const std::vector& extra_args = { "--profile-file=" + profile_location }; - GenerateOdexForTest(dex_location, odex_location, CompilerFilter::kLayoutProfile, extra_args); + GenerateOdexForTest(dex_location, odex_location, CompilerFilter::kSpeedProfile, extra_args); CheckValidity(); ASSERT_TRUE(success_); @@ -632,7 +632,7 @@ class Dex2oatLayoutTest : public Dex2oatTest { EXPECT_EQ(old_class1, new_class0); } - EXPECT_EQ(odex_file->GetCompilerFilter(), CompilerFilter::kLayoutProfile); + EXPECT_EQ(odex_file->GetCompilerFilter(), CompilerFilter::kSpeedProfile); } // Check whether the dex2oat run was really successful. diff --git a/runtime/compiler_filter.cc b/runtime/compiler_filter.cc index dc89d32f5..cb8c11db9 100644 --- a/runtime/compiler_filter.cc +++ b/runtime/compiler_filter.cc @@ -33,7 +33,6 @@ bool CompilerFilter::IsBytecodeCompilationEnabled(Filter filter) { case CompilerFilter::kTime: case CompilerFilter::kSpeedProfile: case CompilerFilter::kSpeed: - case CompilerFilter::kLayoutProfile: case CompilerFilter::kEverythingProfile: case CompilerFilter::kEverything: return true; } @@ -53,7 +52,6 @@ bool CompilerFilter::IsJniCompilationEnabled(Filter filter) { case CompilerFilter::kTime: case CompilerFilter::kSpeedProfile: case CompilerFilter::kSpeed: - case CompilerFilter::kLayoutProfile: case CompilerFilter::kEverythingProfile: case CompilerFilter::kEverything: return true; } @@ -73,7 +71,6 @@ bool CompilerFilter::IsAnyMethodCompilationEnabled(Filter filter) { case CompilerFilter::kTime: case CompilerFilter::kSpeedProfile: case CompilerFilter::kSpeed: - case CompilerFilter::kLayoutProfile: case CompilerFilter::kEverythingProfile: case CompilerFilter::kEverything: return true; } @@ -93,7 +90,6 @@ bool CompilerFilter::IsVerificationEnabled(Filter filter) { case CompilerFilter::kTime: case CompilerFilter::kSpeedProfile: case CompilerFilter::kSpeed: - case CompilerFilter::kLayoutProfile: case CompilerFilter::kEverythingProfile: case CompilerFilter::kEverything: return true; } @@ -120,7 +116,6 @@ bool CompilerFilter::DependsOnProfile(Filter filter) { case CompilerFilter::kVerifyProfile: case CompilerFilter::kSpaceProfile: case CompilerFilter::kSpeedProfile: - case CompilerFilter::kLayoutProfile: case CompilerFilter::kEverythingProfile: return true; } UNREACHABLE(); @@ -145,7 +140,6 @@ CompilerFilter::Filter CompilerFilter::GetNonProfileDependentFilterFrom(Filter f return CompilerFilter::kSpace; case CompilerFilter::kSpeedProfile: - case CompilerFilter::kLayoutProfile: return CompilerFilter::kSpeed; case CompilerFilter::kEverythingProfile: @@ -171,7 +165,6 @@ std::string CompilerFilter::NameOfFilter(Filter filter) { case CompilerFilter::kTime: return "time"; case CompilerFilter::kSpeedProfile: return "speed-profile"; case CompilerFilter::kSpeed: return "speed"; - case CompilerFilter::kLayoutProfile: return "layout-profile"; case CompilerFilter::kEverythingProfile: return "everything-profile"; case CompilerFilter::kEverything: return "everything"; } @@ -199,8 +192,6 @@ bool CompilerFilter::ParseCompilerFilter(const char* option, Filter* filter) { *filter = kSpeed; } else if (strcmp(option, "speed-profile") == 0) { *filter = kSpeedProfile; - } else if (strcmp(option, "layout-profile") == 0) { - *filter = kLayoutProfile; } else if (strcmp(option, "everything") == 0) { *filter = kEverything; } else if (strcmp(option, "everything-profile") == 0) { diff --git a/runtime/compiler_filter.h b/runtime/compiler_filter.h index 7eb5f9a90..796f4aad0 100644 --- a/runtime/compiler_filter.h +++ b/runtime/compiler_filter.h @@ -39,7 +39,6 @@ class CompilerFilter FINAL { kSpace, // Maximize space savings. kBalanced, // Good performance return on compilation investment. kSpeedProfile, // Maximize runtime performance based on profile. - kLayoutProfile, // Temporary filter for dexlayout. Will be merged with kSpeedProfile. kSpeed, // Maximize runtime performance. kEverythingProfile, // Compile everything capable of being compiled based on profile. kEverything, // Compile everything capable of being compiled.