summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Martin Stjernholm <mast@google.com> 2025-02-07 14:37:03 +0000
committer Martin Stjernholm <mast@google.com> 2025-03-13 09:04:59 -0700
commit0f6a15bb17d2341106523b469743b659209a02b0 (patch)
tree38ac1211b412f0559a5f93d412b87f66142c95b7
parent6654a2743fdf4d21a75ce1082413efbf75abac70 (diff)
Clean up code that invalidated vdex files containing cdex.
Mostly reverts https://r.android.com/2587148. Test: m Bug: 325430813 Change-Id: Id7a0952d0ea83ff69fbd031d1be636e75d4d2d47
-rw-r--r--runtime/oat/oat_file_assistant.cc21
-rw-r--r--runtime/oat/oat_file_assistant.h5
-rw-r--r--runtime/vdex_file.cc6
-rw-r--r--runtime/vdex_file.h6
4 files changed, 0 insertions, 38 deletions
diff --git a/runtime/oat/oat_file_assistant.cc b/runtime/oat/oat_file_assistant.cc
index 6f90228d3c..f5d6832cff 100644
--- a/runtime/oat/oat_file_assistant.cc
+++ b/runtime/oat/oat_file_assistant.cc
@@ -322,10 +322,6 @@ int OatFileAssistant::GetDexOptNeeded(CompilerFilter::Filter target_compiler_fil
bool profile_changed,
bool downgrade) {
OatFileInfo& info = GetBestInfo();
- if (info.CheckDisableCompactDex()) { // TODO(b/256664509): Clean this up.
- VLOG(oat) << "Should recompile: disable cdex";
- return kDex2OatFromScratch;
- }
DexOptNeeded dexopt_needed = info.GetDexOptNeeded(
target_compiler_filter, GetDexOptTrigger(target_compiler_filter, profile_changed, downgrade));
if (dexopt_needed != kNoDexOptNeeded && info.GetType() == OatFileType::kDm) {
@@ -344,10 +340,6 @@ bool OatFileAssistant::GetDexOptNeeded(CompilerFilter::Filter target_compiler_fi
DexOptTrigger dexopt_trigger,
/*out*/ DexOptStatus* dexopt_status) {
OatFileInfo& info = GetBestInfo();
- if (info.CheckDisableCompactDex()) { // TODO(b/256664509): Clean this up.
- dexopt_status->location_ = kLocationNoneOrError;
- return true;
- }
DexOptNeeded dexopt_needed = info.GetDexOptNeeded(target_compiler_filter, dexopt_trigger);
dexopt_status->location_ = GetLocation(info);
return dexopt_needed != kNoDexOptNeeded;
@@ -1191,19 +1183,6 @@ std::unique_ptr<OatFile> OatFileAssistant::OatFileInfo::ReleaseFileForUse() {
return std::unique_ptr<OatFile>();
}
-// Check if we should reject vdex containing cdex code as part of the cdex
-// deprecation.
-// TODO(b/256664509): Clean this up.
-bool OatFileAssistant::OatFileInfo::CheckDisableCompactDex() {
- const OatFile* oat_file = GetFile();
- if (oat_file == nullptr) {
- return false;
- }
- const VdexFile* vdex_file = oat_file->GetVdexFile();
- return vdex_file != nullptr && vdex_file->HasDexSection() &&
- !vdex_file->HasOnlyStandardDexFiles();
-}
-
// TODO(calin): we could provide a more refined status here
// (e.g. run from uncompressed apk, run with vdex but not oat etc). It will allow us to
// track more experiments but adds extra complexity.
diff --git a/runtime/oat/oat_file_assistant.h b/runtime/oat/oat_file_assistant.h
index 562bcde19b..bcb0c8e9db 100644
--- a/runtime/oat/oat_file_assistant.h
+++ b/runtime/oat/oat_file_assistant.h
@@ -446,11 +446,6 @@ class OatFileAssistant {
// the OatFileInfo object.
std::unique_ptr<OatFile> ReleaseFileForUse();
- // Check if we should reject vdex containing cdex code as part of the cdex
- // deprecation.
- // TODO(b/256664509): Clean this up.
- bool CheckDisableCompactDex();
-
protected:
// Constructs a real instance.
// Pass true for is_oat_location if the information associated with this
diff --git a/runtime/vdex_file.cc b/runtime/vdex_file.cc
index 32a83f0e05..64ce9e84e1 100644
--- a/runtime/vdex_file.cc
+++ b/runtime/vdex_file.cc
@@ -425,12 +425,6 @@ bool VdexFile::MatchesDexFileChecksums(const std::vector<const DexFile::Header*>
return true;
}
-bool VdexFile::HasOnlyStandardDexFiles() const {
- // All are the same so it's enough to check the first one.
- const uint8_t* dex_file_start = GetNextDexFileData(nullptr, 0);
- return dex_file_start == nullptr || StandardDexFile::IsMagicValid(dex_file_start);
-}
-
static ObjPtr<mirror::Class> FindClassAndClearException(ClassLinker* class_linker,
Thread* self,
const char* descriptor,
diff --git a/runtime/vdex_file.h b/runtime/vdex_file.h
index a85c015202..f192b7f466 100644
--- a/runtime/vdex_file.h
+++ b/runtime/vdex_file.h
@@ -286,10 +286,6 @@ class VdexFile {
// order must match too.
bool MatchesDexFileChecksums(const std::vector<const DexFile::Header*>& dex_headers) const;
- // Returns true if all dex files are standard dex rather than compact dex.
- // Also returns true if there are no dex files at all.
- bool HasOnlyStandardDexFiles() const;
-
ClassStatus ComputeClassStatus(Thread* self, Handle<mirror::Class> cls) const
REQUIRES_SHARED(Locks::mutator_lock_);
@@ -300,8 +296,6 @@ class VdexFile {
}
private:
- bool ContainsDexFile(const DexFile& dex_file) const;
-
const uint8_t* DexBegin() const {
DCHECK(HasDexSection());
return Begin() + GetSectionHeader(VdexSection::kDexFileSection).section_offset;