diff options
| author | 2015-10-30 11:50:26 +0000 | |
|---|---|---|
| committer | 2015-10-30 11:50:26 +0000 | |
| commit | 08a097e346e6631a114a37a37a5cd54dd1faeb8f (patch) | |
| tree | 2fda8cbe8767c71a11e1830f0b335ce957d077d4 /compiler/jit/jit_compiler.cc | |
| parent | aea1e42ebcfba2c055ad36834af91cf2d2d02117 (diff) | |
| parent | f31f9739e6cb06298604f5fb723db2ab9a8f2962 (diff) | |
Merge "Refactor code so that JIT can parse compiler options."
am: f31f9739e6
* commit 'f31f9739e6cb06298604f5fb723db2ab9a8f2962':
Refactor code so that JIT can parse compiler options.
Diffstat (limited to 'compiler/jit/jit_compiler.cc')
| -rw-r--r-- | compiler/jit/jit_compiler.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/compiler/jit/jit_compiler.cc b/compiler/jit/jit_compiler.cc index b563c80f7d..c1b87c9cd0 100644 --- a/compiler/jit/jit_compiler.cc +++ b/compiler/jit/jit_compiler.cc @@ -63,9 +63,18 @@ extern "C" bool jit_compile_method(void* handle, ArtMethod* method, Thread* self return jit_compiler->CompileMethod(self, method); } +// Callers of this method assume it has NO_RETURN. +NO_RETURN static void Usage(const char* fmt, ...) { + va_list ap; + va_start(ap, fmt); + std::string error; + StringAppendV(&error, fmt, ap); + LOG(FATAL) << error; + va_end(ap); + exit(EXIT_FAILURE); +} + JitCompiler::JitCompiler() : total_time_(0) { - auto* pass_manager_options = new PassManagerOptions; - pass_manager_options->SetDisablePassList("GVN,DCE,GVNCleanup"); compiler_options_.reset(new CompilerOptions( CompilerOptions::kDefaultCompilerFilter, CompilerOptions::kDefaultHugeMethodThreshold, @@ -84,9 +93,11 @@ JitCompiler::JitCompiler() : total_time_(0) { /* implicit_suspend_checks */ false, /* pic */ true, // TODO: Support non-PIC in optimizing. /* verbose_methods */ nullptr, - pass_manager_options, /* init_failure_output */ nullptr, /* abort_on_hard_verifier_failure */ false)); + for (const std::string& argument : Runtime::Current()->GetCompilerOptions()) { + compiler_options_->ParseCompilerOption(argument, Usage); + } const InstructionSet instruction_set = kRuntimeISA; for (const StringPiece option : Runtime::Current()->GetCompilerOptions()) { VLOG(compiler) << "JIT compiler option " << option; |