8029396: PPC64 (part 212): Several memory ordering fixes in C-code

Memory ordering fixes in GC and other runtime code showing on PPC64.

Reviewed-by: kvn, coleenp
This commit is contained in:
Goetz Lindenmaier 2013-12-02 10:26:14 +01:00
parent 1b2bf0be10
commit 46c4ef6572
16 changed files with 99 additions and 34 deletions

View file

@ -1203,7 +1203,11 @@ void InstanceKlass::mask_for(methodHandle method, int bci,
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.