Corresponding CL of thread flags for portable.
Change-Id: I6ad0c6159115e0d8879e0d9d674d760cd48f29c9
diff --git a/src/compiler_llvm/method_compiler.cc b/src/compiler_llvm/method_compiler.cc
index 61fffbe..ca9cbdf 100644
--- a/src/compiler_llvm/method_compiler.cc
+++ b/src/compiler_llvm/method_compiler.cc
@@ -1257,16 +1257,7 @@
DecodedInstruction dec_insn(insn);
- // Get thread-local exception field address
- llvm::Value* exception_object_addr =
- irb_.Runtime().EmitLoadFromThreadOffset(Thread::ExceptionOffset().Int32Value(),
- irb_.getJObjectTy(),
- kTBAAJRuntime);
-
- // Set thread-local exception field address to NULL
- irb_.Runtime().EmitStoreToThreadOffset(Thread::ExceptionOffset().Int32Value(),
- irb_.getJNull(),
- kTBAAJRuntime);
+ llvm::Value* exception_object_addr = irb_.Runtime().EmitGetAndClearException();
// Keep the exception object in the Dalvik register
EmitStoreDalvikReg(dec_insn.vA, kObject, kAccurate, exception_object_addr);