Refactor runtime support builder.
Also, add inline assembly for load offset from current thread.
Change-Id: I5c32c04a5ab9a8574acbaf8ee3e08761ebe33d4f
diff --git a/src/compiler_llvm/runtime_support_builder_x86.h b/src/compiler_llvm/runtime_support_builder_x86.h
index 37de81b..ee5d0a3 100644
--- a/src/compiler_llvm/runtime_support_builder_x86.h
+++ b/src/compiler_llvm/runtime_support_builder_x86.h
@@ -26,8 +26,14 @@
public:
RuntimeSupportBuilderX86(llvm::LLVMContext& context, llvm::Module& module, IRBuilder& irb)
: RuntimeSupportBuilder(context, module, irb) {}
- private:
- virtual void TargetOptimizeRuntimeSupport();
+
+ /* Thread */
+ virtual llvm::Value* EmitGetCurrentThread();
+ virtual llvm::Value* EmitLoadFromThreadOffset(int64_t offset, llvm::Type* type,
+ TBAASpecialType s_ty);
+ virtual void EmitStoreToThreadOffset(int64_t offset, llvm::Value* value,
+ TBAASpecialType s_ty);
+ virtual void EmitSetCurrentThread(llvm::Value* thread);
};
} // namespace compiler_llvm