diff src/share/vm/oops/method.hpp @ 14460:8a9bb7821e28

Merge
author kvn
date Wed, 19 Feb 2014 12:08:49 -0800
parents 63a4eb8bcd23 3205e78d8193
children d8041d695d19 8504393de66b
line wrap: on
line diff
--- a/src/share/vm/oops/method.hpp	Thu Feb 13 17:57:27 2014 +0100
+++ b/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