From f4da675bbc4615c5f854c81964cac9dd1153baea Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 1 Aug 2014 19:04:18 +0100 Subject: Implement method calls using relative BL on ARM. Store the linker patches with each CompiledMethod instead of keeping them in CompilerDriver. Reorganize oat file creation to apply the patches as we're writing the method code. Add framework for platform-specific relative call patches in the OatWriter. Implement relative call patches for ARM. Change-Id: Ie2effb3d92b61ac8f356140eba09dc37d62290f8 --- compiler/compiled_method.cc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'compiler/compiled_method.cc') diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc index ba5bd30b01..698bf3b670 100644 --- a/compiler/compiled_method.cc +++ b/compiler/compiled_method.cc @@ -152,14 +152,16 @@ CompiledMethod::CompiledMethod(CompilerDriver* driver, const std::vector& mapping_table, const std::vector& vmap_table, const std::vector& native_gc_map, - const std::vector* cfi_info) + const std::vector* cfi_info, + const ArrayRef& patches) : CompiledCode(driver, instruction_set, quick_code), frame_size_in_bytes_(frame_size_in_bytes), core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask), src_mapping_table_(driver->DeduplicateSrcMappingTable(src_mapping_table->Arrange())), mapping_table_(driver->DeduplicateMappingTable(mapping_table)), vmap_table_(driver->DeduplicateVMapTable(vmap_table)), gc_map_(driver->DeduplicateGCMap(native_gc_map)), - cfi_info_(driver->DeduplicateCFIInfo(cfi_info)) { + cfi_info_(driver->DeduplicateCFIInfo(cfi_info)), + patches_(patches.begin(), patches.end()) { } CompiledMethod::CompiledMethod(CompilerDriver* driver, @@ -178,7 +180,8 @@ CompiledMethod::CompiledMethod(CompilerDriver* driver, mapping_table_(driver->DeduplicateMappingTable(mapping_table)), vmap_table_(driver->DeduplicateVMapTable(stack_map)), gc_map_(nullptr), - cfi_info_(nullptr) { + cfi_info_(nullptr), + patches_() { } CompiledMethod::CompiledMethod(CompilerDriver* driver, @@ -195,7 +198,8 @@ CompiledMethod::CompiledMethod(CompilerDriver* driver, mapping_table_(driver->DeduplicateMappingTable(std::vector())), vmap_table_(driver->DeduplicateVMapTable(std::vector())), gc_map_(driver->DeduplicateGCMap(std::vector())), - cfi_info_(driver->DeduplicateCFIInfo(cfi_info)) { + cfi_info_(driver->DeduplicateCFIInfo(cfi_info)), + patches_() { } // Constructs a CompiledMethod for the Portable compiler. @@ -208,7 +212,9 @@ CompiledMethod::CompiledMethod(CompilerDriver* driver, InstructionSet instructio src_mapping_table_(driver->DeduplicateSrcMappingTable(SrcMap())), mapping_table_(driver->DeduplicateMappingTable(std::vector())), vmap_table_(driver->DeduplicateVMapTable(std::vector())), - gc_map_(driver->DeduplicateGCMap(gc_map)) { + gc_map_(driver->DeduplicateGCMap(gc_map)), + cfi_info_(nullptr), + patches_() { } CompiledMethod::CompiledMethod(CompilerDriver* driver, InstructionSet instruction_set, @@ -219,7 +225,9 @@ CompiledMethod::CompiledMethod(CompilerDriver* driver, InstructionSet instructio src_mapping_table_(driver->DeduplicateSrcMappingTable(SrcMap())), mapping_table_(driver->DeduplicateMappingTable(std::vector())), vmap_table_(driver->DeduplicateVMapTable(std::vector())), - gc_map_(driver->DeduplicateGCMap(std::vector())) { + gc_map_(driver->DeduplicateGCMap(std::vector())), + cfi_info_(nullptr), + patches_() { } } // namespace art -- cgit v1.2.3-59-g8ed1b