diff options
author | Vladimir Marko <vmarko@google.com> | 2019-07-08 15:45:19 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2019-07-16 08:22:46 +0000 |
commit | 2d06e029b1c84916154b5960d2acd1c84706dc04 (patch) | |
tree | 31dca979adebd2ed3a058b23a12a3c91ce2874d1 /compiler/optimizing/code_generator_mips.cc | |
parent | 7cde45800e21c270945b43a8989334ffc7422c32 (diff) |
Clean up linker patches in codegens.
In preparation for introducing boot image extension, make
sure that we can use both kBootImageLinkTimePcRelative and
kBootImageRelRo load kinds at the same time.
Test: m test-art-host-gtest
Test: testrunner.py --host --optimizing
Test: aosp_taimen-userdebug boots
Test: run-gtests.sh
Test: testrunner.py --target --optimizing
Change-Id: I340f2d7d19e1c20699b37b0304d2e487d497da98
Diffstat (limited to 'compiler/optimizing/code_generator_mips.cc')
-rw-r--r-- | compiler/optimizing/code_generator_mips.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index b3bce78940..9ea9785763 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -1031,7 +1031,7 @@ CodeGeneratorMIPS::CodeGeneratorMIPS(HGraph* graph, type_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)), boot_image_string_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)), string_bss_entry_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)), - boot_image_intrinsic_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)), + boot_image_other_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)), jit_string_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)), jit_class_patches_(graph->GetAllocator()->Adapter(kArenaAllocCodeGenerator)), clobbered_ra_(false) { @@ -1623,7 +1623,7 @@ void CodeGeneratorMIPS::EmitLinkerPatches(ArenaVector<linker::LinkerPatch>* link type_bss_entry_patches_.size() + boot_image_string_patches_.size() + string_bss_entry_patches_.size() + - boot_image_intrinsic_patches_.size(); + boot_image_other_patches_.size(); linker_patches->reserve(size); if (GetCompilerOptions().IsBootImage()) { EmitPcRelativeLinkerPatches<linker::LinkerPatch::RelativeMethodPatch>( @@ -1632,14 +1632,17 @@ void CodeGeneratorMIPS::EmitLinkerPatches(ArenaVector<linker::LinkerPatch>* link boot_image_type_patches_, linker_patches); EmitPcRelativeLinkerPatches<linker::LinkerPatch::RelativeStringPatch>( boot_image_string_patches_, linker_patches); - EmitPcRelativeLinkerPatches<NoDexFileAdapter<linker::LinkerPatch::IntrinsicReferencePatch>>( - boot_image_intrinsic_patches_, linker_patches); } else { - EmitPcRelativeLinkerPatches<NoDexFileAdapter<linker::LinkerPatch::DataBimgRelRoPatch>>( - boot_image_method_patches_, linker_patches); + DCHECK(boot_image_method_patches_.empty()); DCHECK(boot_image_type_patches_.empty()); DCHECK(boot_image_string_patches_.empty()); - DCHECK(boot_image_intrinsic_patches_.empty()); + } + if (GetCompilerOptions().IsBootImage()) { + EmitPcRelativeLinkerPatches<NoDexFileAdapter<linker::LinkerPatch::IntrinsicReferencePatch>>( + boot_image_other_patches_, linker_patches); + } else { + EmitPcRelativeLinkerPatches<NoDexFileAdapter<linker::LinkerPatch::DataBimgRelRoPatch>>( + boot_image_other_patches_, linker_patches); } EmitPcRelativeLinkerPatches<linker::LinkerPatch::MethodBssEntryPatch>( method_bss_entry_patches_, linker_patches); @@ -1654,14 +1657,14 @@ CodeGeneratorMIPS::PcRelativePatchInfo* CodeGeneratorMIPS::NewBootImageIntrinsic uint32_t intrinsic_data, const PcRelativePatchInfo* info_high) { return NewPcRelativePatch( - /* dex_file= */ nullptr, intrinsic_data, info_high, &boot_image_intrinsic_patches_); + /* dex_file= */ nullptr, intrinsic_data, info_high, &boot_image_other_patches_); } CodeGeneratorMIPS::PcRelativePatchInfo* CodeGeneratorMIPS::NewBootImageRelRoPatch( uint32_t boot_image_offset, const PcRelativePatchInfo* info_high) { return NewPcRelativePatch( - /* dex_file= */ nullptr, boot_image_offset, info_high, &boot_image_method_patches_); + /* dex_file= */ nullptr, boot_image_offset, info_high, &boot_image_other_patches_); } CodeGeneratorMIPS::PcRelativePatchInfo* CodeGeneratorMIPS::NewBootImageMethodPatch( |