mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8188220: Remove Atomic::*_ptr() uses and overloads from hotspot
With the new template functions these are unnecessary. Reviewed-by: kbarrett, dholmes, eosterlund
This commit is contained in:
parent
cb9e7bf51a
commit
39b068db11
83 changed files with 376 additions and 458 deletions
|
@ -1109,16 +1109,15 @@ void InstanceKlass::call_class_initializer(TRAPS) {
|
|||
void InstanceKlass::mask_for(const methodHandle& method, int bci,
|
||||
InterpreterOopMap* entry_for) {
|
||||
// Lazily create the _oop_map_cache at first request
|
||||
// Lock-free access requires load_ptr_acquire.
|
||||
OopMapCache* oop_map_cache =
|
||||
static_cast<OopMapCache*>(OrderAccess::load_ptr_acquire(&_oop_map_cache));
|
||||
// Lock-free access requires load_acquire.
|
||||
OopMapCache* oop_map_cache = OrderAccess::load_acquire(&_oop_map_cache);
|
||||
if (oop_map_cache == NULL) {
|
||||
MutexLocker x(OopMapCacheAlloc_lock);
|
||||
// Check if _oop_map_cache was allocated while we were waiting for this lock
|
||||
if ((oop_map_cache = _oop_map_cache) == NULL) {
|
||||
oop_map_cache = new OopMapCache();
|
||||
// Ensure _oop_map_cache is stable, since it is examined without a lock
|
||||
OrderAccess::release_store_ptr(&_oop_map_cache, oop_map_cache);
|
||||
OrderAccess::release_store(&_oop_map_cache, oop_map_cache);
|
||||
}
|
||||
}
|
||||
// _oop_map_cache is constant after init; lookup below does its own locking.
|
||||
|
@ -1672,7 +1671,7 @@ jmethodID InstanceKlass::get_jmethod_id(const methodHandle& method_h) {
|
|||
// transitions from NULL to non-NULL which is safe because we use
|
||||
// release_set_methods_jmethod_ids() to advertise the new cache.
|
||||
// A partially constructed cache should never be seen by a racing
|
||||
// thread. We also use release_store_ptr() to save a new jmethodID
|
||||
// thread. We also use release_store() to save a new jmethodID
|
||||
// in the cache so a partially constructed jmethodID should never be
|
||||
// seen either. Cache reads of existing jmethodIDs proceed without a
|
||||
// lock, but cache writes of a new jmethodID requires uniqueness and
|
||||
|
@ -1831,7 +1830,7 @@ jmethodID InstanceKlass::get_jmethod_id_fetch_or_update(
|
|||
// The jmethodID cache can be read while unlocked so we have to
|
||||
// make sure the new jmethodID is complete before installing it
|
||||
// in the cache.
|
||||
OrderAccess::release_store_ptr(&jmeths[idnum+1], id);
|
||||
OrderAccess::release_store(&jmeths[idnum+1], id);
|
||||
} else {
|
||||
*to_dealloc_id_p = new_id; // save new id for later delete
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue