hotspot/src/share/vm/oops/method.hpp
changeset 22876 57aa8995d43b
parent 22551 9bf46d16dcc6
parent 22859 7b88983393b7
child 23219 69e72eaf9f51
--- a/hotspot/src/share/vm/oops/method.hpp	Thu Feb 13 17:57:27 2014 +0100
+++ b/hotspot/src/share/vm/oops/method.hpp	Wed Feb 19 12:08:49 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