Generates barrier in constructor.
Bug: 8209406
We need to generate a memory barrier at the end of constructor where non static
final fields are initialized.
This introduces the new greenland intrinsic "ConstructorBarrier" to be handled
by the Quick and the Portable compilers.
Change-Id: Id2eb0af61f689581a192d20742a248726adf7f9b
diff --git a/src/compiler_llvm/intrinsic_func_list.def b/src/compiler_llvm/intrinsic_func_list.def
index b3ea3f9..92537ba 100644
--- a/src/compiler_llvm/intrinsic_func_list.def
+++ b/src/compiler_llvm/intrinsic_func_list.def
@@ -1768,6 +1768,16 @@
kInt32Ty,
_EXPAND_ARG1(kInt32Ty))
+//----------------------------------------------------------------------------
+// Memory barrier
+//----------------------------------------------------------------------------
+// void constructor_barrier()
+_EVAL_DEF_INTRINSICS_FUNC(ConstructorBarrier,
+ art_portable_constructor_barrier,
+ kAttrReadOnly | kAttrNoThrow,
+ kVoidTy,
+ _EXPAND_ARG0())
+
// Clean up all internal used macros
#undef _EXPAND_ARG0
#undef _EXPAND_ARG1