diff -r 9f3a515f06ee -r 09e17e497778 src/share/vm/memory/barrierSet.hpp --- a/src/share/vm/memory/barrierSet.hpp Sun Sep 25 17:38:33 2016 -0400 +++ b/src/share/vm/memory/barrierSet.hpp Sun Sep 25 18:09:10 2016 -0400 @@ -27,6 +27,7 @@ #include "memory/memRegion.hpp" #include "oops/oopsHierarchy.hpp" +#include "runtime/orderAccess.hpp" // This class provides the interface between a barrier implementation and // the rest of the system. @@ -95,8 +96,16 @@ // Keep this private so as to catch violations at build time. virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); }; protected: - virtual void write_ref_field_pre_work( oop* field, oop new_val) {}; - virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {}; + virtual void write_ref_field_pre_work( oop* field, oop new_val) { +#ifdef MIPS64 + OrderAccess::fence(); +#endif + }; + virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) { +#ifdef MIPS64 + OrderAccess::fence(); +#endif + }; public: // ...then the post-write version. @@ -132,9 +141,17 @@ // Below length is the # array elements being written virtual void write_ref_array_pre(oop* dst, int length, - bool dest_uninitialized = false) {} + bool dest_uninitialized = false) { +#ifdef MIPS64 + OrderAccess::fence(); +#endif + } virtual void write_ref_array_pre(narrowOop* dst, int length, - bool dest_uninitialized = false) {} + bool dest_uninitialized = false) { +#ifdef MIPS64 + OrderAccess::fence(); +#endif +} // Below count is the # array elements being written, starting // at the address "start", which may not necessarily be HeapWord-aligned inline void write_ref_array(HeapWord* start, size_t count);