diff options
| -rw-r--r-- | build/Android.common_build.mk | 4 | ||||
| -rw-r--r-- | dex2oat/dex2oat.cc | 10 | ||||
| -rw-r--r-- | runtime/globals.h | 6 |
3 files changed, 18 insertions, 2 deletions
diff --git a/build/Android.common_build.mk b/build/Android.common_build.mk index 7b38e5ed4c..7d34daef98 100644 --- a/build/Android.common_build.mk +++ b/build/Android.common_build.mk @@ -228,6 +228,10 @@ ifeq ($(ART_SEA_IR_MODE),true) art_cflags += -DART_SEA_IR_MODE=1 endif +ifeq ($(ART_USE_OPTIMIZING_COMPILER),true) + art_cflags += -DART_USE_OPTIMIZING_COMPILER=1 +endif + # Cflags for non-debug ART and ART tools. art_non_debug_cflags := \ -O3 diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 7d4b726292..3be57516f9 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -419,7 +419,9 @@ static void ParseDouble(const std::string& option, char after_char, double min, class Dex2Oat FINAL { public: explicit Dex2Oat(TimingLogger* timings) : - compiler_kind_(kUsePortableCompiler ? Compiler::kPortable : Compiler::kQuick), + compiler_kind_(kUsePortableCompiler + ? Compiler::kPortable + : (kUseOptimizingCompiler ? Compiler::kOptimizing : Compiler::kQuick)), instruction_set_(kRuntimeISA), // Take the default set of instruction features from the build. method_inliner_map_(), @@ -597,7 +599,6 @@ class Dex2Oat FINAL { compiler_kind_ = Compiler::kQuick; } else if (backend_str == "Optimizing") { compiler_kind_ = Compiler::kOptimizing; - compile_pic = true; } else if (backend_str == "Portable") { compiler_kind_ = Compiler::kPortable; } else { @@ -707,6 +708,11 @@ class Dex2Oat FINAL { } } + if (compiler_kind_ == Compiler::kOptimizing) { + // Optimizing only supports PIC mode. + compile_pic = true; + } + if (oat_filename_.empty() && oat_fd_ == -1) { Usage("Output must be supplied with either --oat-file or --oat-fd"); } diff --git a/runtime/globals.h b/runtime/globals.h index 4d33196c98..3104229b17 100644 --- a/runtime/globals.h +++ b/runtime/globals.h @@ -64,6 +64,12 @@ static constexpr bool kUsePortableCompiler = true; static constexpr bool kUsePortableCompiler = false; #endif +#if defined(ART_USE_OPTIMIZING_COMPILER) +static constexpr bool kUseOptimizingCompiler = true; +#else +static constexpr bool kUseOptimizingCompiler = false; +#endif + // Garbage collector constants. static constexpr bool kMovingCollector = true && !kUsePortableCompiler; static constexpr bool kMarkCompactSupport = false && kMovingCollector; |