diff options
author | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-25 23:42:00 +0000 |
---|---|---|
committer | Nicolas Geoffray <ngeoffray@google.com> | 2014-11-25 23:56:30 +0000 |
commit | 9bb492a33c97e72d0c43a4ee968e34cc32534981 (patch) | |
tree | 93c3b4218e2bdecf80e55ebe77eda6dbeb2df2f9 | |
parent | dc00c73d24a46c8522176fbc539f3e39710807c2 (diff) | |
download | art-9bb492a33c97e72d0c43a4ee968e34cc32534981.zip art-9bb492a33c97e72d0c43a4ee968e34cc32534981.tar.gz art-9bb492a33c97e72d0c43a4ee968e34cc32534981.tar.bz2 |
Add ART_USE_OPTIMIZING_COMPILER flag.
Change-Id: I86065aec5bfe59729c6a4064a3e54d5b523ca45c
-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 7b38e5e..7d34dae 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 7d4b726..3be5751 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 4d33196..3104229 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; |