diff src/share/vm/oops/instanceKlass.cpp @ 14465:28f281e8de1d

Merge
author kvn
date Thu, 20 Feb 2014 12:20:56 -0800
parents e6195383bcaf abec000618bf
children 016b6a289fc4 301df27023d4 fdad2932c73f
line wrap: on
line diff
--- a/src/share/vm/oops/instanceKlass.cpp	Tue Feb 18 09:54:24 2014 -0500
+++ b/src/share/vm/oops/instanceKlass.cpp	Thu Feb 20 12:20:56 2014 -0800
@@ -1157,7 +1157,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.