Rewrite intrinsics detection.

Intrinsic methods should be treated as a special case of
inline methods. They should be detected early and used to
guide other optimizations. This CL rewrites the intrinsics
detection so that it can be moved to any compilation phase.

Change-Id: I4424a6a869bd98b9c478953c9e3bcaf1c6de2b33
diff --git a/compiler/dex/frontend.cc b/compiler/dex/frontend.cc
index 3dc1914..b6e062e 100644
--- a/compiler/dex/frontend.cc
+++ b/compiler/dex/frontend.cc
@@ -31,6 +31,8 @@
 #include "llvm/llvm_compilation_unit.h"
 #endif
 
+#include "dex/quick/dex_file_to_method_inliner_map.h"
+
 namespace {
 #if !defined(ART_USE_PORTABLE_COMPILER)
   pthread_once_t llvm_multi_init = PTHREAD_ONCE_INIT;
@@ -61,14 +63,21 @@
 LLVMInfo::~LLVMInfo() {
 }
 
+QuickCompilerContext::QuickCompilerContext(CompilerDriver& compiler)
+  : inliner_map_(new DexFileToMethodInlinerMap(&compiler))
+{
+}
+
+QuickCompilerContext::~QuickCompilerContext() {
+}
+
 extern "C" void ArtInitQuickCompilerContext(art::CompilerDriver& compiler) {
   CHECK(compiler.GetCompilerContext() == NULL);
-  LLVMInfo* llvm_info = new LLVMInfo();
-  compiler.SetCompilerContext(llvm_info);
+  compiler.SetCompilerContext(new QuickCompilerContext(compiler));
 }
 
 extern "C" void ArtUnInitQuickCompilerContext(art::CompilerDriver& compiler) {
-  delete reinterpret_cast<LLVMInfo*>(compiler.GetCompilerContext());
+  delete reinterpret_cast<QuickCompilerContext*>(compiler.GetCompilerContext());
   compiler.SetCompilerContext(NULL);
 }