Rename NativeDexFile -> StandardDexFile

Motivation: The new name is cleaner.

Bug: 63756964
Test: test-art-host
Change-Id: I0e52015dbd929fe247305070cef03d86bcdeb54b
diff --git a/compiler/utils/test_dex_file_builder.h b/compiler/utils/test_dex_file_builder.h
index e6501e0..0da30fe 100644
--- a/compiler/utils/test_dex_file_builder.h
+++ b/compiler/utils/test_dex_file_builder.h
@@ -27,7 +27,7 @@
 #include "base/bit_utils.h"
 #include "base/logging.h"
 #include "dex_file_loader.h"
-#include "native_dex_file.h"
+#include "standard_dex_file.h"
 
 namespace art {
 
@@ -89,8 +89,8 @@
     } header_data;
     std::memset(header_data.data, 0, sizeof(header_data.data));
     DexFile::Header* header = reinterpret_cast<DexFile::Header*>(&header_data.data);
-    std::copy_n(NativeDexFile::kDexMagic, 4u, header->magic_);
-    std::copy_n(NativeDexFile::kDexMagicVersions[0], 4u, header->magic_ + 4u);
+    std::copy_n(StandardDexFile::kDexMagic, 4u, header->magic_);
+    std::copy_n(StandardDexFile::kDexMagicVersions[0], 4u, header->magic_ + 4u);
     header->header_size_ = sizeof(DexFile::Header);
     header->endian_tag_ = DexFile::kDexEndianConstant;
     header->link_size_ = 0u;  // Unused.
diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc
index 05af442..0fd24a8 100644
--- a/dex2oat/linker/oat_writer.cc
+++ b/dex2oat/linker/oat_writer.cc
@@ -53,7 +53,7 @@
 #include "mirror/class_loader.h"
 #include "mirror/dex_cache-inl.h"
 #include "mirror/object-inl.h"
-#include "native_dex_file.h"
+#include "standard_dex_file.h"
 #include "oat_quick_method_header.h"
 #include "os.h"
 #include "safe_map.h"
@@ -3110,12 +3110,12 @@
 }
 
 bool OatWriter::ValidateDexFileHeader(const uint8_t* raw_header, const char* location) {
-  const bool valid_native_dex_magic = NativeDexFile::IsMagicValid(raw_header);
-  if (!valid_native_dex_magic) {
+  const bool valid_standard_dex_magic = StandardDexFile::IsMagicValid(raw_header);
+  if (!valid_standard_dex_magic) {
     LOG(ERROR) << "Invalid magic number in dex file header. " << " File: " << location;
     return false;
   }
-  if (!NativeDexFile::IsVersionValid(raw_header)) {
+  if (!StandardDexFile::IsVersionValid(raw_header)) {
     LOG(ERROR) << "Invalid version number in dex file header. " << " File: " << location;
     return false;
   }
diff --git a/runtime/Android.bp b/runtime/Android.bp
index ed9906a..ddfbed4 100644
--- a/runtime/Android.bp
+++ b/runtime/Android.bp
@@ -153,7 +153,6 @@
         "mirror/throwable.cc",
         "monitor.cc",
         "native_bridge_art_interface.cc",
-        "native_dex_file.cc",
         "native_stack_dump.cc",
         "native/dalvik_system_DexFile.cc",
         "native/dalvik_system_VMDebug.cc",
@@ -208,6 +207,7 @@
         "signal_catcher.cc",
         "stack.cc",
         "stack_map.cc",
+        "standard_dex_file.cc",
         "thread.cc",
         "thread_list.cc",
         "thread_pool.cc",
diff --git a/runtime/class_linker_test.cc b/runtime/class_linker_test.cc
index 3d9fd59..6ea1fbe 100644
--- a/runtime/class_linker_test.cc
+++ b/runtime/class_linker_test.cc
@@ -26,7 +26,6 @@
 #include "base/enums.h"
 #include "class_linker-inl.h"
 #include "common_runtime_test.h"
-#include "native_dex_file.h"
 #include "dex_file_types.h"
 #include "entrypoints/entrypoint_utils-inl.h"
 #include "experimental_flags.h"
@@ -50,6 +49,7 @@
 #include "mirror/stack_trace_element.h"
 #include "mirror/string-inl.h"
 #include "scoped_thread_state_change-inl.h"
+#include "standard_dex_file.h"
 #include "thread-current-inl.h"
 
 namespace art {
@@ -1462,11 +1462,11 @@
   dex_cache->SetLocation(location.Get());
   const DexFile* old_dex_file = dex_cache->GetDexFile();
 
-  std::unique_ptr<DexFile> dex_file(new NativeDexFile(old_dex_file->Begin(),
-                                                      old_dex_file->Size(),
-                                                      location->ToModifiedUtf8(),
-                                                      0u,
-                                                      nullptr));
+  std::unique_ptr<DexFile> dex_file(new StandardDexFile(old_dex_file->Begin(),
+                                                        old_dex_file->Size(),
+                                                        location->ToModifiedUtf8(),
+                                                        0u,
+                                                        nullptr));
   {
     WriterMutexLock mu(soa.Self(), *Locks::dex_lock_);
     // Check that inserting with a UTF16 name works.
diff --git a/runtime/dex_file.cc b/runtime/dex_file.cc
index f6b3428..08c047d 100644
--- a/runtime/dex_file.cc
+++ b/runtime/dex_file.cc
@@ -39,8 +39,8 @@
 #include "jvalue.h"
 #include "leb128.h"
 #include "mem_map.h"
-#include "native_dex_file.h"
 #include "os.h"
+#include "standard_dex_file.h"
 #include "utf-inl.h"
 #include "utils.h"
 
diff --git a/runtime/dex_file_loader.cc b/runtime/dex_file_loader.cc
index 3ccb755..8cab1a5 100644
--- a/runtime/dex_file_loader.cc
+++ b/runtime/dex_file_loader.cc
@@ -27,7 +27,7 @@
 #include "base/unix_file/fd_file.h"
 #include "dex_file.h"
 #include "dex_file_verifier.h"
-#include "native_dex_file.h"
+#include "standard_dex_file.h"
 #include "zip_archive.h"
 
 namespace art {
@@ -42,7 +42,7 @@
 }
 
 bool DexFileLoader::IsValidMagic(const uint8_t* magic) {
-  return NativeDexFile::IsMagicValid(magic);
+  return StandardDexFile::IsMagicValid(magic);
 }
 
 bool DexFileLoader::GetMultiDexChecksums(const char* filename,
@@ -450,8 +450,8 @@
     *verify_result = VerifyResult::kVerifyNotAttempted;
   }
   std::unique_ptr<DexFile> dex_file;
-  if (NativeDexFile::IsMagicValid(base)) {
-    dex_file.reset(new NativeDexFile(base, size, location, location_checksum, oat_dex_file));
+  if (StandardDexFile::IsMagicValid(base)) {
+    dex_file.reset(new StandardDexFile(base, size, location, location_checksum, oat_dex_file));
   } else {
     return nullptr;
   }
diff --git a/runtime/dex_file_verifier_test.cc b/runtime/dex_file_verifier_test.cc
index af2d535..9f3505d 100644
--- a/runtime/dex_file_verifier_test.cc
+++ b/runtime/dex_file_verifier_test.cc
@@ -30,8 +30,8 @@
 #include "dex_file_loader.h"
 #include "dex_file_types.h"
 #include "leb128.h"
-#include "native_dex_file.h"
 #include "scoped_thread_state_change-inl.h"
+#include "standard_dex_file.h"
 #include "thread-current-inl.h"
 #include "utils.h"
 
@@ -57,7 +57,7 @@
 class DexFileVerifierTest : public CommonRuntimeTest {
  protected:
   DexFile* GetDexFile(const uint8_t* dex_bytes, size_t length) {
-    return new NativeDexFile(dex_bytes, length, "tmp", 0, nullptr);
+    return new StandardDexFile(dex_bytes, length, "tmp", 0, nullptr);
   }
 
   void VerifyModification(const char* dex_file_base64_content,
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index ab820fb..b3c3aa0 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -50,12 +50,12 @@
 #include "mem_map.h"
 #include "mirror/class.h"
 #include "mirror/object-inl.h"
-#include "native_dex_file.h"
 #include "oat.h"
 #include "oat_file-inl.h"
 #include "oat_file_manager.h"
 #include "os.h"
 #include "runtime.h"
+#include "standard_dex_file.h"
 #include "type_lookup_table.h"
 #include "utf-inl.h"
 #include "utils.h"
@@ -555,7 +555,7 @@
 
     const uint8_t* dex_file_pointer = DexBegin() + dex_file_offset;
 
-    const bool valid_magic = NativeDexFile::IsMagicValid(dex_file_pointer);
+    const bool valid_magic = StandardDexFile::IsMagicValid(dex_file_pointer);
     if (UNLIKELY(!valid_magic)) {
       *error_msg = StringPrintf("In oat file '%s' found OatDexFile #%zu for '%s' with invalid "
                                     "dex file magic '%s'",
@@ -565,7 +565,7 @@
                                 dex_file_pointer);
       return false;
     }
-    if (UNLIKELY(!NativeDexFile::IsVersionValid(dex_file_pointer))) {
+    if (UNLIKELY(!StandardDexFile::IsVersionValid(dex_file_pointer))) {
       *error_msg = StringPrintf("In oat file '%s' found OatDexFile #%zu for '%s' with invalid "
                                     "dex file version '%s'",
                                 GetLocation().c_str(),
diff --git a/runtime/native_dex_file.cc b/runtime/standard_dex_file.cc
similarity index 74%
rename from runtime/native_dex_file.cc
rename to runtime/standard_dex_file.cc
index 9a93696..36bb37a 100644
--- a/runtime/native_dex_file.cc
+++ b/runtime/standard_dex_file.cc
@@ -14,13 +14,13 @@
  * limitations under the License.
  */
 
-#include "native_dex_file.h"
+#include "standard_dex_file.h"
 
 namespace art {
 
-const uint8_t NativeDexFile::kDexMagic[] = { 'd', 'e', 'x', '\n' };
-const uint8_t NativeDexFile::kDexMagicVersions[NativeDexFile::kNumDexVersions]
-                                              [NativeDexFile::kDexVersionLen] = {
+const uint8_t StandardDexFile::kDexMagic[] = { 'd', 'e', 'x', '\n' };
+const uint8_t StandardDexFile::kDexMagicVersions[StandardDexFile::kNumDexVersions]
+                                                [StandardDexFile::kDexVersionLen] = {
   {'0', '3', '5', '\0'},
   // Dex version 036 skipped because of an old dalvik bug on some versions of android where dex
   // files with that version number would erroneously be accepted and run.
@@ -31,11 +31,11 @@
   {'0', '3', '9', '\0'},
 };
 
-bool NativeDexFile::IsMagicValid(const uint8_t* magic) {
+bool StandardDexFile::IsMagicValid(const uint8_t* magic) {
   return (memcmp(magic, kDexMagic, sizeof(kDexMagic)) == 0);
 }
 
-bool NativeDexFile::IsVersionValid(const uint8_t* magic) {
+bool StandardDexFile::IsVersionValid(const uint8_t* magic) {
   const uint8_t* version = &magic[sizeof(kDexMagic)];
   for (uint32_t i = 0; i < kNumDexVersions; i++) {
     if (memcmp(version, kDexMagicVersions[i], kDexVersionLen) == 0) {
@@ -45,11 +45,11 @@
   return false;
 }
 
-bool NativeDexFile::IsMagicValid() const {
+bool StandardDexFile::IsMagicValid() const {
   return IsMagicValid(header_->magic_);
 }
 
-bool NativeDexFile::IsVersionValid() const {
+bool StandardDexFile::IsVersionValid() const {
   return IsVersionValid(header_->magic_);
 }
 
diff --git a/runtime/native_dex_file.h b/runtime/standard_dex_file.h
similarity index 74%
rename from runtime/native_dex_file.h
rename to runtime/standard_dex_file.h
index 8f09e6d..1ec06ed 100644
--- a/runtime/native_dex_file.h
+++ b/runtime/standard_dex_file.h
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef ART_RUNTIME_NATIVE_DEX_FILE_H_
-#define ART_RUNTIME_NATIVE_DEX_FILE_H_
+#ifndef ART_RUNTIME_STANDARD_DEX_FILE_H_
+#define ART_RUNTIME_STANDARD_DEX_FILE_H_
 
 #include <iosfwd>
 
@@ -25,8 +25,8 @@
 
 class OatDexFile;
 
-// Native (ordinary) dex file. This is the format that is packaged in APKs and produced by tools.
-class NativeDexFile : public DexFile {
+// Standard dex file. This is the format that is packaged in APKs and produced by tools.
+class StandardDexFile : public DexFile {
  public:
   static const uint8_t kDexMagic[kDexMagicSize];
   static constexpr size_t kNumDexVersions = 4;
@@ -41,11 +41,11 @@
   virtual bool IsVersionValid() const OVERRIDE;
 
  private:
-  NativeDexFile(const uint8_t* base,
-                size_t size,
-                const std::string& location,
-                uint32_t location_checksum,
-                const OatDexFile* oat_dex_file)
+  StandardDexFile(const uint8_t* base,
+                  size_t size,
+                  const std::string& location,
+                  uint32_t location_checksum,
+                  const OatDexFile* oat_dex_file)
       : DexFile(base, size, location, location_checksum, oat_dex_file) {}
 
   friend class DexFileLoader;
@@ -53,9 +53,9 @@
 
   ART_FRIEND_TEST(ClassLinkerTest, RegisterDexFileName);  // for constructor
 
-  DISALLOW_COPY_AND_ASSIGN(NativeDexFile);
+  DISALLOW_COPY_AND_ASSIGN(StandardDexFile);
 };
 
 }  // namespace art
 
-#endif  // ART_RUNTIME_NATIVE_DEX_FILE_H_
+#endif  // ART_RUNTIME_STANDARD_DEX_FILE_H_