diff options
-rw-r--r-- | compiler/common_compiler_test.cc | 2 | ||||
-rw-r--r-- | compiler/dex/quick/quick_cfi_test.cc | 4 | ||||
-rw-r--r-- | compiler/dex/quick/x86/quick_assemble_x86_test.cc | 4 | ||||
-rw-r--r-- | compiler/driver/compiled_method_storage_test.cc | 2 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.cc | 3 | ||||
-rw-r--r-- | compiler/driver/compiler_driver.h | 11 | ||||
-rw-r--r-- | compiler/driver/compiler_options.cc | 16 | ||||
-rw-r--r-- | compiler/driver/compiler_options.h | 15 | ||||
-rw-r--r-- | compiler/jit/jit_compiler.cc | 6 | ||||
-rw-r--r-- | compiler/linker/relative_patcher_test.h | 2 | ||||
-rw-r--r-- | compiler/oat_test.cc | 2 | ||||
-rw-r--r-- | compiler/optimizing/optimizing_compiler.cc | 6 | ||||
-rw-r--r-- | dex2oat/dex2oat.cc | 9 |
13 files changed, 38 insertions, 44 deletions
diff --git a/compiler/common_compiler_test.cc b/compiler/common_compiler_test.cc index b5fd1e074f..9594dce029 100644 --- a/compiler/common_compiler_test.cc +++ b/compiler/common_compiler_test.cc @@ -204,8 +204,6 @@ void CommonCompilerTest::CreateCompilerDriver(Compiler::Kind kind, InstructionSe 2, true, true, - "", - false, timer_.get(), -1, /* dex_to_oat_map */ nullptr, diff --git a/compiler/dex/quick/quick_cfi_test.cc b/compiler/dex/quick/quick_cfi_test.cc index 12568a4ad4..c5df134493 100644 --- a/compiler/dex/quick/quick_cfi_test.cc +++ b/compiler/dex/quick/quick_cfi_test.cc @@ -69,6 +69,8 @@ class QuickCFITest : public CFITest { false, nullptr, nullptr, + false, + "", false); VerificationResults verification_results(&compiler_options); DexFileToMethodInlinerMap method_inliner_map; @@ -88,8 +90,6 @@ class QuickCFITest : public CFITest { 0, false, false, - "", - false, 0, -1, nullptr, diff --git a/compiler/dex/quick/x86/quick_assemble_x86_test.cc b/compiler/dex/quick/x86/quick_assemble_x86_test.cc index b39fe4da4f..d63878d6b9 100644 --- a/compiler/dex/quick/x86/quick_assemble_x86_test.cc +++ b/compiler/dex/quick/x86/quick_assemble_x86_test.cc @@ -52,6 +52,8 @@ class QuickAssembleX86TestBase : public testing::Test { false, nullptr, nullptr, + false, + "", false)); verification_results_.reset(new VerificationResults(compiler_options_.get())); method_inliner_map_.reset(new DexFileToMethodInlinerMap()); @@ -69,8 +71,6 @@ class QuickAssembleX86TestBase : public testing::Test { 0, false, false, - "", - false, 0, -1, nullptr, diff --git a/compiler/driver/compiled_method_storage_test.cc b/compiler/driver/compiled_method_storage_test.cc index f18fa67ea5..2e2d1f99f3 100644 --- a/compiler/driver/compiled_method_storage_test.cc +++ b/compiler/driver/compiled_method_storage_test.cc @@ -41,8 +41,6 @@ TEST(CompiledMethodStorage, Deduplicate) { 1u, false, false, - "", - false, nullptr, -1, nullptr, diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index 043bd93bd7..138863ac38 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -345,7 +345,6 @@ CompilerDriver::CompilerDriver( std::unordered_set<std::string>* compiled_classes, std::unordered_set<std::string>* compiled_methods, size_t thread_count, bool dump_stats, bool dump_passes, - const std::string& dump_cfg_file_name, bool dump_cfg_append, CumulativeLogger* timer, int swap_fd, const std::unordered_map<const DexFile*, const char*>* dex_to_oat_map, const ProfileCompilationInfo* profile_compilation_info) @@ -370,8 +369,6 @@ CompilerDriver::CompilerDriver( stats_(new AOTCompilationStats), dump_stats_(dump_stats), dump_passes_(dump_passes), - dump_cfg_file_name_(dump_cfg_file_name), - dump_cfg_append_(dump_cfg_append), timings_logger_(timer), compiler_context_(nullptr), support_boot_image_fixup_(instruction_set != kMips && instruction_set != kMips64), diff --git a/compiler/driver/compiler_driver.h b/compiler/driver/compiler_driver.h index 17b2f5e98d..6a2f7bfd4e 100644 --- a/compiler/driver/compiler_driver.h +++ b/compiler/driver/compiler_driver.h @@ -95,7 +95,6 @@ class CompilerDriver { std::unordered_set<std::string>* compiled_classes, std::unordered_set<std::string>* compiled_methods, size_t thread_count, bool dump_stats, bool dump_passes, - const std::string& dump_cfg_file_name, bool dump_cfg_append, CumulativeLogger* timer, int swap_fd, const std::unordered_map<const DexFile*, const char*>* dex_to_oat_map, const ProfileCompilationInfo* profile_compilation_info); @@ -423,14 +422,6 @@ class CompilerDriver { return dump_passes_; } - const std::string& GetDumpCfgFileName() const { - return dump_cfg_file_name_; - } - - bool GetDumpCfgAppend() const { - return dump_cfg_append_; - } - CumulativeLogger* GetTimingsLogger() const { return timings_logger_; } @@ -668,8 +659,6 @@ class CompilerDriver { bool dump_stats_; const bool dump_passes_; - const std::string dump_cfg_file_name_; - const bool dump_cfg_append_; CumulativeLogger* const timings_logger_; diff --git a/compiler/driver/compiler_options.cc b/compiler/driver/compiler_options.cc index 385f34a9f9..2644528e56 100644 --- a/compiler/driver/compiler_options.cc +++ b/compiler/driver/compiler_options.cc @@ -44,7 +44,9 @@ CompilerOptions::CompilerOptions() verbose_methods_(nullptr), pass_manager_options_(), abort_on_hard_verifier_failure_(false), - init_failure_output_(nullptr) { + init_failure_output_(nullptr), + dump_cfg_file_name_(""), + dump_cfg_append_(false) { } CompilerOptions::~CompilerOptions() { @@ -71,7 +73,9 @@ CompilerOptions::CompilerOptions(CompilerFilter compiler_filter, bool compile_pic, const std::vector<std::string>* verbose_methods, std::ostream* init_failure_output, - bool abort_on_hard_verifier_failure + bool abort_on_hard_verifier_failure, + const std::string& dump_cfg_file_name, + bool dump_cfg_append ) : // NOLINT(whitespace/parens) compiler_filter_(compiler_filter), huge_method_threshold_(huge_method_threshold), @@ -94,7 +98,9 @@ CompilerOptions::CompilerOptions(CompilerFilter compiler_filter, verbose_methods_(verbose_methods), pass_manager_options_(), abort_on_hard_verifier_failure_(abort_on_hard_verifier_failure), - init_failure_output_(init_failure_output) { + init_failure_output_(init_failure_output), + dump_cfg_file_name_(dump_cfg_file_name), + dump_cfg_append_(dump_cfg_append) { } void CompilerOptions::ParseHugeMethodMax(const StringPiece& option, UsageFn Usage) { @@ -238,6 +244,10 @@ bool CompilerOptions::ParseCompilerOption(const StringPiece& option, UsageFn Usa ParsePassOptions(option, Usage); } else if (option.starts_with("--dump-init-failures=")) { ParseDumpInitFailures(option, Usage); + } else if (option.starts_with("--dump-cfg=")) { + dump_cfg_file_name_ = option.substr(strlen("--dump-cfg=")).data(); + } else if (option.starts_with("--dump-cfg-append")) { + dump_cfg_append_ = true; } else { // Option not recognized. return false; diff --git a/compiler/driver/compiler_options.h b/compiler/driver/compiler_options.h index f14bdc4a2f..d47fc2ad4b 100644 --- a/compiler/driver/compiler_options.h +++ b/compiler/driver/compiler_options.h @@ -83,7 +83,9 @@ class CompilerOptions FINAL { bool compile_pic, const std::vector<std::string>* verbose_methods, std::ostream* init_failure_output, - bool abort_on_hard_verifier_failure); + bool abort_on_hard_verifier_failure, + const std::string& dump_cfg_file_name, + bool dump_cfg_append); CompilerFilter GetCompilerFilter() const { return compiler_filter_; @@ -224,6 +226,14 @@ class CompilerOptions FINAL { bool ParseCompilerOption(const StringPiece& option, UsageFn Usage); + const std::string& GetDumpCfgFileName() const { + return dump_cfg_file_name_; + } + + bool GetDumpCfgAppend() const { + return dump_cfg_append_; + } + private: void ParseDumpInitFailures(const StringPiece& option, UsageFn Usage); void ParsePassOptions(const StringPiece& option, UsageFn Usage); @@ -273,6 +283,9 @@ class CompilerOptions FINAL { // Log initialization of initialization failures to this stream if not null. std::unique_ptr<std::ostream> init_failure_output_; + std::string dump_cfg_file_name_; + bool dump_cfg_append_; + friend class Dex2Oat; DISALLOW_COPY_AND_ASSIGN(CompilerOptions); diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index 8fdbf4a3f7..3a3275a5f4 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -110,7 +110,9 @@ JitCompiler::JitCompiler() : total_time_(0) { /* pic */ true, // TODO: Support non-PIC in optimizing. /* verbose_methods */ nullptr, /* init_failure_output */ nullptr, - /* abort_on_hard_verifier_failure */ false)); + /* abort_on_hard_verifier_failure */ false, + /* dump_cfg_file_name */ "", + /* dump_cfg_append */ false)); for (const std::string& argument : Runtime::Current()->GetCompilerOptions()) { compiler_options_->ParseCompilerOption(argument, Usage); } @@ -166,8 +168,6 @@ JitCompiler::JitCompiler() : total_time_(0) { /* thread_count */ 1, /* dump_stats */ false, /* dump_passes */ false, - /* dump_cfg_file_name */ "", - /* dump_cfg_append */ false, cumulative_logger_.get(), /* swap_fd */ -1, /* dex to oat map */ nullptr, diff --git a/compiler/linker/relative_patcher_test.h b/compiler/linker/relative_patcher_test.h index b10cc3534c..bf8e786f64 100644 --- a/compiler/linker/relative_patcher_test.h +++ b/compiler/linker/relative_patcher_test.h @@ -47,7 +47,7 @@ class RelativePatcherTest : public testing::Test { driver_(&compiler_options_, &verification_results_, &inliner_map_, Compiler::kQuick, instruction_set, nullptr, false, nullptr, nullptr, nullptr, 1u, - false, false, "", false, nullptr, -1, nullptr, nullptr), + false, false, nullptr, -1, nullptr, nullptr), error_msg_(), instruction_set_(instruction_set), features_(InstructionSetFeatures::FromVariant(instruction_set, variant, &error_msg_)), diff --git a/compiler/oat_test.cc b/compiler/oat_test.cc index 9f7ffa5ace..7a2b74ed88 100644 --- a/compiler/oat_test.cc +++ b/compiler/oat_test.cc @@ -117,8 +117,6 @@ class OatTest : public CommonCompilerTest { 2, true, true, - "", - false, timer_.get(), -1, nullptr, diff --git a/compiler/optimizing/optimizing_compiler.cc b/compiler/optimizing/optimizing_compiler.cc index bb840eabdd..2b44b64c00 100644 --- a/compiler/optimizing/optimizing_compiler.cc +++ b/compiler/optimizing/optimizing_compiler.cc @@ -127,7 +127,7 @@ class PassObserver : public ValueObject { timing_logger_enabled_(compiler_driver->GetDumpPasses()), timing_logger_(timing_logger_enabled_ ? GetMethodName() : "", true, true), disasm_info_(graph->GetArena()), - visualizer_enabled_(!compiler_driver->GetDumpCfgFileName().empty()), + visualizer_enabled_(!compiler_driver->GetCompilerOptions().GetDumpCfgFileName().empty()), visualizer_(visualizer_output, graph, *codegen), graph_in_bad_state_(false) { if (timing_logger_enabled_ || visualizer_enabled_) { @@ -358,13 +358,13 @@ void OptimizingCompiler::Init() { // Enable C1visualizer output. Must be done in Init() because the compiler // driver is not fully initialized when passed to the compiler's constructor. CompilerDriver* driver = GetCompilerDriver(); - const std::string cfg_file_name = driver->GetDumpCfgFileName(); + const std::string cfg_file_name = driver->GetCompilerOptions().GetDumpCfgFileName(); if (!cfg_file_name.empty()) { CHECK_EQ(driver->GetThreadCount(), 1U) << "Graph visualizer requires the compiler to run single-threaded. " << "Invoke the compiler with '-j1'."; std::ios_base::openmode cfg_file_mode = - driver->GetDumpCfgAppend() ? std::ofstream::app : std::ofstream::out; + driver->GetCompilerOptions().GetDumpCfgAppend() ? std::ofstream::app : std::ofstream::out; visualizer_output_.reset(new std::ofstream(cfg_file_name, cfg_file_mode)); } if (driver->GetDumpStats()) { diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index ea5423961c..dbb7341fbd 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -528,7 +528,6 @@ class Dex2Oat FINAL { dump_passes_(false), dump_timing_(false), dump_slow_timing_(kIsDebugBuild), - dump_cfg_append_(false), swap_fd_(-1), app_image_fd_(kInvalidImageFd), timings_(timings) {} @@ -1093,10 +1092,6 @@ class Dex2Oat FINAL { dump_timing_ = true; } else if (option == "--dump-passes") { dump_passes_ = true; - } else if (option.starts_with("--dump-cfg=")) { - dump_cfg_file_name_ = option.substr(strlen("--dump-cfg=")).data(); - } else if (option.starts_with("--dump-cfg-append")) { - dump_cfg_append_ = true; } else if (option == "--dump-stats") { dump_stats_ = true; } else if (option.starts_with("--swap-file=")) { @@ -1509,8 +1504,6 @@ class Dex2Oat FINAL { thread_count_, dump_stats_, dump_passes_, - dump_cfg_file_name_, - dump_cfg_append_, compiler_phases_timings_.get(), swap_fd_, &dex_file_oat_filename_map_, @@ -2312,8 +2305,6 @@ class Dex2Oat FINAL { bool dump_passes_; bool dump_timing_; bool dump_slow_timing_; - std::string dump_cfg_file_name_; - bool dump_cfg_append_; std::string swap_file_name_; int swap_fd_; std::string app_image_file_name_; |