diff options
author | 2024-03-06 16:08:30 +0000 | |
---|---|---|
committer | 2024-03-07 13:09:23 +0000 | |
commit | 3370f9fc477f0b25c4c6b10321b3f8e46903ad4f (patch) | |
tree | 1ec09145709f81de8baca9b543aa471a04b41a72 | |
parent | c8b6e26aa56bb6761bb781d1095b36f84c4c65d4 (diff) |
Remove Compiler::Kind
It only has one true value (Optimizing) since Quick is obsolete.
Bug: 289199192
Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b
Change-Id: Ib7394d4e54cf3e22ea7fc09b9a951081d71f0365
-rw-r--r-- | compiler/common_compiler_test.cc | 11 | ||||
-rw-r--r-- | compiler/common_compiler_test.h | 5 | ||||
-rw-r--r-- | compiler/compiler.cc | 15 | ||||
-rw-r--r-- | compiler/compiler.h | 8 | ||||
-rw-r--r-- | compiler/jit/jit_compiler.cc | 3 | ||||
-rw-r--r-- | dex2oat/common_compiler_driver_test.cc | 1 | ||||
-rw-r--r-- | dex2oat/dex2oat.cc | 9 | ||||
-rw-r--r-- | dex2oat/dex2oat_options.cc | 7 | ||||
-rw-r--r-- | dex2oat/dex2oat_options.def | 1 | ||||
-rw-r--r-- | dex2oat/driver/compiler_driver.cc | 4 | ||||
-rw-r--r-- | dex2oat/driver/compiler_driver.h | 6 |
11 files changed, 8 insertions, 62 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index d2cf3aef3c..8c05888215 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -255,14 +255,6 @@ void CommonCompilerTestImpl::SetUpRuntimeOptionsImpl() { ApplyInstructionSet(); } -Compiler::Kind CommonCompilerTestImpl::GetCompilerKind() const { - return compiler_kind_; -} - -void CommonCompilerTestImpl::SetCompilerKind(Compiler::Kind compiler_kind) { - compiler_kind_ = compiler_kind; -} - void CommonCompilerTestImpl::TearDown() { code_and_metadata_.clear(); compiler_options_.reset(); @@ -278,8 +270,7 @@ void CommonCompilerTestImpl::CompileMethod(ArtMethod* method) { DCHECK(!Runtime::Current()->IsStarted()); Thread* self = Thread::Current(); StackHandleScope<2> hs(self); - std::unique_ptr<Compiler> compiler( - Compiler::Create(*compiler_options_, &storage, compiler_kind_)); + std::unique_ptr<Compiler> compiler(Compiler::Create(*compiler_options_, &storage)); const DexFile& dex_file = *method->GetDexFile(); Handle<mirror::DexCache> dex_cache = hs.NewHandle(GetClassLinker()->FindDexCache(self, dex_file)); diff --git a/compiler/common_compiler_test.h b/compiler/common_compiler_test.h index 89f3fb40ad..30d5734ba3 100644 --- a/compiler/common_compiler_test.h +++ b/compiler/common_compiler_test.h @@ -60,9 +60,6 @@ class EXPORT CommonCompilerTestImpl { void SetUpRuntimeOptionsImpl(); - Compiler::Kind GetCompilerKind() const; - void SetCompilerKind(Compiler::Kind compiler_kind); - virtual CompilerFilter::Filter GetCompilerFilter() const { return CompilerFilter::kDefaultCompilerFilter; } @@ -76,8 +73,6 @@ class EXPORT CommonCompilerTestImpl { void ClearBootImageOption(); - Compiler::Kind compiler_kind_ = Compiler::kOptimizing; - InstructionSet instruction_set_ = (kRuntimeISA == InstructionSet::kArm) ? InstructionSet::kThumb2 : kRuntimeISA; // Take the default set of instruction features from the build. diff --git a/compiler/compiler.cc b/compiler/compiler.cc index 0e040ac54a..9cbd65d89d 100644 --- a/compiler/compiler.cc +++ b/compiler/compiler.cc @@ -27,22 +27,11 @@ namespace art HIDDEN { -Compiler* Compiler::Create(const CompilerOptions& compiler_options, - CompiledCodeStorage* storage, - Compiler::Kind kind) { +Compiler* Compiler::Create(const CompilerOptions& compiler_options, CompiledCodeStorage* storage) { // Check that oat version when runtime was compiled matches the oat version of the compiler. constexpr std::array<uint8_t, 4> compiler_oat_version = OatHeader::kOatVersion; OatHeader::CheckOatVersion(compiler_oat_version); - switch (kind) { - case kQuick: - // TODO: Remove Quick in options. - case kOptimizing: - return CreateOptimizingCompiler(compiler_options, storage); - - default: - LOG(FATAL) << "UNREACHABLE"; - UNREACHABLE(); - } + return CreateOptimizingCompiler(compiler_options, storage); } bool Compiler::IsPathologicalCase(const dex::CodeItem& code_item, diff --git a/compiler/compiler.h b/compiler/compiler.h index 6c317f7e02..843bbbb083 100644 --- a/compiler/compiler.h +++ b/compiler/compiler.h @@ -48,14 +48,8 @@ class Thread; class Compiler { public: - enum Kind { - kQuick, - kOptimizing - }; - EXPORT static Compiler* Create(const CompilerOptions& compiler_options, - CompiledCodeStorage* storage, - Kind kind); + CompiledCodeStorage* storage); virtual bool CanCompileMethod(uint32_t method_idx, const DexFile& dex_file) const = 0; diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index c14d5d37e8..051368cc8a 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -165,8 +165,7 @@ std::vector<uint8_t> JitCompiler::PackElfFileForJIT(ArrayRef<const JITCodeEntry* JitCompiler::JitCompiler() { compiler_options_.reset(new CompilerOptions()); ParseCompilerOptions(); - compiler_.reset( - Compiler::Create(*compiler_options_, /*storage=*/ nullptr, Compiler::kOptimizing)); + compiler_.reset(Compiler::Create(*compiler_options_, /*storage=*/ nullptr)); } JitCompiler::~JitCompiler() { diff --git a/dex2oat/common_compiler_driver_test.cc b/dex2oat/common_compiler_driver_test.cc index 91fa859c92..81e06b2345 100644 --- a/dex2oat/common_compiler_driver_test.cc +++ b/dex2oat/common_compiler_driver_test.cc @@ -89,7 +89,6 @@ void CommonCompilerDriverTest::CreateCompilerDriver() { compiler_options_->profile_compilation_info_ = GetProfileCompilationInfo(); compiler_driver_.reset(new CompilerDriver(compiler_options_.get(), verification_results_.get(), - compiler_kind_, number_of_threads_, /* swap_fd= */ -1)); } diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index c76929c030..6d33be3d97 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -510,9 +510,7 @@ class OatKeyValueStore : public SafeMap<std::string, std::string> { class Dex2Oat final { public: explicit Dex2Oat(TimingLogger* timings) - : compiler_kind_(Compiler::kOptimizing), - // Take the default set of instruction features from the build. - key_value_store_(nullptr), + : key_value_store_(nullptr), verification_results_(nullptr), runtime_(nullptr), thread_count_(sysconf(_SC_NPROCESSORS_CONF)), @@ -1119,9 +1117,6 @@ class Dex2Oat final { compact_dex_level_ = CompactDexLevel::kCompactDexLevelNone; } - AssignIfExists(args, M::Backend, &compiler_kind_); - parser_options->requested_specific_compiler = args.Exists(M::Backend); - AssignIfExists(args, M::TargetInstructionSet, &compiler_options_->instruction_set_); // arm actually means thumb2. if (compiler_options_->instruction_set_ == InstructionSet::kArm) { @@ -1910,7 +1905,6 @@ class Dex2Oat final { driver_.reset(new CompilerDriver(compiler_options_.get(), verification_results_.get(), - compiler_kind_, thread_count_, swap_fd_)); @@ -2908,7 +2902,6 @@ class Dex2Oat final { } std::unique_ptr<CompilerOptions> compiler_options_; - Compiler::Kind compiler_kind_; std::unique_ptr<OatKeyValueStore> key_value_store_; diff --git a/dex2oat/dex2oat_options.cc b/dex2oat/dex2oat_options.cc index 7386fe15f6..adeecccc5e 100644 --- a/dex2oat/dex2oat_options.cc +++ b/dex2oat/dex2oat_options.cc @@ -339,12 +339,6 @@ Parser CreateDex2oatArgumentParser() { "Eg: --android-root=out/host/linux-x86\n" "Default: $ANDROID_ROOT") .IntoKey(M::AndroidRoot) - .Define("--compiler-backend=_") - .WithType<Compiler::Kind>() - .WithValueMap({{"Quick", Compiler::Kind::kQuick}, - {"Optimizing", Compiler::Kind::kOptimizing}}) - .WithHelp("Select a compiler backend set. Default: optimizing") - .IntoKey(M::Backend) .Define("--host") .WithHelp("Run in host mode") .IntoKey(M::Host) @@ -463,6 +457,7 @@ Parser CreateDex2oatArgumentParser() { .Ignore({ "--comments=_", "--cache-info-fd=_", // Handled in mark_compact.cc. + "--compiler-backend", }); // clang-format on diff --git a/dex2oat/dex2oat_options.def b/dex2oat/dex2oat_options.def index 7c071dc898..9a05d2b4df 100644 --- a/dex2oat/dex2oat_options.def +++ b/dex2oat/dex2oat_options.def @@ -66,7 +66,6 @@ DEX2OAT_OPTIONS_KEY (std::string, AndroidRoot) DEX2OAT_OPTIONS_KEY (InstructionSet, TargetInstructionSet) DEX2OAT_OPTIONS_KEY (std::string, TargetInstructionSetVariant) DEX2OAT_OPTIONS_KEY (std::string, TargetInstructionSetFeatures) -DEX2OAT_OPTIONS_KEY (Compiler::Kind, Backend) DEX2OAT_OPTIONS_KEY (std::vector<std::string>, Profile) DEX2OAT_OPTIONS_KEY (std::vector<int>, ProfileFd) DEX2OAT_OPTIONS_KEY (Unit, Host) diff --git a/dex2oat/driver/compiler_driver.cc b/dex2oat/driver/compiler_driver.cc index 39a68537e2..731a57e140 100644 --- a/dex2oat/driver/compiler_driver.cc +++ b/dex2oat/driver/compiler_driver.cc @@ -254,13 +254,11 @@ class CompilerDriver::AOTCompilationStats { CompilerDriver::CompilerDriver( const CompilerOptions* compiler_options, const VerificationResults* verification_results, - Compiler::Kind compiler_kind, size_t thread_count, int swap_fd) : compiler_options_(compiler_options), verification_results_(verification_results), compiler_(), - compiler_kind_(compiler_kind), number_of_soft_verifier_failures_(0), had_hard_verifier_failure_(false), parallel_thread_count_(thread_count), @@ -270,7 +268,7 @@ CompilerDriver::CompilerDriver( DCHECK(compiler_options_ != nullptr); compiled_method_storage_.SetDedupeEnabled(compiler_options_->DeduplicateCode()); - compiler_.reset(Compiler::Create(*compiler_options, &compiled_method_storage_, compiler_kind)); + compiler_.reset(Compiler::Create(*compiler_options, &compiled_method_storage_)); } CompilerDriver::~CompilerDriver() { diff --git a/dex2oat/driver/compiler_driver.h b/dex2oat/driver/compiler_driver.h index 7985771246..c57e4cf371 100644 --- a/dex2oat/driver/compiler_driver.h +++ b/dex2oat/driver/compiler_driver.h @@ -86,7 +86,6 @@ class CompilerDriver { // classes. CompilerDriver(const CompilerOptions* compiler_options, const VerificationResults* verification_results, - Compiler::Kind compiler_kind, size_t thread_count, int swap_fd); @@ -214,10 +213,6 @@ class CompilerDriver { number_of_soft_verifier_failures_++; } - Compiler::Kind GetCompilerKind() { - return compiler_kind_; - } - CompiledMethodStorage* GetCompiledMethodStorage() { return &compiled_method_storage_; } @@ -303,7 +298,6 @@ class CompilerDriver { const VerificationResults* const verification_results_; std::unique_ptr<Compiler> compiler_; - Compiler::Kind compiler_kind_; // All class references that this compiler has compiled. Indexed by class defs. using ClassStateTable = AtomicDexRefMap<ClassReference, ClassStatus>; |