diff options
author | Dave Allison <dallison@google.com> | 2014-02-19 14:05:39 -0800 |
---|---|---|
committer | Dave Allison <dallison@google.com> | 2014-04-04 16:07:46 -0700 |
commit | 754ddad084ccb610d0cf486f6131bdc69bae5bc6 (patch) | |
tree | 18d8314f3f6760b035c2bcda7760782ad4f0e0bf /compiler/compiled_method.cc | |
parent | 97a332b4476d5a2b4ad0650dacc6bfcff882fc57 (diff) | |
download | art-754ddad084ccb610d0cf486f6131bdc69bae5bc6.tar.gz art-754ddad084ccb610d0cf486f6131bdc69bae5bc6.tar.bz2 art-754ddad084ccb610d0cf486f6131bdc69bae5bc6.zip |
Use trampolines for calls to helpers
This is an ARM specific optimization to the compiler
that uses trampoline islands to make calls to runtime
helper functions. The intention is to reduce the size
of the generated code (by 2 bytes per call) without
affecting performance.
By default this is on when generating an OAT file. It is
off when compiling to memory.
To switch this off in dex2oat, use the command line option:
--no-helper-trampolines
Enhances disassembler to print the trampoline entry on the
BL instruction like this:
0xb6a850c0: f7ffff9e bl -196 (0xb6a85000) ; pTestSuspend
Bug: 12607709
Change-Id: I9202bdb7cf21252ad807bd48701f1f6ce8e3d0fe
Diffstat (limited to 'compiler/compiled_method.cc')
-rw-r--r-- | compiler/compiled_method.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/compiler/compiled_method.cc b/compiler/compiled_method.cc index 8e013c1ece..4eb1f7a7ce 100644 --- a/compiler/compiled_method.cc +++ b/compiler/compiled_method.cc @@ -16,20 +16,23 @@ #include "compiled_method.h" #include "driver/compiler_driver.h" +#include "oat_writer.h" +#include "dex/compiler_ir.h" namespace art { CompiledCode::CompiledCode(CompilerDriver* compiler_driver, InstructionSet instruction_set, - const std::vector<uint8_t>& quick_code) + const std::vector<uint8_t>& quick_code, + const FinalRelocations* relocs) : compiler_driver_(compiler_driver), instruction_set_(instruction_set), - portable_code_(nullptr), quick_code_(nullptr) { + portable_code_(nullptr), quick_code_(nullptr), final_relocations_(relocs) { SetCode(&quick_code, nullptr); } CompiledCode::CompiledCode(CompilerDriver* compiler_driver, InstructionSet instruction_set, const std::string& elf_object, const std::string& symbol) : compiler_driver_(compiler_driver), instruction_set_(instruction_set), - portable_code_(nullptr), quick_code_(nullptr), symbol_(symbol) { + portable_code_(nullptr), quick_code_(nullptr), symbol_(symbol), final_relocations_(nullptr) { CHECK_NE(elf_object.size(), 0U); CHECK_NE(symbol.size(), 0U); std::vector<uint8_t> temp_code(elf_object.size()); @@ -161,8 +164,9 @@ CompiledMethod::CompiledMethod(CompilerDriver& driver, const std::vector<uint8_t>& mapping_table, const std::vector<uint8_t>& vmap_table, const std::vector<uint8_t>& native_gc_map, - const std::vector<uint8_t>* cfi_info) - : CompiledCode(&driver, instruction_set, quick_code), frame_size_in_bytes_(frame_size_in_bytes), + const std::vector<uint8_t>* cfi_info, + const FinalRelocations* relocs) + : CompiledCode(&driver, instruction_set, quick_code, relocs), frame_size_in_bytes_(frame_size_in_bytes), core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask), mapping_table_(driver.DeduplicateMappingTable(mapping_table)), vmap_table_(driver.DeduplicateVMapTable(vmap_table)), @@ -176,7 +180,7 @@ CompiledMethod::CompiledMethod(CompilerDriver& driver, const size_t frame_size_in_bytes, const uint32_t core_spill_mask, const uint32_t fp_spill_mask) - : CompiledCode(&driver, instruction_set, code), + : CompiledCode(&driver, instruction_set, code, nullptr), frame_size_in_bytes_(frame_size_in_bytes), core_spill_mask_(core_spill_mask), fp_spill_mask_(fp_spill_mask), mapping_table_(driver.DeduplicateMappingTable(std::vector<uint8_t>())), @@ -205,5 +209,4 @@ CompiledMethod::CompiledMethod(CompilerDriver& driver, InstructionSet instructio vmap_table_ = driver.DeduplicateVMapTable(std::vector<uint8_t>()); gc_map_ = driver.DeduplicateGCMap(std::vector<uint8_t>()); } - } // namespace art |