hotspot/src/share/vm/oops/method.hpp
changeset 22859 7b88983393b7
parent 20710 550442bd8ffc
child 22876 57aa8995d43b
--- a/hotspot/src/share/vm/oops/method.hpp	Thu Dec 05 15:13:12 2013 -0800
+++ b/hotspot/src/share/vm/oops/method.hpp	Mon Dec 02 10:26:14 2013 +0100
@@ -350,16 +350,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