Quick compiler: reuse llvm context & ir builder

With this CL, we avoid setting up an llvm context, module and intrinsic
definitions for each method, and considerably speed up compilation time.
This does not represent a final form - we'll be reworking the compiler driver
to support Quick & Portable via the command line, and this code will likely
change at that time.

Change-Id: I19e298a011141c3bc35c4f28175b2b20653fd5e4
diff --git a/src/compiler.cc b/src/compiler.cc
index 091aad9..b05e688 100644
--- a/src/compiler.cc
+++ b/src/compiler.cc
@@ -331,6 +331,16 @@
                                       "ArtInitCompilerContext");
 
   init_compiler_context(*this);
+#elif defined(ART_USE_QUICK_COMPILER)
+  // Initialize compiler_context_
+  typedef void (*InitCompilerContextFn)(Compiler&);
+
+  InitCompilerContextFn init_compiler_context =
+    FindFunction<void (*)(Compiler&)>(compiler_so_name,
+                                      compiler_library_,
+                                      "ArtInitQuickCompilerContext");
+
+  init_compiler_context(*this);
 #endif
 
   compiler_ = FindFunction<CompilerFn>(compiler_so_name, compiler_library_, "ArtCompileMethod");
@@ -387,6 +397,18 @@
                                       "ArtUnInitCompilerContext");
 
   uninit_compiler_context(*this);
+#elif defined(ART_USE_QUICK_COMPILER)
+  // Uninitialize compiler_context_
+  typedef void (*UninitCompilerContextFn)(Compiler&);
+
+  std::string compiler_so_name(MakeCompilerSoName(instruction_set_));
+
+  UninitCompilerContextFn uninit_compiler_context =
+    FindFunction<void (*)(Compiler&)>(compiler_so_name,
+                                      compiler_library_,
+                                      "ArtUnInitQuickCompilerContext");
+
+  uninit_compiler_context(*this);
 #endif
   if (compiler_library_ != NULL) {
     VLOG(compiler) << "dlclose(" << compiler_library_ << ")";