summaryrefslogtreecommitdiff
path: root/compiler/jit/jit_compiler.cc
diff options
context:
space:
mode:
author Nicolas Geoffray <ngeoffray@google.com> 2015-10-29 18:55:58 +0000
committer Nicolas Geoffray <ngeoffray@google.com> 2015-10-30 11:17:00 +0000
commitabbb0f76b07417f13f712f54d5afddb72e3b9931 (patch)
treebb26eeb28b58aed669ad16af30aa35771eb02be4 /compiler/jit/jit_compiler.cc
parent594c0612519e96bcc1bd42ff4dcbfa2c53b09c5a (diff)
Refactor code so that JIT can parse compiler options.
Currently only the CompilerOptions class. We should also do it for the CompilerDriver options. This will fix the flakiness seen on jdwp testing, as the debuggable flag was not passed to the compiler. Change-Id: I4218dd5928c9f4fe2d6191ab11e5598e7cf84bcf
Diffstat (limited to 'compiler/jit/jit_compiler.cc')
-rw-r--r--compiler/jit/jit_compiler.cc17
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;