diff options
author | 2013-06-21 09:20:34 -0700 | |
---|---|---|
committer | 2013-06-25 13:12:53 -0700 | |
commit | 7467ee05012e1fd9834df74663c1ebda46f5636b (patch) | |
tree | d93d7b7f13440eff50c552ccdab8ce8e4e5a9547 /src/compiler/driver/compiler_driver.cc | |
parent | b126134010ebeee771da0eec7fa76ad13fe9a9c9 (diff) |
Added support for SEA IR.
- Modified makefile to take the existance of SEA_IR_ART
file to mean "switch to sea ir mode".
- Switching SEA IR mode on leads to the new compiler being
fed the fibonacci methods only, if they are used as input.
- Added partial support for the control flow subgraph of
the SEA IR (instruction nodes and region nodes for
conditional and unconditional branches).
Change-Id: I29020b8e2df5a00fde75715c3683cc25038589f4
Conflicts:
src/compiler/driver/compiler_driver.cc
Diffstat (limited to 'src/compiler/driver/compiler_driver.cc')
-rw-r--r-- | src/compiler/driver/compiler_driver.cc | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/compiler/driver/compiler_driver.cc b/src/compiler/driver/compiler_driver.cc index 4a6eb962e3..122988aa5b 100644 --- a/src/compiler/driver/compiler_driver.cc +++ b/src/compiler/driver/compiler_driver.cc @@ -374,6 +374,11 @@ CompilerDriver::CompilerDriver(CompilerBackend compiler_backend, InstructionSet dex_to_dex_compiler_ = FindFunction<CompilerFn>(compiler_so_name, compiler_library_, "ArtCompileDEX"); + sea_ir_compiler_ = NULL; + if (Runtime::Current()->IsSeaIRMode()) { + sea_ir_compiler_ = FindFunction<CompilerFn>(compiler_so_name, compiler_library_, "SeaIrCompileMethod"); + } + init_compiler_context(*this); if (compiler_backend_ == kPortable) { @@ -2149,10 +2154,22 @@ void CompilerDriver::CompileMethod(const DexFile::CodeItem* code_item, uint32_t // Do compile small methods. dont_compile = false; } - if (!dont_compile) { - compiled_method = (*compiler_)(*this, code_item, access_flags, invoke_type, class_def_idx, + bool use_sea = false; + + if (Runtime::Current()->IsSeaIRMode()) { + use_sea = true; + } + if (use_sea) { + use_sea = (std::string::npos != PrettyMethod(method_idx, dex_file).find("fibonacci")); + } + if (!use_sea) { + compiled_method = (*compiler_)(*this, code_item, access_flags, invoke_type, class_def_idx, method_idx, class_loader, dex_file); + } else { + compiled_method = (*sea_ir_compiler_)(*this, code_item, access_flags, invoke_type, class_def_idx, + method_idx, class_loader, dex_file); + } CHECK(compiled_method != NULL) << PrettyMethod(method_idx, dex_file); } else if (allow_dex_to_dex_compilation) { // TODO: add a mode to disable DEX-to-DEX compilation ? |