Do not return patchoat for dexopt needed.
Dex preopt now always compiles PIC, so patchoat is no longer needed to
relocate prebuilts on first boot or system update when the boot image is
relocated.
The only remaining case when patchoat would be used on oat files is the rare,
unexpected case when something bad happens to the device, such as a boot loop,
to cause the prebuilt boot image to be relocated again. In this case, non-PIC
oat files compiled on device may have up-to-date dex and image checksums but
wrong patch deltas. In this case, it is fine to recompile the oat file from
scratch using dex2oat rather than using patchoat.
Test: oat_file_assistant_test
Bug: 33192586
Change-Id: If3f2457c7b358e1328476a460a0f15bfa89b7def
diff --git a/runtime/oat.cc b/runtime/oat.cc
index cebe765..1a07cdc 100644
--- a/runtime/oat.cc
+++ b/runtime/oat.cc
@@ -469,10 +469,6 @@
return IsKeyEnabled(OatHeader::kPicKey);
}
-bool OatHeader::HasPatchInfo() const {
- return IsKeyEnabled(OatHeader::kHasPatchInfoKey);
-}
-
bool OatHeader::IsDebuggable() const {
return IsKeyEnabled(OatHeader::kDebuggableKey);
}
diff --git a/runtime/oat.h b/runtime/oat.h
index 0f4cbbb..1fd906d 100644
--- a/runtime/oat.h
+++ b/runtime/oat.h
@@ -32,13 +32,12 @@
class PACKED(4) OatHeader {
public:
static constexpr uint8_t kOatMagic[] = { 'o', 'a', 't', '\n' };
- static constexpr uint8_t kOatVersion[] = { '0', '9', '3', '\0' };
+ static constexpr uint8_t kOatVersion[] = { '0', '9', '4', '\0' };
static constexpr const char* kImageLocationKey = "image-location";
static constexpr const char* kDex2OatCmdLineKey = "dex2oat-cmdline";
static constexpr const char* kDex2OatHostKey = "dex2oat-host";
static constexpr const char* kPicKey = "pic";
- static constexpr const char* kHasPatchInfoKey = "has-patch-info";
static constexpr const char* kDebuggableKey = "debuggable";
static constexpr const char* kNativeDebuggableKey = "native-debuggable";
static constexpr const char* kCompilerFilter = "compiler-filter";
@@ -110,7 +109,6 @@
size_t GetHeaderSize() const;
bool IsPic() const;
- bool HasPatchInfo() const;
bool IsDebuggable() const;
bool IsNativeDebuggable() const;
CompilerFilter::Filter GetCompilerFilter() const;
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 0bf7136..611df6f 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -1438,10 +1438,6 @@
method->SetEntryPointFromQuickCompiledCode(GetQuickCode());
}
-bool OatFile::HasPatchInfo() const {
- return GetOatHeader().HasPatchInfo();
-}
-
bool OatFile::IsPic() const {
return GetOatHeader().IsPic();
// TODO: Check against oat_patches. b/18144996
diff --git a/runtime/oat_file.h b/runtime/oat_file.h
index 29add5b..62d99fb 100644
--- a/runtime/oat_file.h
+++ b/runtime/oat_file.h
@@ -104,8 +104,6 @@
return is_executable_;
}
- bool HasPatchInfo() const;
-
bool IsPic() const;
// Indicates whether the oat file was compiled with full debugging capability.
diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc
index ee7cf9d..f12a5e7 100644
--- a/runtime/oat_file_assistant.cc
+++ b/runtime/oat_file_assistant.cc
@@ -203,10 +203,6 @@
case kDex2OatForRelocation:
case kDex2OatForFilter:
return GenerateOatFile(error_msg);
-
- case kPatchoatForRelocation: {
- return RelocateOatFile(info.Filename(), error_msg);
- }
}
UNREACHABLE();
}
@@ -420,58 +416,6 @@
}
OatFileAssistant::ResultOfAttemptToUpdate
-OatFileAssistant::RelocateOatFile(const std::string* input_file, std::string* error_msg) {
- CHECK(error_msg != nullptr);
-
- if (input_file == nullptr) {
- *error_msg = "Patching of oat file for dex location " + dex_location_
- + " not attempted because the input file name could not be determined.";
- return kUpdateNotAttempted;
- }
- const std::string& input_file_name = *input_file;
-
- if (oat_.Filename() == nullptr) {
- *error_msg = "Patching of oat file for dex location " + dex_location_
- + " not attempted because the oat file name could not be determined.";
- return kUpdateNotAttempted;
- }
- const std::string& oat_file_name = *oat_.Filename();
-
- const ImageInfo* image_info = GetImageInfo();
- Runtime* runtime = Runtime::Current();
- if (image_info == nullptr) {
- *error_msg = "Patching of oat file " + oat_file_name
- + " not attempted because no image location was found.";
- return kUpdateNotAttempted;
- }
-
- if (!runtime->IsDex2OatEnabled()) {
- *error_msg = "Patching of oat file " + oat_file_name
- + " not attempted because dex2oat is disabled";
- return kUpdateNotAttempted;
- }
-
- std::vector<std::string> argv;
- argv.push_back(runtime->GetPatchoatExecutable());
- argv.push_back("--instruction-set=" + std::string(GetInstructionSetString(isa_)));
- argv.push_back("--input-oat-file=" + input_file_name);
- argv.push_back("--output-oat-file=" + oat_file_name);
- argv.push_back("--patched-image-location=" + image_info->location);
-
- std::string command_line(android::base::Join(argv, ' '));
- if (!Exec(argv, error_msg)) {
- // Manually delete the file. This ensures there is no garbage left over if
- // the process unexpectedly died.
- unlink(oat_file_name.c_str());
- return kUpdateFailed;
- }
-
- // Mark that the oat file has changed and we should try to reload.
- oat_.Reset();
- return kUpdateSucceeded;
-}
-
-OatFileAssistant::ResultOfAttemptToUpdate
OatFileAssistant::GenerateOatFile(std::string* error_msg) {
CHECK(error_msg != nullptr);
@@ -852,13 +796,7 @@
return kNoDexOptNeeded;
}
- if (filter_okay && Status() == kOatRelocationOutOfDate && HasPatchInfo()) {
- return kPatchoatForRelocation;
- }
-
if (oat_file_assistant_->HasOriginalDexFiles()) {
- // Run dex2oat for relocation if we didn't have the patch info necessary
- // to use patchoat.
if (filter_okay && Status() == kOatRelocationOutOfDate) {
return kDex2OatForRelocation;
}
@@ -921,11 +859,6 @@
return (file != nullptr && file->IsExecutable());
}
-bool OatFileAssistant::OatFileInfo::HasPatchInfo() {
- const OatFile* file = GetFile();
- return (file != nullptr && file->HasPatchInfo());
-}
-
void OatFileAssistant::OatFileInfo::Reset() {
load_attempted_ = false;
file_.reset();
diff --git a/runtime/oat_file_assistant.h b/runtime/oat_file_assistant.h
index bed1edc..588a698 100644
--- a/runtime/oat_file_assistant.h
+++ b/runtime/oat_file_assistant.h
@@ -67,14 +67,9 @@
kDex2OatForFilter = 3,
// dex2oat should be run to update the apk/jar because the existing code
- // is not relocated to match the boot image and does not have the
- // necessary patch information to use patchoat.
+ // is not relocated to match the boot image.
// Matches Java: dalvik.system.DexFile.DEX2OAT_FOR_RELOCATION
kDex2OatForRelocation = 4,
-
- // patchoat should be run to update the apk/jar.
- // Matches Java: dalvik.system.DexFile.PATCHOAT_FOR_RELOCATION
- kPatchoatForRelocation = 5,
};
enum OatStatus {
@@ -237,15 +232,6 @@
// Returns the status of the oat file for the dex location.
OatStatus OatFileStatus();
- // Generates the oat file by relocation from the named input file.
- // This does not check the current status before attempting to relocate the
- // oat file.
- //
- // If the result is not kUpdateSucceeded, the value of error_msg will be set
- // to a string describing why there was a failure or the update was not
- // attempted. error_msg must not be null.
- ResultOfAttemptToUpdate RelocateOatFile(const std::string* input_file, std::string* error_msg);
-
// Generate the oat file from the dex file using the current runtime
// compiler options.
// This does not check the current status before attempting to generate the
@@ -328,8 +314,6 @@
// given target_compilation_filter.
// profile_changed should be true to indicate the profile has recently
// changed for this dex location.
- // If patchoat is needed, this function will return the kPatchOatNeeded
- // status, not the kSelfPatchOatNeeded status.
DexOptNeeded GetDexOptNeeded(CompilerFilter::Filter target_compiler_filter,
bool profile_changed);
@@ -341,9 +325,6 @@
// Returns true if the file is opened executable.
bool IsExecutable();
- // Returns true if the file has patch info required to run patchoat.
- bool HasPatchInfo();
-
// Clear any cached information about the file that depends on the
// contents of the file. This does not reset the provided filename.
void Reset();
diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc
index 26dbaab..afa804c 100644
--- a/runtime/oat_file_assistant_test.cc
+++ b/runtime/oat_file_assistant_test.cc
@@ -85,7 +85,6 @@
CompilerFilter::Filter filter,
bool relocate,
bool pic,
- bool with_patch_info,
bool with_alternate_image) {
std::string dalvik_cache = GetDalvikCache(GetInstructionSetString(kRuntimeISA));
std::string dalvik_cache_tmp = dalvik_cache + ".redirected";
@@ -111,10 +110,6 @@
args.push_back("--compile-pic");
}
- if (with_patch_info) {
- args.push_back("--include-patch-information");
- }
-
std::string image_location = GetImageLocation();
if (with_alternate_image) {
args.push_back("--boot-image=" + GetImageLocation2());
@@ -139,7 +134,6 @@
&error_msg));
ASSERT_TRUE(odex_file.get() != nullptr) << error_msg;
EXPECT_EQ(pic, odex_file->IsPic());
- EXPECT_EQ(with_patch_info, odex_file->HasPatchInfo());
EXPECT_EQ(filter, odex_file->GetCompilerFilter());
std::unique_ptr<ImageHeader> image_header(
@@ -181,7 +175,6 @@
filter,
/*relocate*/false,
/*pic*/false,
- /*with_patch_info*/true,
/*with_alternate_image*/false);
}
@@ -193,21 +186,6 @@
filter,
/*relocate*/false,
/*pic*/true,
- /*with_patch_info*/false,
- /*with_alternate_image*/false);
- }
-
- // Generate a non-PIC odex file without patch information for the purposes
- // of test. The generated odex file will be un-relocated.
- void GenerateNoPatchOdexForTest(const std::string& dex_location,
- const std::string& odex_location,
- CompilerFilter::Filter filter) {
- GenerateOatForTest(dex_location,
- odex_location,
- filter,
- /*relocate*/false,
- /*pic*/false,
- /*with_patch_info*/false,
/*with_alternate_image*/false);
}
@@ -216,7 +194,6 @@
CompilerFilter::Filter filter,
bool relocate,
bool pic,
- bool with_patch_info,
bool with_alternate_image) {
std::string oat_location;
std::string error_msg;
@@ -227,7 +204,6 @@
filter,
relocate,
pic,
- with_patch_info,
with_alternate_image);
}
@@ -237,7 +213,6 @@
filter,
/*relocate*/true,
/*pic*/false,
- /*with_patch_info*/false,
/*with_alternate_image*/false);
}
@@ -519,7 +494,6 @@
CompilerFilter::kSpeed,
/*relocate*/true,
/*pic*/false,
- /*with_patch_info*/false,
/*with_alternate_image*/true);
OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, false);
@@ -548,7 +522,6 @@
CompilerFilter::kVerifyAtRuntime,
/*relocate*/true,
/*pic*/false,
- /*with_patch_info*/false,
/*with_alternate_image*/true);
OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, false);
@@ -564,7 +537,6 @@
}
// Case: We have a DEX file and an ODEX file, but no OAT file.
-// Expect: The status is kPatchOatNeeded.
TEST_F(OatFileAssistantTest, DexOdexNoOat) {
std::string dex_location = GetScratchDir() + "/DexOdexNoOat.jar";
std::string odex_location = GetOdexDir() + "/DexOdexNoOat.odex";
@@ -578,7 +550,7 @@
EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded,
oat_file_assistant.GetDexOptNeeded(CompilerFilter::kVerifyAtRuntime));
- EXPECT_EQ(-OatFileAssistant::kPatchoatForRelocation,
+ EXPECT_EQ(-OatFileAssistant::kDex2OatForRelocation,
oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
@@ -591,15 +563,14 @@
ASSERT_TRUE(oat_file.get() != nullptr);
}
-// Case: We have a stripped DEX file and an ODEX file, but no OAT file.
-// Expect: The status is kPatchOatNeeded
+// Case: We have a stripped DEX file and a PIC ODEX file, but no OAT file.
TEST_F(OatFileAssistantTest, StrippedDexOdexNoOat) {
std::string dex_location = GetScratchDir() + "/StrippedDexOdexNoOat.jar";
std::string odex_location = GetOdexDir() + "/StrippedDexOdexNoOat.odex";
// Create the dex and odex files
Copy(GetDexSrc1(), dex_location);
- GenerateOdexForTest(dex_location, odex_location, CompilerFilter::kSpeed);
+ GeneratePicOdexForTest(dex_location, odex_location, CompilerFilter::kSpeed);
// Strip the dex file
Copy(GetStrippedDexSrc1(), dex_location);
@@ -607,28 +578,14 @@
// Verify the status.
OatFileAssistant oat_file_assistant(dex_location.c_str(), kRuntimeISA, true);
- EXPECT_EQ(-OatFileAssistant::kPatchoatForRelocation,
+ EXPECT_EQ(-OatFileAssistant::kNoDexOptNeeded,
oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
- EXPECT_EQ(OatFileAssistant::kOatRelocationOutOfDate, oat_file_assistant.OdexFileStatus());
+ EXPECT_EQ(OatFileAssistant::kOatUpToDate, oat_file_assistant.OdexFileStatus());
EXPECT_EQ(OatFileAssistant::kOatCannotOpen, oat_file_assistant.OatFileStatus());
EXPECT_FALSE(oat_file_assistant.HasOriginalDexFiles());
- // Make the oat file up to date.
- std::string error_msg;
- Runtime::Current()->AddCompilerOption("--compiler-filter=speed");
- ASSERT_EQ(OatFileAssistant::kUpdateSucceeded,
- oat_file_assistant.MakeUpToDate(false, &error_msg)) << error_msg;
-
- EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
-
- EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
- EXPECT_EQ(OatFileAssistant::kOatRelocationOutOfDate, oat_file_assistant.OdexFileStatus());
- EXPECT_EQ(OatFileAssistant::kOatUpToDate, oat_file_assistant.OatFileStatus());
- EXPECT_FALSE(oat_file_assistant.HasOriginalDexFiles());
-
// Verify we can load the dex files from it.
std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile();
ASSERT_TRUE(oat_file.get() != nullptr);
@@ -638,8 +595,7 @@
EXPECT_EQ(1u, dex_files.size());
}
-// Case: We have a stripped DEX file, an ODEX file, and an out-of-date OAT file.
-// Expect: The status is kPatchOatNeeded.
+// Case: We have a stripped DEX file, a PIC ODEX file, and an out-of-date OAT file.
TEST_F(OatFileAssistantTest, StrippedDexOdexOat) {
std::string dex_location = GetScratchDir() + "/StrippedDexOdexOat.jar";
std::string odex_location = GetOdexDir() + "/StrippedDexOdexOat.odex";
@@ -650,7 +606,7 @@
// Create the odex file
Copy(GetDexSrc1(), dex_location);
- GenerateOdexForTest(dex_location, odex_location, CompilerFilter::kSpeed);
+ GeneratePicOdexForTest(dex_location, odex_location, CompilerFilter::kSpeed);
// Strip the dex file.
Copy(GetStrippedDexSrc1(), dex_location);
@@ -660,30 +616,14 @@
EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded,
oat_file_assistant.GetDexOptNeeded(CompilerFilter::kVerifyAtRuntime));
- EXPECT_EQ(-OatFileAssistant::kPatchoatForRelocation,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
- EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, // Can't run dex2oat because dex file is stripped.
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kEverything));
-
- EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
- EXPECT_EQ(OatFileAssistant::kOatRelocationOutOfDate, oat_file_assistant.OdexFileStatus());
- EXPECT_EQ(OatFileAssistant::kOatDexOutOfDate, oat_file_assistant.OatFileStatus());
- EXPECT_FALSE(oat_file_assistant.HasOriginalDexFiles());
-
- // Make the oat file up to date.
- std::string error_msg;
- Runtime::Current()->AddCompilerOption("--compiler-filter=speed");
- ASSERT_EQ(OatFileAssistant::kUpdateSucceeded,
- oat_file_assistant.MakeUpToDate(false, &error_msg)) << error_msg;
-
EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded,
oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded, // Can't run dex2oat because dex file is stripped.
oat_file_assistant.GetDexOptNeeded(CompilerFilter::kEverything));
EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
- EXPECT_EQ(OatFileAssistant::kOatRelocationOutOfDate, oat_file_assistant.OdexFileStatus());
- EXPECT_EQ(OatFileAssistant::kOatUpToDate, oat_file_assistant.OatFileStatus());
+ EXPECT_EQ(OatFileAssistant::kOatUpToDate, oat_file_assistant.OdexFileStatus());
+ EXPECT_EQ(OatFileAssistant::kOatDexOutOfDate, oat_file_assistant.OatFileStatus());
EXPECT_FALSE(oat_file_assistant.HasOriginalDexFiles());
// Verify we can load the dex files from it.
@@ -732,90 +672,9 @@
EXPECT_FALSE(oat_file_assistant.HasOriginalDexFiles());
}
-// Case: We have a DEX file, no ODEX file and an OAT file that needs
-// relocation.
-// Expect: The status is kSelfPatchOatNeeded.
-TEST_F(OatFileAssistantTest, SelfRelocation) {
- std::string dex_location = GetScratchDir() + "/SelfRelocation.jar";
- std::string oat_location = GetOdexDir() + "/SelfRelocation.oat";
-
- // Create the dex and odex files
- Copy(GetDexSrc1(), dex_location);
- GenerateOdexForTest(dex_location, oat_location, CompilerFilter::kSpeed);
-
- OatFileAssistant oat_file_assistant(dex_location.c_str(),
- oat_location.c_str(), kRuntimeISA, true);
-
- EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kInterpretOnly));
- EXPECT_EQ(OatFileAssistant::kPatchoatForRelocation,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
- EXPECT_EQ(OatFileAssistant::kDex2OatForFilter,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kEverything));
-
- EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
- EXPECT_EQ(OatFileAssistant::kOatCannotOpen, oat_file_assistant.OdexFileStatus());
- EXPECT_EQ(OatFileAssistant::kOatRelocationOutOfDate, oat_file_assistant.OatFileStatus());
- EXPECT_TRUE(oat_file_assistant.HasOriginalDexFiles());
-
- // Make the oat file up to date.
- std::string error_msg;
- Runtime::Current()->AddCompilerOption("--compiler-filter=speed");
- ASSERT_EQ(OatFileAssistant::kUpdateSucceeded,
- oat_file_assistant.MakeUpToDate(false, &error_msg)) << error_msg;
-
- EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
-
- EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
- EXPECT_EQ(OatFileAssistant::kOatCannotOpen, oat_file_assistant.OdexFileStatus());
- EXPECT_EQ(OatFileAssistant::kOatUpToDate, oat_file_assistant.OatFileStatus());
- EXPECT_TRUE(oat_file_assistant.HasOriginalDexFiles());
-
- std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile();
- ASSERT_TRUE(oat_file.get() != nullptr);
- EXPECT_TRUE(oat_file->IsExecutable());
- std::vector<std::unique_ptr<const DexFile>> dex_files;
- dex_files = oat_file_assistant.LoadDexFiles(*oat_file, dex_location.c_str());
- EXPECT_EQ(1u, dex_files.size());
-}
-
-// Case: We have a DEX file, no ODEX file and an OAT file that needs
-// relocation but doesn't have patch info.
-// Expect: The status is kDex2OatNeeded, because we can't run patchoat.
-TEST_F(OatFileAssistantTest, NoSelfRelocation) {
- std::string dex_location = GetScratchDir() + "/NoSelfRelocation.jar";
- std::string oat_location = GetOdexDir() + "/NoSelfRelocation.oat";
-
- // Create the dex and odex files
- Copy(GetDexSrc1(), dex_location);
- GenerateNoPatchOdexForTest(dex_location, oat_location, CompilerFilter::kSpeed);
-
- OatFileAssistant oat_file_assistant(dex_location.c_str(),
- oat_location.c_str(), kRuntimeISA, true);
-
- EXPECT_EQ(OatFileAssistant::kDex2OatForRelocation,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
-
- // Make the oat file up to date.
- std::string error_msg;
- Runtime::Current()->AddCompilerOption("--compiler-filter=speed");
- ASSERT_EQ(OatFileAssistant::kUpdateSucceeded,
- oat_file_assistant.MakeUpToDate(false, &error_msg)) << error_msg;
- EXPECT_EQ(OatFileAssistant::kNoDexOptNeeded,
- oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
-
- std::unique_ptr<OatFile> oat_file = oat_file_assistant.GetBestOatFile();
- ASSERT_TRUE(oat_file.get() != nullptr);
- EXPECT_TRUE(oat_file->IsExecutable());
- std::vector<std::unique_ptr<const DexFile>> dex_files;
- dex_files = oat_file_assistant.LoadDexFiles(*oat_file, dex_location.c_str());
- EXPECT_EQ(1u, dex_files.size());
-}
-
// Case: We have a DEX file, an ODEX file and an OAT file, where the ODEX and
// OAT files both have patch delta of 0.
-// Expect: It shouldn't crash, and status is kSelfPatchOatNeeded.
+// Expect: It shouldn't crash.
TEST_F(OatFileAssistantTest, OdexOatOverlap) {
std::string dex_location = GetScratchDir() + "/OdexOatOverlap.jar";
std::string odex_location = GetOdexDir() + "/OdexOatOverlap.odex";
@@ -833,10 +692,10 @@
OatFileAssistant oat_file_assistant(dex_location.c_str(),
oat_location.c_str(), kRuntimeISA, true);
- // kPatchoatForRelocation is expected rather than -kPatchoatForRelocation
+ // kDex2OatForRelocation is expected rather than -kDex2OatForRelocation
// based on the assumption that the oat location is more up-to-date than the odex
// location, even if they both need relocation.
- EXPECT_EQ(OatFileAssistant::kPatchoatForRelocation,
+ EXPECT_EQ(OatFileAssistant::kDex2OatForRelocation,
oat_file_assistant.GetDexOptNeeded(CompilerFilter::kSpeed));
EXPECT_FALSE(oat_file_assistant.IsInBootClassPath());
@@ -1285,7 +1144,6 @@
{OatFileAssistant::kDex2OatForBootImage, "DEX2OAT_FOR_BOOT_IMAGE"},
{OatFileAssistant::kDex2OatForFilter, "DEX2OAT_FOR_FILTER"},
{OatFileAssistant::kDex2OatForRelocation, "DEX2OAT_FOR_RELOCATION"},
- {OatFileAssistant::kPatchoatForRelocation, "PATCHOAT_FOR_RELOCATION"}
};
ScopedObjectAccess soa(Thread::Current());