diff src/share/vm/oops/method.hpp @ 14465:28f281e8de1d

Merge
author kvn
date Thu, 20 Feb 2014 12:20:56 -0800
parents 8a9bb7821e28
children d8041d695d19 8504393de66b
line wrap: on
line diff
--- a/src/share/vm/oops/method.hpp	Tue Feb 18 09:54:24 2014 -0500
+++ b/src/share/vm/oops/method.hpp	Thu Feb 20 12:20:56 2014 -0800
@@ -348,16 +348,21 @@
   }
 
   void set_method_data(MethodData* data)       {
-    _method_data = data;
+    // The store into method must be released. On platforms without
+    // total store order (TSO) the reference may become visible before
+    // the initialization of data otherwise.
+    OrderAccess::release_store_ptr((volatile void *)&_method_data, data);
   }
 
   MethodCounters* method_counters() const {
     return _method_counters;
   }
 
-
   void set_method_counters(MethodCounters* counters) {
-    _method_counters = counters;
+    // The store into method must be released. On platforms without
+    // total store order (TSO) the reference may become visible before
+    // the initialization of data otherwise.
+    OrderAccess::release_store_ptr((volatile void *)&_method_counters, counters);
   }
 
 #ifdef TIERED