summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler_llvm/runtime_support_builder.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/compiler_llvm/runtime_support_builder.cc b/src/compiler_llvm/runtime_support_builder.cc
index 9513d4a1ae..169f8e8b42 100644
--- a/src/compiler_llvm/runtime_support_builder.cc
+++ b/src/compiler_llvm/runtime_support_builder.cc
@@ -147,12 +147,11 @@ llvm::Value* RuntimeSupportBuilder::EmitGetAndClearException() {
}
llvm::Value* RuntimeSupportBuilder::EmitIsExceptionPending() {
- Value* state_and_flags = EmitLoadFromThreadOffset(Thread::ThreadFlagsOffset().Int32Value(),
- irb_.getInt16Ty(),
- kTBAARuntimeInfo);
- // Mask exception pending status and return true if non-zero.
- Value* exception_pending = irb_.CreateAnd(state_and_flags, irb_.getInt16(kExceptionPending));
- return irb_.CreateICmpNE(exception_pending, irb_.getInt16(0));
+ Value* exception = EmitLoadFromThreadOffset(Thread::ExceptionOffset().Int32Value(),
+ irb_.getJObjectTy(),
+ kTBAARuntimeInfo);
+ // If exception not null
+ return irb_.CreateIsNotNull(exception);
}