Corresponding CL of thread flags for portable.
Change-Id: I6ad0c6159115e0d8879e0d9d674d760cd48f29c9
diff --git a/src/compiler_llvm/runtime_support_builder.cc b/src/compiler_llvm/runtime_support_builder.cc
index 6be113d..76665f7 100644
--- a/src/compiler_llvm/runtime_support_builder.cc
+++ b/src/compiler_llvm/runtime_support_builder.cc
@@ -133,7 +133,12 @@
}
-/* Check */
+/* Exception */
+
+llvm::Value* RuntimeSupportBuilder::EmitGetAndClearException() {
+ Function* slow_func = GetRuntimeSupportFunction(runtime_support::GetAndClearException);
+ return irb_.CreateCall(slow_func, EmitGetCurrentThread());
+}
llvm::Value* RuntimeSupportBuilder::EmitIsExceptionPending() {
Value* exception = EmitLoadFromThreadOffset(Thread::ExceptionOffset().Int32Value(),
@@ -143,12 +148,15 @@
return irb_.CreateIsNotNull(exception);
}
+
+/* Suspend */
+
void RuntimeSupportBuilder::EmitTestSuspend() {
Function* slow_func = GetRuntimeSupportFunction(runtime_support::TestSuspend);
- Value* suspend_count = EmitLoadFromThreadOffset(Thread::SuspendCountOffset().Int32Value(),
- irb_.getJIntTy(),
+ Value* suspend_count = EmitLoadFromThreadOffset(Thread::ThreadFlagsOffset().Int32Value(),
+ irb_.getInt16Ty(),
kTBAARuntimeInfo);
- Value* is_suspend = irb_.CreateICmpNE(suspend_count, irb_.getJInt(0));
+ Value* is_suspend = irb_.CreateICmpNE(suspend_count, irb_.getInt16(0));
Function* parent_func = irb_.GetInsertBlock()->getParent();
BasicBlock* basic_block_suspend = BasicBlock::Create(context_, "suspend", parent_func);