From 754ddad084ccb610d0cf486f6131bdc69bae5bc6 Mon Sep 17 00:00:00 2001 From: Dave Allison Date: Wed, 19 Feb 2014 14:05:39 -0800 Subject: 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 --- compiler/driver/compiler_options.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'compiler/driver/compiler_options.h') diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index 20c6bc8e4e..52248a6c5a 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -50,7 +50,8 @@ class CompilerOptions { small_method_threshold_(kDefaultSmallMethodThreshold), tiny_method_threshold_(kDefaultTinyMethodThreshold), num_dex_methods_threshold_(kDefaultNumDexMethodsThreshold), - generate_gdb_information_(false) + generate_gdb_information_(false), + generate_helper_trampolines_(false) #ifdef ART_SEA_IR_MODE , sea_ir_mode_(false) #endif @@ -62,7 +63,8 @@ class CompilerOptions { size_t small_method_threshold, size_t tiny_method_threshold, size_t num_dex_methods_threshold, - bool generate_gdb_information + bool generate_gdb_information, + bool generate_helper_trampolines #ifdef ART_SEA_IR_MODE , bool sea_ir_mode #endif @@ -73,7 +75,8 @@ class CompilerOptions { small_method_threshold_(small_method_threshold), tiny_method_threshold_(tiny_method_threshold), num_dex_methods_threshold_(num_dex_methods_threshold), - generate_gdb_information_(generate_gdb_information) + generate_gdb_information_(generate_gdb_information), + generate_helper_trampolines_(generate_helper_trampolines) #ifdef ART_SEA_IR_MODE , sea_ir_mode_(sea_ir_mode) #endif @@ -140,6 +143,10 @@ class CompilerOptions { return generate_gdb_information_; } + bool GenerateHelperTrampolines() const { + return generate_helper_trampolines_; + } + private: CompilerFilter compiler_filter_; size_t huge_method_threshold_; @@ -148,6 +155,7 @@ class CompilerOptions { size_t tiny_method_threshold_; size_t num_dex_methods_threshold_; bool generate_gdb_information_; + bool generate_helper_trampolines_; #ifdef ART_SEA_IR_MODE bool sea_ir_mode_; -- cgit v1.2.3-59-g8ed1b