changeset 7811:8fdbd65711c6

Add some memory barriers for object creation and runtime calls.
author aph
date Tue, 04 Nov 2014 04:04:35 -0500
parents a6df78e590bb
children 58cfaeeb1c86
files src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp src/cpu/aarch64/vm/templateTable_aarch64.cpp
diffstat 3 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Wed Sep 10 10:42:58 2014 -0400
+++ b/src/cpu/aarch64/vm/sharedRuntime_aarch64.cpp	Tue Nov 04 04:04:35 2014 -0500
@@ -2816,6 +2816,7 @@
   __ reset_last_Java_frame(false, true);
 
   __ maybe_isb();
+  __ membar(Assembler::LoadLoad | Assembler::LoadStore);
 
   __ ldr(rscratch1, Address(rthread, Thread::pending_exception_offset()));
   __ cbz(rscratch1, noException);
--- a/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Wed Sep 10 10:42:58 2014 -0400
+++ b/src/cpu/aarch64/vm/templateInterpreter_aarch64.cpp	Tue Nov 04 04:04:35 2014 -0500
@@ -312,6 +312,7 @@
   address entry = __ pc();
   __ push(state);
   __ call_VM(noreg, runtime_entry);
+  __ membar(Assembler::AnyAny);
   __ dispatch_via(vtos, Interpreter::_normal_table.table_for(vtos));
   return entry;
 }
--- a/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Wed Sep 10 10:42:58 2014 -0400
+++ b/src/cpu/aarch64/vm/templateTable_aarch64.cpp	Tue Nov 04 04:04:35 2014 -0500
@@ -3339,6 +3339,8 @@
 
   // continue
   __ bind(done);
+  // Must prevent reordering of stores for object initialization with stores that publish the new object.
+  __ membar(Assembler::StoreStore);
 }
 
 void TemplateTable::newarray() {
@@ -3347,6 +3349,8 @@
   __ mov(c_rarg2, r0);
   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::newarray),
           c_rarg1, c_rarg2);
+  // Must prevent reordering of stores for object initialization with stores that publish the new object.
+  __ membar(Assembler::StoreStore);
 }
 
 void TemplateTable::anewarray() {
@@ -3356,6 +3360,8 @@
   __ mov(c_rarg3, r0);
   call_VM(r0, CAST_FROM_FN_PTR(address, InterpreterRuntime::anewarray),
           c_rarg1, c_rarg2, c_rarg3);
+  // Must prevent reordering of stores for object initialization with stores that publish the new object.
+  __ membar(Assembler::StoreStore);
 }
 
 void TemplateTable::arraylength() {