From 452bee5da9811f62123978e142bd67b385e9ff82 Mon Sep 17 00:00:00 2001 From: Nicolas Geoffray Date: Wed, 9 Jul 2014 07:58:10 +0000 Subject: Revert "ART: Key-Value Store in Oat header" Broke arm64 build. This reverts commit c87d27b25994da8670d82a8f7bad6327b693bfff. Change-Id: I4c2ade295d2b5aa77fc3ad810e0e859629a5bf09 --- compiler/oat_test.cc | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'compiler/oat_test.cc') diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index d2ee0ede80..254faac796 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -18,7 +18,6 @@ #include "compiler/compiler.h" #include "compiler/oat_writer.h" #include "entrypoints/quick/quick_entrypoints.h" -#include "implicit_check_options.h" #include "mirror/art_method-inl.h" #include "mirror/class-inl.h" #include "mirror/object-inl.h" @@ -112,16 +111,12 @@ TEST_F(OatTest, WriteRead) { ScopedObjectAccess soa(Thread::Current()); ScratchFile tmp; - SafeMap key_value_store; - key_value_store.Put(OatHeader::kImageLocationKey, "lue.art"); - key_value_store.Put(ImplicitCheckOptions::kImplicitChecksOatHeaderKey, - ImplicitCheckOptions::Serialize(true, true, true)); OatWriter oat_writer(class_linker->GetBootClassPath(), 42U, 4096U, + "lue.art", compiler_driver_.get(), - &timings, - &key_value_store); + &timings); bool success = compiler_driver_->WriteElf(GetTestAndroidRoot(), !kIsTargetBuild, class_linker->GetBootClassPath(), @@ -141,7 +136,7 @@ TEST_F(OatTest, WriteRead) { ASSERT_EQ(1U, oat_header.GetDexFileCount()); // core ASSERT_EQ(42U, oat_header.GetImageFileLocationOatChecksum()); ASSERT_EQ(4096U, oat_header.GetImageFileLocationOatDataBegin()); - ASSERT_EQ("lue.art", std::string(oat_header.GetStoreValueByKey(OatHeader::kImageLocationKey))); + ASSERT_EQ("lue.art", oat_header.GetImageFileLocation()); const DexFile* dex_file = java_lang_dex_file_; uint32_t dex_file_checksum = dex_file->GetLocationChecksum(); @@ -194,20 +189,20 @@ TEST_F(OatTest, OatHeaderIsValid) { std::vector dex_files; uint32_t image_file_location_oat_checksum = 0; uint32_t image_file_location_oat_begin = 0; - OatHeader* oat_header = OatHeader::Create(instruction_set, - instruction_set_features, - &dex_files, - image_file_location_oat_checksum, - image_file_location_oat_begin, - nullptr); - ASSERT_NE(oat_header, nullptr); - ASSERT_TRUE(oat_header->IsValid()); - - char* magic = const_cast(oat_header->GetMagic()); + const std::string image_file_location; + OatHeader oat_header(instruction_set, + instruction_set_features, + &dex_files, + image_file_location_oat_checksum, + image_file_location_oat_begin, + image_file_location); + ASSERT_TRUE(oat_header.IsValid()); + + char* magic = const_cast(oat_header.GetMagic()); strcpy(magic, ""); // bad magic - ASSERT_FALSE(oat_header->IsValid()); + ASSERT_FALSE(oat_header.IsValid()); strcpy(magic, "oat\n000"); // bad version - ASSERT_FALSE(oat_header->IsValid()); + ASSERT_FALSE(oat_header.IsValid()); } } // namespace art -- cgit v1.2.3-59-g8ed1b