hotspot/src/share/vm/oops/instanceKlass.cpp
changeset 22872 b6902ee5bc8d
parent 22232 26acfad336c0
parent 22863 6a578e0f65ea
child 22881 b16d7faa638d
--- a/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Jan 28 11:21:43 2014 -0800
+++ b/hotspot/src/share/vm/oops/instanceKlass.cpp	Tue Jan 28 12:25:34 2014 -0800
@@ -1203,7 +1203,11 @@
     MutexLocker x(OopMapCacheAlloc_lock);
     // First time use. Allocate a cache in C heap
     if (_oop_map_cache == NULL) {
-      _oop_map_cache = new OopMapCache();
+      // Release stores from OopMapCache constructor before assignment
+      // to _oop_map_cache. C++ compilers on ppc do not emit the
+      // required memory barrier only because of the volatile
+      // qualifier of _oop_map_cache.
+      OrderAccess::release_store_ptr(&_oop_map_cache, new OopMapCache());
     }
   }
   // _oop_map_cache is constant after init; lookup below does is own locking.