diff options
-rw-r--r-- | compiler/utils/test_dex_file_builder.h | 6 | ||||
-rw-r--r-- | dex2oat/linker/oat_writer.cc | 8 | ||||
-rw-r--r-- | runtime/Android.bp | 2 | ||||
-rw-r--r-- | runtime/class_linker_test.cc | 12 | ||||
-rw-r--r-- | runtime/dex_file.cc | 2 | ||||
-rw-r--r-- | runtime/dex_file_loader.cc | 8 | ||||
-rw-r--r-- | runtime/dex_file_verifier_test.cc | 4 | ||||
-rw-r--r-- | runtime/oat_file.cc | 6 | ||||
-rw-r--r-- | runtime/standard_dex_file.cc (renamed from runtime/native_dex_file.cc) | 16 | ||||
-rw-r--r-- | runtime/standard_dex_file.h (renamed from runtime/native_dex_file.h) | 22 |
10 files changed, 43 insertions, 43 deletions
diff --git a/compiler/utils/test_dex_file_builder.h b/compiler/utils/test_dex_file_builder.h index e6501e0b83..0da30fe768 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 @@ class TestDexFileBuilder { } 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 05af442a3a..0fd24a8a8f 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::ReadDexFileHeader(File* file, OatDexFile* oat_dex_file) { } 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 ed9906a5ec..ddfbed4499 100644 --- a/runtime/Android.bp +++ b/runtime/Android.bp @@ -153,7 +153,6 @@ cc_defaults { "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 @@ cc_defaults { "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 3d9fd59e0b..6ea1fbe195 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 @@ TEST_F(ClassLinkerTest, RegisterDexFileName) { 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 f6b3428208..08c047d8e9 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 3ccb755f58..8cab1a501a 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(uint32_t magic) { } 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 @@ std::unique_ptr<DexFile> DexFileLoader::OpenCommon(const uint8_t* base, *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 af2d53585e..9f3505d3be 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 @@ static void FixUpChecksum(uint8_t* dex_file) { 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 ab820fb37f..b3c3aa05f3 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 @@ bool OatFileBase::Setup(const char* abs_dex_location, std::string* error_msg) { 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 @@ bool OatFileBase::Setup(const char* abs_dex_location, std::string* error_msg) { 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 index 9a93696f1b..36bb37afe9 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 @@ const uint8_t NativeDexFile::kDexMagicVersions[NativeDexFile::kNumDexVersions] {'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 @@ bool NativeDexFile::IsVersionValid(const uint8_t* magic) { 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 index 8f09e6d7fc..1ec06edef3 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 @@ namespace art { 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 @@ class NativeDexFile : public DexFile { 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 @@ class NativeDexFile : public DexFile { 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_ |