diff src/share/vm/oops/method.hpp @ 17812:a7d4d4655766

Merge
author kvn
date Wed, 26 Mar 2014 18:21:05 -0700
parents 3205e78d8193
children 8a9bb7821e28 9428a0b94204
line wrap: on
line diff
--- a/src/share/vm/oops/method.hpp	Mon Mar 24 10:48:44 2014 -0700
+++ b/src/share/vm/oops/method.hpp	Wed Mar 26 18:21:05 2014 -0700
@@ -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