summaryrefslogtreecommitdiff
path: root/src/compiler_llvm/compiler_llvm.cc
diff options
context:
space:
mode:
author buzbee <buzbee@google.com> 2012-10-18 07:09:20 -0700
committer buzbee <buzbee@google.com> 2012-10-26 10:13:33 -0700
commitc531cefbfb5394413122e9f57d211ba436cff012 (patch)
treef1a7183c0aa17414df90409e99dc24e84aaa2562 /src/compiler_llvm/compiler_llvm.cc
parent9281f004db3f194930ef34d31e5d80c98341f38f (diff)
Eliminate #ifdef ART_USE_QUICK_COMPILER
One of several steps towards having a single compiler build. In this CL, we introduce a compiler_backend command-line option to select between Quick, Quick w/ GBC, Portable and Iceland back ends. The Iceland option is temporary, and will go away once we combine with Portable. The Quick variants are with and without GBC conversion. In time, those will converge to a single option. All uses of "#if defined(ART_USE_QUICK_COMPILER)" are eliminated. All previous uses in the Quick compiler have been converted to runtime tests. On the llvm side, ART_USE_QUICK_COMPILER was previously used to differentiate between Portable and Iceland builds. Those usages have been replaced with ART_USE_PORTABLE_COMPILER, and in a following CL will also be converted to run-time tests. As of this CL, we're still generating separate libraries for Quick and Portable/Iceland. Next up is elminating the target-specific libraries for Quick-arm, Quick-x86 and Quick-mips. Once that is complete, we will consoldate Quick and Portable into a single build. To build either Iceland or Portable, touch USE_PORTABLE_COMPILER or USE_LLVM_COMPILER as usual. Otherwise, the build will default to Quick (non-GBC). Change-Id: Ic86c56f51710c9b06d4430b71a429ae12903cc47
Diffstat (limited to 'src/compiler_llvm/compiler_llvm.cc')
-rw-r--r--src/compiler_llvm/compiler_llvm.cc38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/compiler_llvm/compiler_llvm.cc b/src/compiler_llvm/compiler_llvm.cc
index a964b4009b..aa5ec82ad6 100644
--- a/src/compiler_llvm/compiler_llvm.cc
+++ b/src/compiler_llvm/compiler_llvm.cc
@@ -38,14 +38,15 @@
#include <llvm/Support/TargetSelect.h>
#include <llvm/Support/Threading.h>
-#if defined(ART_USE_QUICK_COMPILER)
+#if defined(ART_USE_PORTABLE_COMPILER)
namespace art {
-void oatCompileMethodToGBC(Compiler& compiler,
- const DexFile::CodeItem* code_item,
- uint32_t access_flags, InvokeType invoke_type,
- uint32_t method_idx, jobject class_loader,
- const DexFile& dex_file,
- LLVMInfo* llvm_info);
+void oatCompileMethod(Compiler& compiler,
+ const CompilerBackend compilerBackend,
+ const DexFile::CodeItem* code_item,
+ uint32_t access_flags, InvokeType invoke_type,
+ uint32_t method_idx, jobject class_loader,
+ const DexFile& dex_file,
+ LLVMInfo* llvm_info);
}
#endif
@@ -152,7 +153,7 @@ CompileDexMethod(OatCompilationUnit* oat_compilation_unit, InvokeType invoke_typ
return new CompiledMethod(cunit->GetInstructionSet(),
cunit->GetCompiledCode());
-#elif defined(ART_USE_QUICK_COMPILER)
+#elif defined(ART_USE_PORTABLE_COMPILER)
std::string methodName(PrettyMethod(oat_compilation_unit->GetDexMethodIndex(),
*oat_compilation_unit->GetDexFile()));
if (insn_set_ == kX86) {
@@ -162,16 +163,17 @@ CompileDexMethod(OatCompilationUnit* oat_compilation_unit, InvokeType invoke_typ
return method_compiler->Compile();
} else {
- // Use quick
- oatCompileMethodToGBC(*compiler_,
- oat_compilation_unit->GetCodeItem(),
- oat_compilation_unit->access_flags_,
- invoke_type,
- oat_compilation_unit->GetDexMethodIndex(),
- oat_compilation_unit->GetClassLoader(),
- *oat_compilation_unit->GetDexFile(),
- cunit->GetQuickContext()
- );
+ // TODO: consolidate ArtCompileMethods
+ oatCompileMethod(*compiler_,
+ kPortable,
+ oat_compilation_unit->GetCodeItem(),
+ oat_compilation_unit->access_flags_,
+ invoke_type,
+ oat_compilation_unit->GetDexMethodIndex(),
+ oat_compilation_unit->GetClassLoader(),
+ *oat_compilation_unit->GetDexFile(),
+ cunit->GetQuickContext()
+ );
cunit->SetCompiler(compiler_);
cunit->SetOatCompilationUnit(oat_compilation_unit);