From c52f3034b06c03632e937aff07d46c2bdcadfef5 Mon Sep 17 00:00:00 2001 From: Richard Uhler Date: Thu, 2 Mar 2017 13:45:45 +0000 Subject: [PATCH] Remove --include-patch-information option from dex2oat. Because we no longer support running patchoat on npic oat files, which means the included patch information is unused . Bug: 33192586 Test: m test-art-host Change-Id: I9e100c4e47dc24d91cd74226c84025e961d30f67 --- compiler/compiled_method.h | 5 ----- compiler/driver/compiler_options.cc | 7 ------- compiler/driver/compiler_options.h | 7 ------- compiler/elf_writer.h | 1 - compiler/elf_writer_quick.cc | 12 ------------ compiler/image_test.cc | 1 - compiler/jit/jit_compiler.cc | 1 - compiler/oat_test.cc | 1 - compiler/oat_writer.cc | 2 +- compiler/oat_writer.h | 4 ---- compiler/optimizing/code_generator_arm.cc | 16 ++-------------- compiler/optimizing/code_generator_arm.h | 2 -- compiler/optimizing/code_generator_arm64.cc | 14 ++------------ compiler/optimizing/code_generator_arm64.h | 2 -- compiler/optimizing/code_generator_arm_vixl.cc | 16 ++-------------- compiler/optimizing/code_generator_arm_vixl.h | 2 -- compiler/optimizing/code_generator_mips.cc | 16 ++-------------- compiler/optimizing/code_generator_mips.h | 2 -- compiler/optimizing/code_generator_mips64.cc | 16 ++-------------- compiler/optimizing/code_generator_mips64.h | 2 -- compiler/optimizing/code_generator_x86.cc | 15 --------------- compiler/optimizing/code_generator_x86.h | 3 --- compiler/optimizing/code_generator_x86_64.cc | 15 --------------- compiler/optimizing/code_generator_x86_64.h | 3 --- compiler/optimizing/nodes.h | 4 ---- compiler/optimizing/sharpening.cc | 4 +--- dex2oat/dex2oat.cc | 6 ------ test/etc/run-test-jar | 4 ++-- 28 files changed, 14 insertions(+), 169 deletions(-) diff --git a/compiler/compiled_method.h b/compiler/compiled_method.h index e2a094272..00e2d62bf 100644 --- a/compiler/compiled_method.h +++ b/compiler/compiled_method.h @@ -170,7 +170,6 @@ class LinkerPatch { // choose to squeeze the Type into fewer than 8 bits, we'll have to declare // patch_type_ as an uintN_t and do explicit static_cast<>s. enum class Type : uint8_t { - kRecordPosition, // Just record patch position for patchoat. kMethod, kCall, kCallRelative, // NOTE: Actual patching is instruction_set-dependent. @@ -183,10 +182,6 @@ class LinkerPatch { kDexCacheArray, // NOTE: Actual patching is instruction_set-dependent. }; - static LinkerPatch RecordPosition(size_t literal_offset) { - return LinkerPatch(literal_offset, Type::kRecordPosition, /* target_dex_file */ nullptr); - } - static LinkerPatch MethodPatch(size_t literal_offset, const DexFile* target_dex_file, uint32_t target_method_idx) { diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc index c222f9004..34ad1c5c0 100644 --- a/compiler/driver/compiler_options.cc +++ b/compiler/driver/compiler_options.cc @@ -32,7 +32,6 @@ CompilerOptions::CompilerOptions() no_inline_from_(nullptr), boot_image_(false), app_image_(false), - include_patch_information_(kDefaultIncludePatchInformation), top_k_profile_threshold_(kDefaultTopKProfileThreshold), debuggable_(false), generate_debug_info_(kDefaultGenerateDebugInfo), @@ -66,7 +65,6 @@ CompilerOptions::CompilerOptions(CompilerFilter::Filter compiler_filter, size_t inline_depth_limit, size_t inline_max_code_units, const std::vector* no_inline_from, - bool include_patch_information, double top_k_profile_threshold, bool debuggable, bool generate_debug_info, @@ -93,7 +91,6 @@ CompilerOptions::CompilerOptions(CompilerFilter::Filter compiler_filter, no_inline_from_(no_inline_from), boot_image_(false), app_image_(false), - include_patch_information_(include_patch_information), top_k_profile_threshold_(top_k_profile_threshold), debuggable_(debuggable), generate_debug_info_(generate_debug_info), @@ -206,10 +203,6 @@ bool CompilerOptions::ParseCompilerOption(const StringPiece& option, UsageFn Usa debuggable_ = true; } else if (option.starts_with("--top-k-profile-threshold=")) { ParseDouble(option.data(), '=', 0.0, 100.0, &top_k_profile_threshold_, Usage); - } else if (option == "--include-patch-information") { - include_patch_information_ = true; - } else if (option == "--no-include-patch-information") { - include_patch_information_ = false; } else if (option == "--abort-on-hard-verifier-error") { abort_on_hard_verifier_failure_ = true; } else if (option.starts_with("--dump-init-failures=")) { diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 6894cd502..2e3e55f6c 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -46,7 +46,6 @@ class CompilerOptions FINAL { static constexpr double kDefaultTopKProfileThreshold = 90.0; static const bool kDefaultGenerateDebugInfo = false; static const bool kDefaultGenerateMiniDebugInfo = false; - static const bool kDefaultIncludePatchInformation = false; static const size_t kDefaultInlineDepthLimit = 3; static const size_t kDefaultInlineMaxCodeUnits = 32; static constexpr size_t kUnsetInlineDepthLimit = -1; @@ -68,7 +67,6 @@ class CompilerOptions FINAL { size_t inline_depth_limit, size_t inline_max_code_units, const std::vector* no_inline_from, - bool include_patch_information, double top_k_profile_threshold, bool debuggable, bool generate_debug_info, @@ -213,10 +211,6 @@ class CompilerOptions FINAL { return implicit_suspend_checks_; } - bool GetIncludePatchInformation() const { - return include_patch_information_; - } - bool IsBootImage() const { return boot_image_; } @@ -305,7 +299,6 @@ class CompilerOptions FINAL { bool boot_image_; bool app_image_; - bool include_patch_information_; // When using a profile file only the top K% of the profiled samples will be compiled. double top_k_profile_threshold_; bool debuggable_; diff --git a/compiler/elf_writer.h b/compiler/elf_writer.h index d55f7458b..7baae527f 100644 --- a/compiler/elf_writer.h +++ b/compiler/elf_writer.h @@ -63,7 +63,6 @@ class ElfWriter { virtual void EndText(OutputStream* text) = 0; virtual void WriteDynamicSection() = 0; virtual void WriteDebugInfo(const ArrayRef& method_infos) = 0; - virtual void WritePatchLocations(const ArrayRef& patch_locations) = 0; virtual bool End() = 0; // Get the ELF writer's stream. This stream can be used for writing data directly diff --git a/compiler/elf_writer_quick.cc b/compiler/elf_writer_quick.cc index 0d6575cff..28c35e96b 100644 --- a/compiler/elf_writer_quick.cc +++ b/compiler/elf_writer_quick.cc @@ -105,7 +105,6 @@ class ElfWriterQuick FINAL : public ElfWriter { void EndText(OutputStream* text) OVERRIDE; void WriteDynamicSection() OVERRIDE; void WriteDebugInfo(const ArrayRef& method_infos) OVERRIDE; - void WritePatchLocations(const ArrayRef& patch_locations) OVERRIDE; bool End() OVERRIDE; virtual OutputStream* GetStream() OVERRIDE; @@ -268,17 +267,6 @@ void ElfWriterQuick::WriteDebugInfo( } template -void ElfWriterQuick::WritePatchLocations( - const ArrayRef& patch_locations) { - // Add relocation section for .text. - if (compiler_options_->GetIncludePatchInformation()) { - // Note that ElfWriter::Fixup will be called regardless and therefore - // we need to include oat_patches for debug sections unconditionally. - builder_->WritePatches(".text.oat_patches", patch_locations); - } -} - -template bool ElfWriterQuick::End() { builder_->End(); if (compiler_options_->GetGenerateBuildId()) { diff --git a/compiler/image_test.cc b/compiler/image_test.cc index b0225a362..89e8a678b 100644 --- a/compiler/image_test.cc +++ b/compiler/image_test.cc @@ -318,7 +318,6 @@ void CompilationHelper::Compile(CompilerDriver* driver, elf_writer->WriteDynamicSection(); elf_writer->WriteDebugInfo(oat_writer->GetMethodDebugInfo()); - elf_writer->WritePatchLocations(oat_writer->GetAbsolutePatchLocations()); bool success = elf_writer->End(); ASSERT_TRUE(success); diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index cbd831a60..3ae797403 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -100,7 +100,6 @@ JitCompiler::JitCompiler() { CompilerOptions::kDefaultInlineDepthLimit, CompilerOptions::kDefaultInlineMaxCodeUnits, /* no_inline_from */ nullptr, - /* include_patch_information */ false, CompilerOptions::kDefaultTopKProfileThreshold, Runtime::Current()->IsJavaDebuggable(), CompilerOptions::kDefaultGenerateDebugInfo, diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index e2233e4bb..97b13746f 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -250,7 +250,6 @@ class OatTest : public CommonCompilerTest { elf_writer->WriteDynamicSection(); elf_writer->WriteDebugInfo(oat_writer.GetMethodDebugInfo()); - elf_writer->WritePatchLocations(oat_writer.GetAbsolutePatchLocations()); if (!elf_writer->End()) { return false; diff --git a/compiler/oat_writer.cc b/compiler/oat_writer.cc index 8ab44d2c1..43f606af6 100644 --- a/compiler/oat_writer.cc +++ b/compiler/oat_writer.cc @@ -1225,7 +1225,7 @@ class OatWriter::WriteCodeMethodVisitor : public OatDexMethodVisitor { break; } default: { - DCHECK_EQ(patch.GetType(), LinkerPatch::Type::kRecordPosition); + DCHECK(false) << "Unexpected linker patch type: " << patch.GetType(); break; } } diff --git a/compiler/oat_writer.h b/compiler/oat_writer.h index db84166ad..511371480 100644 --- a/compiler/oat_writer.h +++ b/compiler/oat_writer.h @@ -225,10 +225,6 @@ class OatWriter { return oat_data_offset_; } - ArrayRef GetAbsolutePatchLocations() const { - return ArrayRef(absolute_patch_locations_); - } - ~OatWriter(); void AddMethodDebugInfos(const std::vector& infos) { diff --git a/compiler/optimizing/code_generator_arm.cc b/compiler/optimizing/code_generator_arm.cc index 7b84ef83c..511bd9b7e 100644 --- a/compiler/optimizing/code_generator_arm.cc +++ b/compiler/optimizing/code_generator_arm.cc @@ -1437,8 +1437,6 @@ CodeGeneratorARM::CodeGeneratorARM(HGraph* graph, graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), pc_relative_type_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), type_bss_entry_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), - boot_image_address_patches_(std::less(), - graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_string_patches_(StringReferenceValueComparator(), graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_class_patches_(TypeReferenceValueComparator(), @@ -7626,9 +7624,7 @@ Literal* CodeGeneratorARM::DeduplicateBootImageTypeLiteral(const DexFile& dex_fi } Literal* CodeGeneratorARM::DeduplicateBootImageAddressLiteral(uint32_t address) { - bool needs_patch = GetCompilerOptions().GetIncludePatchInformation(); - Uint32ToLiteralMap* map = needs_patch ? &boot_image_address_patches_ : &uint32_literals_; - return DeduplicateUint32Literal(dchecked_integral_cast(address), map); + return DeduplicateUint32Literal(dchecked_integral_cast(address), &uint32_literals_); } Literal* CodeGeneratorARM::DeduplicateJitStringLiteral(const DexFile& dex_file, @@ -7679,8 +7675,7 @@ void CodeGeneratorARM::EmitLinkerPatches(ArenaVector* linker_patche /* MOVW+MOVT for each entry */ 2u * pc_relative_string_patches_.size() + boot_image_type_patches_.size() + /* MOVW+MOVT for each entry */ 2u * pc_relative_type_patches_.size() + - /* MOVW+MOVT for each entry */ 2u * type_bss_entry_patches_.size() + - boot_image_address_patches_.size(); + /* MOVW+MOVT for each entry */ 2u * type_bss_entry_patches_.size(); linker_patches->reserve(size); EmitPcRelativeLinkerPatches(pc_relative_dex_cache_patches_, linker_patches); @@ -7714,13 +7709,6 @@ void CodeGeneratorARM::EmitLinkerPatches(ArenaVector* linker_patche target_type.dex_file, target_type.type_index.index_)); } - for (const auto& entry : boot_image_address_patches_) { - DCHECK(GetCompilerOptions().GetIncludePatchInformation()); - Literal* literal = entry.second; - DCHECK(literal->GetLabel()->IsBound()); - uint32_t literal_offset = literal->GetLabel()->Position(); - linker_patches->push_back(LinkerPatch::RecordPosition(literal_offset)); - } DCHECK_EQ(size, linker_patches->size()); } diff --git a/compiler/optimizing/code_generator_arm.h b/compiler/optimizing/code_generator_arm.h index df2dbc74a..e993756b3 100644 --- a/compiler/optimizing/code_generator_arm.h +++ b/compiler/optimizing/code_generator_arm.h @@ -642,8 +642,6 @@ class CodeGeneratorARM : public CodeGenerator { ArenaDeque pc_relative_type_patches_; // PC-relative type patch info for kBssEntry. ArenaDeque type_bss_entry_patches_; - // Deduplication map for patchable boot image addresses. - Uint32ToLiteralMap boot_image_address_patches_; // Patches for string literals in JIT compiled code. StringToLiteralMap jit_string_patches_; diff --git a/compiler/optimizing/code_generator_arm64.cc b/compiler/optimizing/code_generator_arm64.cc index 18c95b3c4..f5038fb1c 100644 --- a/compiler/optimizing/code_generator_arm64.cc +++ b/compiler/optimizing/code_generator_arm64.cc @@ -1200,8 +1200,6 @@ CodeGeneratorARM64::CodeGeneratorARM64(HGraph* graph, graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), pc_relative_type_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), type_bss_entry_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), - boot_image_address_patches_(std::less(), - graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_string_patches_(StringReferenceValueComparator(), graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_class_patches_(TypeReferenceValueComparator(), @@ -4328,9 +4326,7 @@ vixl::aarch64::Literal* CodeGeneratorARM64::DeduplicateBootImageTypeLi vixl::aarch64::Literal* CodeGeneratorARM64::DeduplicateBootImageAddressLiteral( uint64_t address) { - bool needs_patch = GetCompilerOptions().GetIncludePatchInformation(); - Uint32ToLiteralMap* map = needs_patch ? &boot_image_address_patches_ : &uint32_literals_; - return DeduplicateUint32Literal(dchecked_integral_cast(address), map); + return DeduplicateUint32Literal(dchecked_integral_cast(address), &uint32_literals_); } vixl::aarch64::Literal* CodeGeneratorARM64::DeduplicateJitStringLiteral( @@ -4398,8 +4394,7 @@ void CodeGeneratorARM64::EmitLinkerPatches(ArenaVector* linker_patc pc_relative_string_patches_.size() + boot_image_type_patches_.size() + pc_relative_type_patches_.size() + - type_bss_entry_patches_.size() + - boot_image_address_patches_.size(); + type_bss_entry_patches_.size(); linker_patches->reserve(size); for (const PcRelativePatchInfo& info : pc_relative_dex_cache_patches_) { linker_patches->push_back(LinkerPatch::DexCacheArrayPatch(info.label.GetLocation(), @@ -4433,11 +4428,6 @@ void CodeGeneratorARM64::EmitLinkerPatches(ArenaVector* linker_patc target_type.dex_file, target_type.type_index.index_)); } - for (const auto& entry : boot_image_address_patches_) { - DCHECK(GetCompilerOptions().GetIncludePatchInformation()); - vixl::aarch64::Literal* literal = entry.second; - linker_patches->push_back(LinkerPatch::RecordPosition(literal->GetOffset())); - } DCHECK_EQ(size, linker_patches->size()); } diff --git a/compiler/optimizing/code_generator_arm64.h b/compiler/optimizing/code_generator_arm64.h index 5faf29a90..24a602400 100644 --- a/compiler/optimizing/code_generator_arm64.h +++ b/compiler/optimizing/code_generator_arm64.h @@ -761,8 +761,6 @@ class CodeGeneratorARM64 : public CodeGenerator { ArenaDeque pc_relative_type_patches_; // PC-relative type patch info for kBssEntry. ArenaDeque type_bss_entry_patches_; - // Deduplication map for patchable boot image addresses. - Uint32ToLiteralMap boot_image_address_patches_; // Patches for string literals in JIT compiled code. StringToLiteralMap jit_string_patches_; diff --git a/compiler/optimizing/code_generator_arm_vixl.cc b/compiler/optimizing/code_generator_arm_vixl.cc index 6bfbe4a9c..58bf2de70 100644 --- a/compiler/optimizing/code_generator_arm_vixl.cc +++ b/compiler/optimizing/code_generator_arm_vixl.cc @@ -1481,8 +1481,6 @@ CodeGeneratorARMVIXL::CodeGeneratorARMVIXL(HGraph* graph, graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), pc_relative_type_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), type_bss_entry_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), - boot_image_address_patches_(std::less(), - graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_string_patches_(StringReferenceValueComparator(), graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_class_patches_(TypeReferenceValueComparator(), @@ -7738,9 +7736,7 @@ VIXLUInt32Literal* CodeGeneratorARMVIXL::DeduplicateBootImageTypeLiteral( } VIXLUInt32Literal* CodeGeneratorARMVIXL::DeduplicateBootImageAddressLiteral(uint32_t address) { - bool needs_patch = GetCompilerOptions().GetIncludePatchInformation(); - Uint32ToLiteralMap* map = needs_patch ? &boot_image_address_patches_ : &uint32_literals_; - return DeduplicateUint32Literal(dchecked_integral_cast(address), map); + return DeduplicateUint32Literal(dchecked_integral_cast(address), &uint32_literals_); } VIXLUInt32Literal* CodeGeneratorARMVIXL::DeduplicateDexCacheAddressLiteral(uint32_t address) { @@ -7800,8 +7796,7 @@ void CodeGeneratorARMVIXL::EmitLinkerPatches(ArenaVector* linker_pa /* MOVW+MOVT for each entry */ 2u * pc_relative_string_patches_.size() + boot_image_type_patches_.size() + /* MOVW+MOVT for each entry */ 2u * pc_relative_type_patches_.size() + - /* MOVW+MOVT for each entry */ 2u * type_bss_entry_patches_.size() + - boot_image_address_patches_.size(); + /* MOVW+MOVT for each entry */ 2u * type_bss_entry_patches_.size(); linker_patches->reserve(size); EmitPcRelativeLinkerPatches(pc_relative_dex_cache_patches_, linker_patches); @@ -7835,13 +7830,6 @@ void CodeGeneratorARMVIXL::EmitLinkerPatches(ArenaVector* linker_pa target_type.dex_file, target_type.type_index.index_)); } - for (const auto& entry : boot_image_address_patches_) { - DCHECK(GetCompilerOptions().GetIncludePatchInformation()); - VIXLUInt32Literal* literal = entry.second; - DCHECK(literal->IsBound()); - uint32_t literal_offset = literal->GetLocation(); - linker_patches->push_back(LinkerPatch::RecordPosition(literal_offset)); - } DCHECK_EQ(size, linker_patches->size()); } diff --git a/compiler/optimizing/code_generator_arm_vixl.h b/compiler/optimizing/code_generator_arm_vixl.h index 3f52c72bd..92e922d8f 100644 --- a/compiler/optimizing/code_generator_arm_vixl.h +++ b/compiler/optimizing/code_generator_arm_vixl.h @@ -738,8 +738,6 @@ class CodeGeneratorARMVIXL : public CodeGenerator { ArenaDeque pc_relative_type_patches_; // PC-relative type patch info for kBssEntry. ArenaDeque type_bss_entry_patches_; - // Deduplication map for patchable boot image addresses. - Uint32ToLiteralMap boot_image_address_patches_; // Patches for string literals in JIT compiled code. StringToLiteralMap jit_string_patches_; diff --git a/compiler/optimizing/code_generator_mips.cc b/compiler/optimizing/code_generator_mips.cc index 791e63265..3fc7ebde6 100644 --- a/compiler/optimizing/code_generator_mips.cc +++ b/compiler/optimizing/code_generator_mips.cc @@ -482,8 +482,6 @@ CodeGeneratorMIPS::CodeGeneratorMIPS(HGraph* graph, graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), pc_relative_type_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), type_bss_entry_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), - boot_image_address_patches_(std::less(), - graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_string_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_class_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), clobbered_ra_(false) { @@ -1026,8 +1024,7 @@ void CodeGeneratorMIPS::EmitLinkerPatches(ArenaVector* linker_patch pc_relative_type_patches_.size() + type_bss_entry_patches_.size() + boot_image_string_patches_.size() + - boot_image_type_patches_.size() + - boot_image_address_patches_.size(); + boot_image_type_patches_.size(); linker_patches->reserve(size); EmitPcRelativeLinkerPatches(pc_relative_dex_cache_patches_, linker_patches); @@ -1061,13 +1058,6 @@ void CodeGeneratorMIPS::EmitLinkerPatches(ArenaVector* linker_patch target_type.dex_file, target_type.type_index.index_)); } - for (const auto& entry : boot_image_address_patches_) { - DCHECK(GetCompilerOptions().GetIncludePatchInformation()); - Literal* literal = entry.second; - DCHECK(literal->GetLabel()->IsBound()); - uint32_t literal_offset = __ GetLabelLocation(literal->GetLabel()); - linker_patches->push_back(LinkerPatch::RecordPosition(literal_offset)); - } DCHECK_EQ(size, linker_patches->size()); } @@ -1125,9 +1115,7 @@ Literal* CodeGeneratorMIPS::DeduplicateBootImageTypeLiteral(const DexFile& dex_f } Literal* CodeGeneratorMIPS::DeduplicateBootImageAddressLiteral(uint32_t address) { - bool needs_patch = GetCompilerOptions().GetIncludePatchInformation(); - Uint32ToLiteralMap* map = needs_patch ? &boot_image_address_patches_ : &uint32_literals_; - return DeduplicateUint32Literal(dchecked_integral_cast(address), map); + return DeduplicateUint32Literal(dchecked_integral_cast(address), &uint32_literals_); } void CodeGeneratorMIPS::EmitPcRelativeAddressPlaceholderHigh(PcRelativePatchInfo* info, diff --git a/compiler/optimizing/code_generator_mips.h b/compiler/optimizing/code_generator_mips.h index 47eba5024..76ca395a3 100644 --- a/compiler/optimizing/code_generator_mips.h +++ b/compiler/optimizing/code_generator_mips.h @@ -536,8 +536,6 @@ class CodeGeneratorMIPS : public CodeGenerator { ArenaDeque pc_relative_type_patches_; // PC-relative type patch info for kBssEntry. ArenaDeque type_bss_entry_patches_; - // Deduplication map for patchable boot image addresses. - Uint32ToLiteralMap boot_image_address_patches_; // Patches for string root accesses in JIT compiled code. ArenaDeque jit_string_patches_; // Patches for class root accesses in JIT compiled code. diff --git a/compiler/optimizing/code_generator_mips64.cc b/compiler/optimizing/code_generator_mips64.cc index 817854b50..580bc4737 100644 --- a/compiler/optimizing/code_generator_mips64.cc +++ b/compiler/optimizing/code_generator_mips64.cc @@ -430,8 +430,6 @@ CodeGeneratorMIPS64::CodeGeneratorMIPS64(HGraph* graph, graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), pc_relative_type_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), type_bss_entry_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), - boot_image_address_patches_(std::less(), - graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_string_patches_(StringReferenceValueComparator(), graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), jit_class_patches_(TypeReferenceValueComparator(), @@ -937,8 +935,7 @@ void CodeGeneratorMIPS64::EmitLinkerPatches(ArenaVector* linker_pat pc_relative_type_patches_.size() + type_bss_entry_patches_.size() + boot_image_string_patches_.size() + - boot_image_type_patches_.size() + - boot_image_address_patches_.size(); + boot_image_type_patches_.size(); linker_patches->reserve(size); EmitPcRelativeLinkerPatches(pc_relative_dex_cache_patches_, linker_patches); @@ -972,13 +969,6 @@ void CodeGeneratorMIPS64::EmitLinkerPatches(ArenaVector* linker_pat target_type.dex_file, target_type.type_index.index_)); } - for (const auto& entry : boot_image_address_patches_) { - DCHECK(GetCompilerOptions().GetIncludePatchInformation()); - Literal* literal = entry.second; - DCHECK(literal->GetLabel()->IsBound()); - uint32_t literal_offset = __ GetLabelLocation(literal->GetLabel()); - linker_patches->push_back(LinkerPatch::RecordPosition(literal_offset)); - } DCHECK_EQ(size, linker_patches->size()); } @@ -1042,9 +1032,7 @@ Literal* CodeGeneratorMIPS64::DeduplicateBootImageTypeLiteral(const DexFile& dex } Literal* CodeGeneratorMIPS64::DeduplicateBootImageAddressLiteral(uint64_t address) { - bool needs_patch = GetCompilerOptions().GetIncludePatchInformation(); - Uint32ToLiteralMap* map = needs_patch ? &boot_image_address_patches_ : &uint32_literals_; - return DeduplicateUint32Literal(dchecked_integral_cast(address), map); + return DeduplicateUint32Literal(dchecked_integral_cast(address), &uint32_literals_); } void CodeGeneratorMIPS64::EmitPcRelativeAddressPlaceholderHigh(PcRelativePatchInfo* info, diff --git a/compiler/optimizing/code_generator_mips64.h b/compiler/optimizing/code_generator_mips64.h index 26cc7dc78..3056f7f46 100644 --- a/compiler/optimizing/code_generator_mips64.h +++ b/compiler/optimizing/code_generator_mips64.h @@ -492,8 +492,6 @@ class CodeGeneratorMIPS64 : public CodeGenerator { ArenaDeque pc_relative_type_patches_; // PC-relative type patch info for kBssEntry. ArenaDeque type_bss_entry_patches_; - // Deduplication map for patchable boot image addresses. - Uint32ToLiteralMap boot_image_address_patches_; // Patches for string root accesses in JIT compiled code. StringToLiteralMap jit_string_patches_; // Patches for class root accesses in JIT compiled code. diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index b779aed76..0b50619a6 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -1015,7 +1015,6 @@ CodeGeneratorX86::CodeGeneratorX86(HGraph* graph, assembler_(graph->GetArena()), isa_features_(isa_features), pc_relative_dex_cache_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), - simple_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), string_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), boot_image_type_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), type_bss_entry_patches_(graph->GetArena()->Adapter(kArenaAllocCodeGenerator)), @@ -4603,13 +4602,6 @@ void CodeGeneratorX86::GenerateVirtualCall(HInvokeVirtual* invoke, Location temp temp, ArtMethod::EntryPointFromQuickCompiledCodeOffset(kX86PointerSize).Int32Value())); } -void CodeGeneratorX86::RecordSimplePatch() { - if (GetCompilerOptions().GetIncludePatchInformation()) { - simple_patches_.emplace_back(); - __ Bind(&simple_patches_.back()); - } -} - void CodeGeneratorX86::RecordBootStringPatch(HLoadString* load_string) { DCHECK(GetCompilerOptions().IsBootImage()); HX86ComputeBaseMethodAddress* address = nullptr; @@ -4682,17 +4674,12 @@ void CodeGeneratorX86::EmitLinkerPatches(ArenaVector* linker_patche DCHECK(linker_patches->empty()); size_t size = pc_relative_dex_cache_patches_.size() + - simple_patches_.size() + string_patches_.size() + boot_image_type_patches_.size() + type_bss_entry_patches_.size(); linker_patches->reserve(size); EmitPcRelativeLinkerPatches(pc_relative_dex_cache_patches_, linker_patches); - for (const Label& label : simple_patches_) { - uint32_t literal_offset = label.Position() - kLabelPositionToLiteralOffsetAdjustment; - linker_patches->push_back(LinkerPatch::RecordPosition(literal_offset)); - } if (!GetCompilerOptions().IsBootImage()) { DCHECK(boot_image_type_patches_.empty()); EmitPcRelativeLinkerPatches(string_patches_, linker_patches); @@ -6154,7 +6141,6 @@ void InstructionCodeGeneratorX86::VisitLoadClass(HLoadClass* cls) NO_THREAD_SAFE reinterpret_cast(cls->GetClass().Get())); DCHECK_NE(address, 0u); __ movl(out, Immediate(address)); - codegen_->RecordSimplePatch(); break; } case HLoadClass::LoadKind::kBssEntry: { @@ -6311,7 +6297,6 @@ void InstructionCodeGeneratorX86::VisitLoadString(HLoadString* load) NO_THREAD_S reinterpret_cast(load->GetString().Get())); DCHECK_NE(address, 0u); __ movl(out, Immediate(address)); - codegen_->RecordSimplePatch(); return; // No dex cache slow path. } case HLoadString::LoadKind::kBssEntry: { diff --git a/compiler/optimizing/code_generator_x86.h b/compiler/optimizing/code_generator_x86.h index 5360dc920..65ee383b5 100644 --- a/compiler/optimizing/code_generator_x86.h +++ b/compiler/optimizing/code_generator_x86.h @@ -412,7 +412,6 @@ class CodeGeneratorX86 : public CodeGenerator { // Generate a call to a virtual method. void GenerateVirtualCall(HInvokeVirtual* invoke, Location temp) OVERRIDE; - void RecordSimplePatch(); void RecordBootStringPatch(HLoadString* load_string); void RecordBootTypePatch(HLoadClass* load_class); Label* NewTypeBssEntryPatch(HLoadClass* load_class); @@ -633,8 +632,6 @@ class CodeGeneratorX86 : public CodeGenerator { // PC-relative DexCache access info. ArenaDeque pc_relative_dex_cache_patches_; - // Patch locations for patchoat where the linker doesn't do any other work. - ArenaDeque