Implement throw instruction.
Change-Id: Ib01aa608bfaab302bac5646f1d7b5761d17d18b5
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 54e9dec..7ddae88 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -1137,8 +1137,15 @@
void MethodCompiler::EmitInsn_ThrowException(uint32_t dex_pc,
Instruction const* insn) {
- // UNIMPLEMENTED(WARNING);
- irb_.CreateUnreachable();
+
+ Instruction::DecodedInstruction dec_insn(insn);
+
+ llvm::Value* exception_addr =
+ EmitLoadDalvikReg(dec_insn.vA_, kObject, kAccurate);
+
+ irb_.CreateCall(irb_.GetRuntime(ThrowException), exception_addr);
+
+ EmitBranchExceptionLandingPad(dex_pc);
}