Add garbage collection suspend guard.

Change-Id: Ibf01540fd16fc08ddc57cf608b335567790b8c9c
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index ca1eba5..ea96b2f 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -269,6 +269,14 @@
 }
 
 
+void MethodCompiler::EmitGuard_GarbageCollectionSuspend(uint32_t dex_pc) {
+  llvm::Value* runtime_func = irb_.GetRuntime(TestSuspend);
+  irb_.CreateCall(runtime_func);
+
+  EmitGuard_ExceptionLandingPad(dex_pc);
+}
+
+
 llvm::BasicBlock* MethodCompiler::
 CreateBasicBlockWithDexPC(uint32_t dex_pc, char const* postfix) {
   std::string name;
diff --git a/src/compiler_llvm/method_compiler.h b/src/compiler_llvm/method_compiler.h
index 491ced3..f9e73f9 100644
--- a/src/compiler_llvm/method_compiler.h
+++ b/src/compiler_llvm/method_compiler.h
@@ -145,6 +145,8 @@
 
   void EmitBranchExceptionLandingPad(uint32_t dex_pc);
 
+  void EmitGuard_GarbageCollectionSuspend(uint32_t addr);
+
 
   // Basic block helper functions
   llvm::BasicBlock* GetBasicBlock(uint32_t dex_pc);