diff options
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/common_compiler_test.cc | 12 | ||||
-rw-r--r-- | compiler/common_compiler_test.h | 14 | ||||
-rw-r--r-- | compiler/dex/quick/gen_loadstore.cc | 4 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 2 | ||||
-rw-r--r-- | compiler/image_test.cc | 1 |
5 files changed, 27 insertions, 6 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index 0a1e2e35a6..4b6788429a 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -182,13 +182,11 @@ void CommonCompilerTest::SetUp() { } } - // TODO: make selectable - Compiler::Kind compiler_kind = Compiler::kQuick; timer_.reset(new CumulativeLogger("Compilation times")); compiler_driver_.reset(new CompilerDriver(compiler_options_.get(), verification_results_.get(), method_inliner_map_.get(), - compiler_kind, instruction_set, + compiler_kind_, instruction_set, instruction_set_features_.get(), true, GetImageClasses(), @@ -211,6 +209,14 @@ void CommonCompilerTest::SetUpRuntimeOptions(RuntimeOptions* options) { CompilerCallbacks::CallbackMode::kCompileApp)); } +Compiler::Kind CommonCompilerTest::GetCompilerKind() const { + return compiler_kind_; +} + +void CommonCompilerTest::SetCompilerKind(Compiler::Kind compiler_kind) { + compiler_kind_ = compiler_kind; +} + void CommonCompilerTest::TearDown() { timer_.reset(); compiler_driver_.reset(); diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index 769319be40..b828fcf7e1 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -22,6 +22,7 @@ #include <vector> #include "common_runtime_test.h" +#include "compiler.h" #include "oat_file.h" namespace art { @@ -55,7 +56,10 @@ class CommonCompilerTest : public CommonRuntimeTest { protected: virtual void SetUp(); - virtual void SetUpRuntimeOptions(RuntimeOptions *options); + virtual void SetUpRuntimeOptions(RuntimeOptions* options); + + Compiler::Kind GetCompilerKind() const; + void SetCompilerKind(Compiler::Kind compiler_kind); // Get the set of image classes given to the compiler-driver in SetUp. Note: the compiler // driver assumes ownership of the set, so the test should properly release the set. @@ -88,6 +92,7 @@ class CommonCompilerTest : public CommonRuntimeTest { void UnreserveImageSpace(); + Compiler::Kind compiler_kind_ = kUseOptimizingCompiler ? Compiler::kOptimizing : Compiler::kQuick; std::unique_ptr<CompilerOptions> compiler_options_; std::unique_ptr<VerificationResults> verification_results_; std::unique_ptr<DexFileToMethodInlinerMap> method_inliner_map_; @@ -103,6 +108,13 @@ class CommonCompilerTest : public CommonRuntimeTest { std::list<std::vector<uint8_t>> header_code_and_maps_chunks_; }; +// TODO: When non-PIC works with all compilers in use, get rid of this. +#define TEST_DISABLED_FOR_NON_PIC_COMPILING_WITH_OPTIMIZING() \ + if (GetCompilerKind() == Compiler::kOptimizing) { \ + printf("WARNING: TEST DISABLED FOR NON-PIC COMPILING WITH OPTIMIZING\n"); \ + return; \ + } + } // namespace art #endif // ART_COMPILER_COMMON_COMPILER_TEST_H_ diff --git a/compiler/dex/quick/gen_loadstore.cc b/compiler/dex/quick/gen_loadstore.cc index aa95e77f6d..3f89001772 100644 --- a/compiler/dex/quick/gen_loadstore.cc +++ b/compiler/dex/quick/gen_loadstore.cc @@ -107,7 +107,9 @@ void Mir2Lir::LoadValueDirectWideFixed(RegLocation rl_src, RegStorage r_dest) { } RegLocation Mir2Lir::LoadValue(RegLocation rl_src, RegisterClass op_kind) { - DCHECK(!rl_src.ref || op_kind == kRefReg); + // If op_kind isn't a reference, rl_src should not be marked as a reference either + // unless we've seen type conflicts (i.e. register promotion is disabled). + DCHECK(op_kind == kRefReg || (!rl_src.ref || (cu_->disable_opt & (1u << kPromoteRegs)) != 0u)); rl_src = UpdateLoc(rl_src); if (rl_src.location == kLocPhysReg) { if (!RegClassMatches(op_kind, rl_src.reg)) { diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index f737007308..2d7ceaeea1 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -668,7 +668,7 @@ class CompilerDriver { bool dedupe_enabled_; bool dump_stats_; const bool dump_passes_; - const std::string& dump_cfg_file_name_; + const std::string dump_cfg_file_name_; CumulativeLogger* const timings_logger_; diff --git a/compiler/image_test.cc b/compiler/image_test.cc index 772cc80146..7e31a7a08b 100644 --- a/compiler/image_test.cc +++ b/compiler/image_test.cc @@ -45,6 +45,7 @@ class ImageTest : public CommonCompilerTest { }; TEST_F(ImageTest, WriteRead) { + TEST_DISABLED_FOR_NON_PIC_COMPILING_WITH_OPTIMIZING(); // Create a generic location tmp file, to be the base of the .art and .oat temporary files. ScratchFile location; ScratchFile image_location(location, ".art"); |