1.1 --- a/src/share/vm/memory/barrierSet.hpp Sun Sep 25 17:38:33 2016 -0400 1.2 +++ b/src/share/vm/memory/barrierSet.hpp Sun Sep 25 18:09:10 2016 -0400 1.3 @@ -27,6 +27,7 @@ 1.4 1.5 #include "memory/memRegion.hpp" 1.6 #include "oops/oopsHierarchy.hpp" 1.7 +#include "runtime/orderAccess.hpp" 1.8 1.9 // This class provides the interface between a barrier implementation and 1.10 // the rest of the system. 1.11 @@ -95,8 +96,16 @@ 1.12 // Keep this private so as to catch violations at build time. 1.13 virtual void write_ref_field_pre_work( void* field, oop new_val) { guarantee(false, "Not needed"); }; 1.14 protected: 1.15 - virtual void write_ref_field_pre_work( oop* field, oop new_val) {}; 1.16 - virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) {}; 1.17 + virtual void write_ref_field_pre_work( oop* field, oop new_val) { 1.18 +#ifdef MIPS64 1.19 + OrderAccess::fence(); 1.20 +#endif 1.21 + }; 1.22 + virtual void write_ref_field_pre_work(narrowOop* field, oop new_val) { 1.23 +#ifdef MIPS64 1.24 + OrderAccess::fence(); 1.25 +#endif 1.26 + }; 1.27 public: 1.28 1.29 // ...then the post-write version. 1.30 @@ -132,9 +141,17 @@ 1.31 1.32 // Below length is the # array elements being written 1.33 virtual void write_ref_array_pre(oop* dst, int length, 1.34 - bool dest_uninitialized = false) {} 1.35 + bool dest_uninitialized = false) { 1.36 +#ifdef MIPS64 1.37 + OrderAccess::fence(); 1.38 +#endif 1.39 + } 1.40 virtual void write_ref_array_pre(narrowOop* dst, int length, 1.41 - bool dest_uninitialized = false) {} 1.42 + bool dest_uninitialized = false) { 1.43 +#ifdef MIPS64 1.44 + OrderAccess::fence(); 1.45 +#endif 1.46 +} 1.47 // Below count is the # array elements being written, starting 1.48 // at the address "start", which may not necessarily be HeapWord-aligned 1.49 inline void write_ref_array(HeapWord* start, size_t count);