diff options
Diffstat (limited to 'dex2oat')
| -rw-r--r-- | dex2oat/dex2oat.cc | 35 | ||||
| -rw-r--r-- | dex2oat/dex2oat_test.cc | 6 |
2 files changed, 17 insertions, 24 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index e8a92c1914..196d8d4220 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."); @@ -1283,13 +1282,10 @@ class Dex2Oat FINAL { DCHECK_EQ(input_vdex_fd_, -1); if (!input_vdex_.empty()) { std::string error_msg; - input_vdex_file_.reset(VdexFile::Open(input_vdex_, - /* writable */ false, - /* low_4gb */ false, - &error_msg)); - if (input_vdex_file_ != nullptr && !input_vdex_file_->IsValid()) { - input_vdex_file_.reset(nullptr); - } + input_vdex_file_ = VdexFile::Open(input_vdex_, + /* writable */ false, + /* low_4gb */ false, + &error_msg); } DCHECK_EQ(output_vdex_fd_, -1); @@ -1331,19 +1327,16 @@ class Dex2Oat FINAL { PLOG(WARNING) << "Failed getting length of vdex file"; } else { std::string error_msg; - input_vdex_file_.reset(VdexFile::Open(input_vdex_fd_, - s.st_size, - "vdex", - /* writable */ false, - /* low_4gb */ false, - &error_msg)); + input_vdex_file_ = VdexFile::Open(input_vdex_fd_, + s.st_size, + "vdex", + /* writable */ false, + /* low_4gb */ false, + &error_msg); // If there's any problem with the passed vdex, just warn and proceed // without it. if (input_vdex_file_ == nullptr) { - PLOG(WARNING) << "Failed opening vdex file " << error_msg; - } else if (!input_vdex_file_->IsValid()) { - PLOG(WARNING) << "Existing vdex file is invalid"; - input_vdex_file_.reset(nullptr); + PLOG(WARNING) << "Failed opening vdex file: " << error_msg; } } } @@ -1540,9 +1533,9 @@ class Dex2Oat FINAL { std::unique_ptr<MemMap> opened_dex_files_map; std::vector<std::unique_ptr<const DexFile>> 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 +2342,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 e86e560b1a..c2275aca95 100644 --- a/dex2oat/dex2oat_test.cc +++ b/dex2oat/dex2oat_test.cc @@ -125,7 +125,7 @@ class Dex2oatTest : public Dex2oatEnvironmentTest { class_path = OatFile::kSpecialSharedLibrary; } argv.push_back(class_path); - if (runtime->IsDebuggable()) { + if (runtime->IsJavaDebuggable()) { argv.push_back("--debuggable"); } runtime->AddCurrentRuntimeFeaturesAsDex2OatArguments(&argv); @@ -591,7 +591,7 @@ class Dex2oatLayoutTest : public Dex2oatTest { GenerateProfile(profile_location, dex_location, dex_file->GetLocationChecksum()); const std::vector<std::string>& 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. |