diff options
author | 2016-10-03 08:46:48 +0000 | |
---|---|---|
committer | 2016-10-04 17:51:46 +0100 | |
commit | aad75c6d5bfab2dc8e30fc99fafe8cd2dc8b74d8 (patch) | |
tree | c1b9e1eabcf35c5cbb5b4f46313a4e062f2d5d51 /compiler/oat_test.cc | |
parent | 82d4838d6bb3480cd25327cedc5179fb2d86881c (diff) |
Revert "Revert "Store resolved Strings for AOT code in .bss.""
Fixed oat_test to keep dex files alive. Fixed mips build.
Rewritten the .bss GC root visiting and added write barrier
to the artResolveStringFromCode().
Test: build aosp_mips-eng
Test: m ART_DEFAULT_GC_TYPE=SS test-art-target-host-gtest-oat_test
Test: Run ART test suite on host and Nexus 9.
Bug: 20323084
Bug: 30627598
This reverts commit 5f926055cb88089d8ca27243f35a9dfd89d981f0.
Change-Id: I07fa2278d82b8eb64964c9a4b66cb93726ccda6b
Diffstat (limited to 'compiler/oat_test.cc')
-rw-r--r-- | compiler/oat_test.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index e8bc67d967..276280491c 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -108,8 +108,6 @@ class OatTest : public CommonCompilerTest { compiler_kind, insn_set, insn_features_.get(), - /* boot_image */ false, - /* app_image */ false, /* image_classes */ nullptr, /* compiled_classes */ nullptr, /* compiled_methods */ nullptr, @@ -194,6 +192,7 @@ class OatTest : public CommonCompilerTest { &opened_dex_files)) { return false; } + Runtime* runtime = Runtime::Current(); ClassLinker* const class_linker = runtime->GetClassLinker(); std::vector<const DexFile*> dex_files; @@ -207,7 +206,10 @@ class OatTest : public CommonCompilerTest { oat_writer.PrepareLayout(compiler_driver_.get(), nullptr, dex_files, &patcher); size_t rodata_size = oat_writer.GetOatHeader().GetExecutableOffset(); size_t text_size = oat_writer.GetOatSize() - rodata_size; - elf_writer->SetLoadedSectionSizes(rodata_size, text_size, oat_writer.GetBssSize()); + elf_writer->PrepareDynamicSection(rodata_size, + text_size, + oat_writer.GetBssSize(), + oat_writer.GetBssRootsOffset()); if (!oat_writer.WriteRodata(oat_rodata)) { return false; @@ -228,7 +230,15 @@ class OatTest : public CommonCompilerTest { elf_writer->WriteDebugInfo(oat_writer.GetMethodDebugInfo()); elf_writer->WritePatchLocations(oat_writer.GetAbsolutePatchLocations()); - return elf_writer->End(); + if (!elf_writer->End()) { + return false; + } + + opened_dex_files_maps_.emplace_back(std::move(opened_dex_files_map)); + for (std::unique_ptr<const DexFile>& dex_file : opened_dex_files) { + opened_dex_files_.emplace_back(dex_file.release()); + } + return true; } void TestDexFileInput(bool verify, bool low_4gb); @@ -236,6 +246,9 @@ class OatTest : public CommonCompilerTest { std::unique_ptr<const InstructionSetFeatures> insn_features_; std::unique_ptr<QuickCompilerCallbacks> callbacks_; + + std::vector<std::unique_ptr<MemMap>> opened_dex_files_maps_; + std::vector<std::unique_ptr<const DexFile>> opened_dex_files_; }; class ZipBuilder { |