Remove kIsVdexEnabled.

It is now always assumed there is one.

Test: test.py
Change-Id: I8f3f5c722fb8c4a0f9ad8ea685d1a956bd0ac9ae
diff --git a/build/art.go b/build/art.go
index 4e48d2d..5704b43 100644
--- a/build/art.go
+++ b/build/art.go
@@ -46,10 +46,6 @@
 		cflags = append(cflags, "-DART_USE_TLAB=1")
 	}
 
-	if !envFalse(ctx, "ART_ENABLE_VDEX") {
-		cflags = append(cflags, "-DART_ENABLE_VDEX")
-	}
-
 	imtSize := envDefault(ctx, "ART_IMT_SIZE", "43")
 	cflags = append(cflags, "-DIMT_SIZE="+imtSize)
 
diff --git a/compiler/optimizing/inliner.cc b/compiler/optimizing/inliner.cc
index 4d846fa..7adb196 100644
--- a/compiler/optimizing/inliner.cc
+++ b/compiler/optimizing/inliner.cc
@@ -1672,7 +1672,7 @@
                         compiler_driver_,
                         codegen_,
                         inline_stats_,
-                        resolved_method->GetQuickenedInfo(class_linker->GetImagePointerSize()),
+                        resolved_method->GetQuickenedInfo(),
                         handles_);
 
   if (builder.BuildGraph() != kAnalysisSuccess) {
diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc
index 252d538..2bba985 100644
--- a/compiler/optimizing/optimizing_compiler.cc
+++ b/compiler/optimizing/optimizing_compiler.cc
@@ -1007,7 +1007,7 @@
   if (method != nullptr) {
     graph->SetArtMethod(method);
     ScopedObjectAccess soa(Thread::Current());
-    interpreter_metadata = method->GetQuickenedInfo(class_linker->GetImagePointerSize());
+    interpreter_metadata = method->GetQuickenedInfo();
   }
 
   std::unique_ptr<CodeGenerator> codegen(
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 9fa7f69..8137fb1 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1565,7 +1565,7 @@
         // 2) when we have a vdex file, which means it was already verified.
         const bool verify = !DoDexLayoutOptimizations() && (input_vdex_file_ == nullptr);
         if (!oat_writers_[i]->WriteAndOpenDexFiles(
-            kIsVdexEnabled ? vdex_files_[i].get() : oat_files_[i].get(),
+            vdex_files_[i].get(),
             rodata_.back(),
             instruction_set_,
             instruction_set_features_.get(),
diff --git a/dex2oat/linker/image_test.h b/dex2oat/linker/image_test.h
index d3d42b9..cedbccf 100644
--- a/dex2oat/linker/image_test.h
+++ b/dex2oat/linker/image_test.h
@@ -269,7 +269,7 @@
         std::unique_ptr<MemMap> cur_opened_dex_files_map;
         std::vector<std::unique_ptr<const DexFile>> cur_opened_dex_files;
         bool dex_files_ok = oat_writers[i]->WriteAndOpenDexFiles(
-            kIsVdexEnabled ? vdex_files[i].GetFile() : oat_files[i].GetFile(),
+            vdex_files[i].GetFile(),
             rodata.back(),
             driver->GetInstructionSet(),
             driver->GetInstructionSetFeatures(),
@@ -293,14 +293,12 @@
       bool image_space_ok = writer->PrepareImageAddressSpace();
       ASSERT_TRUE(image_space_ok);
 
-      if (kIsVdexEnabled) {
-        for (size_t i = 0, size = vdex_files.size(); i != size; ++i) {
-          std::unique_ptr<BufferedOutputStream> vdex_out =
-              std::make_unique<BufferedOutputStream>(
-                  std::make_unique<FileOutputStream>(vdex_files[i].GetFile()));
-          oat_writers[i]->WriteVerifierDeps(vdex_out.get(), nullptr);
-          oat_writers[i]->WriteChecksumsAndVdexHeader(vdex_out.get());
-        }
+      for (size_t i = 0, size = vdex_files.size(); i != size; ++i) {
+        std::unique_ptr<BufferedOutputStream> vdex_out =
+            std::make_unique<BufferedOutputStream>(
+                std::make_unique<FileOutputStream>(vdex_files[i].GetFile()));
+        oat_writers[i]->WriteVerifierDeps(vdex_out.get(), nullptr);
+        oat_writers[i]->WriteChecksumsAndVdexHeader(vdex_out.get());
       }
 
       for (size_t i = 0, size = oat_files.size(); i != size; ++i) {
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index 1eec592..d3e920f 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -571,10 +571,9 @@
   std::vector<std::unique_ptr<const DexFile>> dex_files;
 
   // Initialize VDEX and OAT headers.
-  if (kIsVdexEnabled) {
-    // Reserve space for Vdex header and checksums.
-    vdex_size_ = sizeof(VdexFile::Header) + oat_dex_files_.size() * sizeof(VdexFile::VdexChecksum);
-  }
+
+  // Reserve space for Vdex header and checksums.
+  vdex_size_ = sizeof(VdexFile::Header) + oat_dex_files_.size() * sizeof(VdexFile::VdexChecksum);
   oat_size_ = InitOatHeader(instruction_set,
                             instruction_set_features,
                             dchecked_integral_cast<uint32_t>(oat_dex_files_.size()),
@@ -582,28 +581,12 @@
 
   ChecksumUpdatingOutputStream checksum_updating_rodata(oat_rodata, oat_header_.get());
 
-  if (kIsVdexEnabled) {
-    std::unique_ptr<BufferedOutputStream> vdex_out =
-        std::make_unique<BufferedOutputStream>(std::make_unique<FileOutputStream>(vdex_file));
-    // Write DEX files into VDEX, mmap and open them.
-    if (!WriteDexFiles(vdex_out.get(), vdex_file, update_input_vdex) ||
-        !OpenDexFiles(vdex_file, verify, &dex_files_map, &dex_files)) {
-      return false;
-    }
-  } else {
-    DCHECK(!update_input_vdex);
-    // Write DEX files into OAT, mmap and open them.
-    if (!WriteDexFiles(oat_rodata, vdex_file, update_input_vdex) ||
-        !OpenDexFiles(vdex_file, verify, &dex_files_map, &dex_files)) {
-      return false;
-    }
-
-    // Do a bulk checksum update for Dex[]. Doing it piece by piece would be
-    // difficult because we're not using the OutputStream directly.
-    if (!oat_dex_files_.empty()) {
-      size_t size = oat_size_ - oat_dex_files_[0].dex_file_offset_;
-      oat_header_->UpdateChecksum(dex_files_map->Begin(), size);
-    }
+  std::unique_ptr<BufferedOutputStream> vdex_out =
+      std::make_unique<BufferedOutputStream>(std::make_unique<FileOutputStream>(vdex_file));
+  // Write DEX files into VDEX, mmap and open them.
+  if (!WriteDexFiles(vdex_out.get(), vdex_file, update_input_vdex) ||
+      !OpenDexFiles(vdex_file, verify, &dex_files_map, &dex_files)) {
+    return false;
   }
 
   // Write type lookup tables into the oat file.
@@ -755,13 +738,12 @@
 };
 
 static bool HasCompiledCode(const CompiledMethod* method) {
-  // The dextodexcompiler puts the quickening info table into the CompiledMethod
-  // for simplicity. For such methods, we will emit an OatQuickMethodHeader
-  // only when vdex is disabled.
-  return method != nullptr && (!method->GetQuickCode().empty() || !kIsVdexEnabled);
+  return method != nullptr && !method->GetQuickCode().empty();
 }
 
 static bool HasQuickeningInfo(const CompiledMethod* method) {
+  // The dextodexcompiler puts the quickening info table into the CompiledMethod
+  // for simplicity.
   return method != nullptr && method->GetQuickCode().empty() && !method->GetVmapTable().empty();
 }
 
@@ -1214,23 +1196,17 @@
     // The code offset was 0 when the mapping/vmap table offset was set, so it's set
     // to 0-offset and we need to adjust it by code_offset.
     uint32_t code_offset = quick_code_offset - thumb_offset;
-    if (!compiled_method->GetQuickCode().empty()) {
-      // If the code is compiled, we write the offset of the stack map relative
-      // to the code,
-      if (vmap_table_offset != 0u) {
-        vmap_table_offset += code_offset;
-        DCHECK_LT(vmap_table_offset, code_offset);
-      }
-      if (method_info_offset != 0u) {
-        method_info_offset += code_offset;
-        DCHECK_LT(method_info_offset, code_offset);
-      }
-    } else {
-      CHECK(!kIsVdexEnabled);
-      // We write the offset of the quickening info relative to the code.
+    CHECK(!compiled_method->GetQuickCode().empty());
+    // If the code is compiled, we write the offset of the stack map relative
+    // to the code.
+    if (vmap_table_offset != 0u) {
       vmap_table_offset += code_offset;
       DCHECK_LT(vmap_table_offset, code_offset);
     }
+    if (method_info_offset != 0u) {
+      method_info_offset += code_offset;
+      DCHECK_LT(method_info_offset, code_offset);
+    }
     uint32_t frame_size_in_bytes = compiled_method->GetFrameSizeInBytes();
     uint32_t core_spill_mask = compiled_method->GetCoreSpillMask();
     uint32_t fp_spill_mask = compiled_method->GetFpSpillMask();
@@ -2593,10 +2569,6 @@
 };
 
 bool OatWriter::WriteQuickeningInfo(OutputStream* vdex_out) {
-  if (!kIsVdexEnabled) {
-    return true;
-  }
-
   size_t initial_offset = vdex_size_;
   size_t start_offset = RoundUp(initial_offset, 4u);
 
@@ -2655,10 +2627,6 @@
 }
 
 bool OatWriter::WriteVerifierDeps(OutputStream* vdex_out, verifier::VerifierDeps* verifier_deps) {
-  if (!kIsVdexEnabled) {
-    return true;
-  }
-
   if (verifier_deps == nullptr) {
     // Nothing to write. Record the offset, but no need
     // for alignment.
@@ -3170,23 +3138,17 @@
   }
 
   // Update current size and account for the written data.
-  if (kIsVdexEnabled) {
-    DCHECK_EQ(vdex_size_, oat_dex_file->dex_file_offset_);
-    vdex_size_ += oat_dex_file->dex_file_size_;
-  } else {
-    DCHECK(!update_input_vdex);
-    DCHECK_EQ(oat_size_, oat_dex_file->dex_file_offset_);
-    oat_size_ += oat_dex_file->dex_file_size_;
-  }
+  DCHECK_EQ(vdex_size_, oat_dex_file->dex_file_offset_);
+  vdex_size_ += oat_dex_file->dex_file_size_;
   size_dex_file_ += oat_dex_file->dex_file_size_;
   return true;
 }
 
 bool OatWriter::SeekToDexFile(OutputStream* out, File* file, OatDexFile* oat_dex_file) {
   // Dex files are required to be 4 byte aligned.
-  size_t initial_offset = kIsVdexEnabled ? vdex_size_ : oat_size_;
+  size_t initial_offset = vdex_size_;
   size_t start_offset = RoundUp(initial_offset, 4);
-  size_t file_offset = kIsVdexEnabled ? start_offset : (oat_data_offset_ + start_offset);
+  size_t file_offset = start_offset;
   size_dex_file_alignment_ += start_offset - initial_offset;
 
   // Seek to the start of the dex file and flush any pending operations in the stream.
@@ -3211,11 +3173,7 @@
     return false;
   }
 
-  if (kIsVdexEnabled) {
-    vdex_size_ = start_offset;
-  } else {
-    oat_size_ = start_offset;
-  }
+  vdex_size_ = start_offset;
   oat_dex_file->dex_file_offset_ = start_offset;
   return true;
 }
@@ -3291,7 +3249,7 @@
                              File* file,
                              OatDexFile* oat_dex_file,
                              ZipEntry* dex_file) {
-  size_t start_offset = kIsVdexEnabled ? vdex_size_ : oat_data_offset_ + oat_size_;
+  size_t start_offset = vdex_size_;
   DCHECK_EQ(static_cast<off_t>(start_offset), out->Seek(0, kSeekCurrent));
 
   // Extract the dex file and get the extracted size.
@@ -3384,7 +3342,7 @@
                              File* file,
                              OatDexFile* oat_dex_file,
                              File* dex_file) {
-  size_t start_offset = kIsVdexEnabled ? vdex_size_ : oat_data_offset_ + oat_size_;
+  size_t start_offset = vdex_size_;
   DCHECK_EQ(static_cast<off_t>(start_offset), out->Seek(0, kSeekCurrent));
 
   off_t input_offset = lseek(dex_file->Fd(), 0, SEEK_SET);
@@ -3480,7 +3438,7 @@
   }
 
   size_t map_offset = oat_dex_files_[0].dex_file_offset_;
-  size_t length = kIsVdexEnabled ? (vdex_size_ - map_offset) : (oat_size_ - map_offset);
+  size_t length = vdex_size_ - map_offset;
 
   std::string error_msg;
   std::unique_ptr<MemMap> dex_files_map(MemMap::MapFile(
@@ -3488,7 +3446,7 @@
       PROT_READ | PROT_WRITE,
       MAP_SHARED,
       file->Fd(),
-      kIsVdexEnabled ? map_offset : (oat_data_offset_ + map_offset),
+      map_offset,
       /* low_4gb */ false,
       file->GetPath().c_str(),
       &error_msg));
@@ -3692,9 +3650,6 @@
 }
 
 bool OatWriter::WriteChecksumsAndVdexHeader(OutputStream* vdex_out) {
-  if (!kIsVdexEnabled) {
-    return true;
-  }
   // Write checksums
   off_t actual_offset = vdex_out->Seek(sizeof(VdexFile::Header), kSeekSet);
   if (actual_offset != sizeof(VdexFile::Header)) {
diff --git a/dex2oat/linker/oat_writer_test.cc b/dex2oat/linker/oat_writer_test.cc
index 1ee2e4e..022aa1b 100644
--- a/dex2oat/linker/oat_writer_test.cc
+++ b/dex2oat/linker/oat_writer_test.cc
@@ -192,7 +192,7 @@
     OutputStream* oat_rodata = elf_writer->StartRoData();
     std::unique_ptr<MemMap> opened_dex_files_map;
     std::vector<std::unique_ptr<const DexFile>> opened_dex_files;
-    if (!oat_writer.WriteAndOpenDexFiles(kIsVdexEnabled ? vdex_file : oat_file,
+    if (!oat_writer.WriteAndOpenDexFiles(vdex_file,
                                          oat_rodata,
                                          compiler_driver_->GetInstructionSet(),
                                          compiler_driver_->GetInstructionSetFeatures(),
@@ -224,15 +224,13 @@
                                       oat_writer.GetBssMethodsOffset(),
                                       oat_writer.GetBssRootsOffset());
 
-    if (kIsVdexEnabled) {
-      std::unique_ptr<BufferedOutputStream> vdex_out =
-            std::make_unique<BufferedOutputStream>(std::make_unique<FileOutputStream>(vdex_file));
-      if (!oat_writer.WriteVerifierDeps(vdex_out.get(), nullptr)) {
-        return false;
-      }
-      if (!oat_writer.WriteChecksumsAndVdexHeader(vdex_out.get())) {
-        return false;
-      }
+    std::unique_ptr<BufferedOutputStream> vdex_out =
+        std::make_unique<BufferedOutputStream>(std::make_unique<FileOutputStream>(vdex_file));
+    if (!oat_writer.WriteVerifierDeps(vdex_out.get(), nullptr)) {
+      return false;
+    }
+    if (!oat_writer.WriteChecksumsAndVdexHeader(vdex_out.get())) {
+      return false;
     }
 
     if (!oat_writer.WriteRodata(oat_rodata)) {
diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc
index cd2e894..5a3d34c 100644
--- a/oatdump/oatdump.cc
+++ b/oatdump/oatdump.cc
@@ -573,46 +573,36 @@
     }
 
     if (options_.export_dex_location_) {
-      if (kIsVdexEnabled) {
-        std::string error_msg;
-        std::string vdex_filename = GetVdexFilename(oat_file_.GetLocation());
-        if (!OS::FileExists(vdex_filename.c_str())) {
-          os << "File " << vdex_filename.c_str() << " does not exist\n";
-          return false;
-        }
+      std::string error_msg;
+      std::string vdex_filename = GetVdexFilename(oat_file_.GetLocation());
+      if (!OS::FileExists(vdex_filename.c_str())) {
+        os << "File " << vdex_filename.c_str() << " does not exist\n";
+        return false;
+      }
 
-        DexFileUniqV vdex_dex_files;
-        std::unique_ptr<const VdexFile> vdex_file = OpenVdexUnquicken(vdex_filename,
-                                                                      &vdex_dex_files,
-                                                                      &error_msg);
-        if (vdex_file.get() == nullptr) {
-          os << "Failed to open vdex file: " << error_msg << "\n";
-          return false;
-        }
-        if (oat_dex_files_.size() != vdex_dex_files.size()) {
-          os << "Dex files number in Vdex file does not match Dex files number in Oat file: "
-             << vdex_dex_files.size() << " vs " << oat_dex_files_.size() << '\n';
-          return false;
-        }
+      DexFileUniqV vdex_dex_files;
+      std::unique_ptr<const VdexFile> vdex_file = OpenVdexUnquicken(vdex_filename,
+                                                                    &vdex_dex_files,
+                                                                    &error_msg);
+      if (vdex_file.get() == nullptr) {
+        os << "Failed to open vdex file: " << error_msg << "\n";
+        return false;
+      }
+      if (oat_dex_files_.size() != vdex_dex_files.size()) {
+        os << "Dex files number in Vdex file does not match Dex files number in Oat file: "
+           << vdex_dex_files.size() << " vs " << oat_dex_files_.size() << '\n';
+        return false;
+      }
 
-        size_t i = 0;
-        for (const auto& vdex_dex_file : vdex_dex_files) {
-          const OatFile::OatDexFile* oat_dex_file = oat_dex_files_[i];
-          CHECK(oat_dex_file != nullptr);
-          CHECK(vdex_dex_file != nullptr);
-          if (!ExportDexFile(os, *oat_dex_file, vdex_dex_file.get())) {
-            success = false;
-          }
-          i++;
+      size_t i = 0;
+      for (const auto& vdex_dex_file : vdex_dex_files) {
+        const OatFile::OatDexFile* oat_dex_file = oat_dex_files_[i];
+        CHECK(oat_dex_file != nullptr);
+        CHECK(vdex_dex_file != nullptr);
+        if (!ExportDexFile(os, *oat_dex_file, vdex_dex_file.get())) {
+          success = false;
         }
-      } else {
-        for (size_t i = 0; i < oat_dex_files_.size(); i++) {
-          const OatFile::OatDexFile* oat_dex_file = oat_dex_files_[i];
-          CHECK(oat_dex_file != nullptr);
-          if (!ExportDexFile(os, *oat_dex_file, /* vdex_dex_file */ nullptr)) {
-            success = false;
-          }
-        }
+        i++;
       }
     }
 
@@ -1367,7 +1357,7 @@
       vios->Stream() << StringPrintf("(offset=0x%08x)\n", vmap_table_offset);
 
       size_t vmap_table_offset_limit =
-          (kIsVdexEnabled && IsMethodGeneratedByDexToDexCompiler(oat_method, code_item_accessor))
+          IsMethodGeneratedByDexToDexCompiler(oat_method, code_item_accessor)
               ? oat_file_.GetVdexFile()->Size()
               : method_header->GetCode() - oat_file_.Begin();
       if (vmap_table_offset >= vmap_table_offset_limit) {
diff --git a/runtime/art_method.cc b/runtime/art_method.cc
index 0a108f9..fa0c501 100644
--- a/runtime/art_method.cc
+++ b/runtime/art_method.cc
@@ -563,23 +563,14 @@
   return true;
 }
 
-const uint8_t* ArtMethod::GetQuickenedInfo(PointerSize pointer_size) {
-  if (kIsVdexEnabled) {
-    const DexFile& dex_file = GetDeclaringClass()->GetDexFile();
-    const OatFile::OatDexFile* oat_dex_file = dex_file.GetOatDexFile();
-    if (oat_dex_file == nullptr || (oat_dex_file->GetOatFile() == nullptr)) {
-      return nullptr;
-    }
-    return oat_dex_file->GetOatFile()->GetVdexFile()->GetQuickenedInfoOf(
-        dex_file, GetCodeItemOffset());
-  } else {
-    bool found = false;
-    OatFile::OatMethod oat_method = FindOatMethodFor(this, pointer_size, &found);
-    if (!found || (oat_method.GetQuickCode() != nullptr)) {
-      return nullptr;
-    }
-    return oat_method.GetVmapTable();
+const uint8_t* ArtMethod::GetQuickenedInfo() {
+  const DexFile& dex_file = GetDeclaringClass()->GetDexFile();
+  const OatFile::OatDexFile* oat_dex_file = dex_file.GetOatDexFile();
+  if (oat_dex_file == nullptr || (oat_dex_file->GetOatFile() == nullptr)) {
+    return nullptr;
   }
+  return oat_dex_file->GetOatFile()->GetVdexFile()->GetQuickenedInfoOf(
+      dex_file, GetCodeItemOffset());
 }
 
 const OatQuickMethodHeader* ArtMethod::GetOatQuickMethodHeader(uintptr_t pc) {
diff --git a/runtime/art_method.h b/runtime/art_method.h
index c17eef1..c5c1c51 100644
--- a/runtime/art_method.h
+++ b/runtime/art_method.h
@@ -657,7 +657,7 @@
     return hotness_count_;
   }
 
-  const uint8_t* GetQuickenedInfo(PointerSize pointer_size) REQUIRES_SHARED(Locks::mutator_lock_);
+  const uint8_t* GetQuickenedInfo() REQUIRES_SHARED(Locks::mutator_lock_);
 
   // Returns the method header for the compiled code containing 'pc'. Note that runtime
   // methods will return null for this method, as they are not oat based.
diff --git a/runtime/globals.h b/runtime/globals.h
index 53932fd..f14d6e9 100644
--- a/runtime/globals.h
+++ b/runtime/globals.h
@@ -125,12 +125,6 @@
 
 static constexpr bool kDefaultMustRelocate = true;
 
-#ifdef ART_ENABLE_VDEX
-static constexpr bool kIsVdexEnabled = true;
-#else
-static constexpr bool kIsVdexEnabled = false;
-#endif
-
 // Size of a heap reference.
 static constexpr size_t kHeapReferenceSize = sizeof(uint32_t);
 
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 4429ade..69bd46d 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -193,7 +193,7 @@
 
   ret->PreLoad();
 
-  if (kIsVdexEnabled && !ret->LoadVdex(vdex_filename, writable, low_4gb, error_msg)) {
+  if (!ret->LoadVdex(vdex_filename, writable, low_4gb, error_msg)) {
     return nullptr;
   }
 
@@ -233,7 +233,7 @@
                                       std::string* error_msg) {
   std::unique_ptr<OatFileBase> ret(new kOatFileBaseSubType(oat_location, executable));
 
-  if (kIsVdexEnabled && !ret->LoadVdex(vdex_fd, vdex_location, writable, low_4gb, error_msg)) {
+  if (!ret->LoadVdex(vdex_fd, vdex_location, writable, low_4gb, error_msg)) {
     return nullptr;
   }
 
@@ -1275,7 +1275,7 @@
   std::string vdex_filename = GetVdexFilename(oat_filename);
 
   // Check that the files even exist, fast-fail.
-  if (kIsVdexEnabled && !OS::FileExists(vdex_filename.c_str())) {
+  if (!OS::FileExists(vdex_filename.c_str())) {
     *error_msg = StringPrintf("File %s does not exist.", vdex_filename.c_str());
     return nullptr;
   } else if (!OS::FileExists(oat_filename.c_str())) {
@@ -1427,11 +1427,11 @@
 }
 
 const uint8_t* OatFile::DexBegin() const {
-  return kIsVdexEnabled ? vdex_->Begin() : Begin();
+  return vdex_->Begin();
 }
 
 const uint8_t* OatFile::DexEnd() const {
-  return kIsVdexEnabled ? vdex_->End() : End();
+  return vdex_->End();
 }
 
 ArrayRef<ArtMethod*> OatFile::GetBssMethods() const {
diff --git a/runtime/oat_file_assistant.cc b/runtime/oat_file_assistant.cc
index 378ce2c..113b7b9 100644
--- a/runtime/oat_file_assistant.cc
+++ b/runtime/oat_file_assistant.cc
@@ -496,17 +496,10 @@
 
   // Verify the dex checksum.
   std::string error_msg;
-  if (kIsVdexEnabled) {
-    VdexFile* vdex = file.GetVdexFile();
-    if (!DexChecksumUpToDate(*vdex, &error_msg)) {
-      LOG(ERROR) << error_msg;
-      return kOatDexOutOfDate;
-    }
-  } else {
-    if (!DexChecksumUpToDate(file, &error_msg)) {
-      LOG(ERROR) << error_msg;
-      return kOatDexOutOfDate;
-    }
+  VdexFile* vdex = file.GetVdexFile();
+  if (!DexChecksumUpToDate(*vdex, &error_msg)) {
+    LOG(ERROR) << error_msg;
+    return kOatDexOutOfDate;
   }
 
   CompilerFilter::Filter current_compiler_filter = file.GetCompilerFilter();
diff --git a/runtime/oat_file_assistant_test.cc b/runtime/oat_file_assistant_test.cc
index 65d01a4..f1f35dd 100644
--- a/runtime/oat_file_assistant_test.cc
+++ b/runtime/oat_file_assistant_test.cc
@@ -398,11 +398,6 @@
 // Case: We have a DEX file and up-to-date (ODEX) VDEX file for it, but no
 // ODEX file.
 TEST_F(OatFileAssistantTest, VdexUpToDateNoOdex) {
-  // This test case is only meaningful if vdex is enabled.
-  if (!kIsVdexEnabled) {
-    return;
-  }
-
   std::string dex_location = GetScratchDir() + "/VdexUpToDateNoOdex.jar";
   std::string odex_location = GetOdexDir() + "/VdexUpToDateNoOdex.oat";
 
@@ -446,10 +441,6 @@
 // Case: We have a DEX file and up-to-date (OAT) VDEX file for it, but no OAT
 // file.
 TEST_F(OatFileAssistantTest, VdexUpToDateNoOat) {
-  // This test case is only meaningful if vdex is enabled.
-  if (!kIsVdexEnabled) {
-    return;
-  }
   if (IsExecutedAsRoot()) {
     // We cannot simulate non writable locations when executed as root: b/38000545.
     LOG(ERROR) << "Test skipped because it's running as root";
@@ -668,11 +659,6 @@
 // Case: We have a DEX file and an (ODEX) VDEX file out of date with respect
 // to the dex checksum, but no ODEX file.
 TEST_F(OatFileAssistantTest, VdexDexOutOfDate) {
-  // This test case is only meaningful if vdex is enabled.
-  if (!kIsVdexEnabled) {
-    return;
-  }
-
   std::string dex_location = GetScratchDir() + "/VdexDexOutOfDate.jar";
   std::string odex_location = GetOdexDir() + "/VdexDexOutOfDate.oat";
 
@@ -690,11 +676,6 @@
 // Case: We have a MultiDEX (ODEX) VDEX file where the non-main multidex entry
 // is out of date and there is no corresponding ODEX file.
 TEST_F(OatFileAssistantTest, VdexMultiDexNonMainOutOfDate) {
-  // This test case is only meaningful if vdex is enabled.
-  if (!kIsVdexEnabled) {
-    return;
-  }
-
   std::string dex_location = GetScratchDir() + "/VdexMultiDexNonMainOutOfDate.jar";
   std::string odex_location = GetOdexDir() + "/VdexMultiDexNonMainOutOfDate.odex";