From 7467ee05012e1fd9834df74663c1ebda46f5636b Mon Sep 17 00:00:00 2001 From: Dragos Sbirlea Date: Fri, 21 Jun 2013 09:20:34 -0700 Subject: 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 --- src/compiler/driver/compiler_driver.cc | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/compiler/driver/compiler_driver.cc') 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(compiler_so_name, compiler_library_, "ArtCompileDEX"); + sea_ir_compiler_ = NULL; + if (Runtime::Current()->IsSeaIRMode()) { + sea_ir_compiler_ = FindFunction(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 ? -- cgit v1.2.3-59-g8ed1b