8026977: NPG: Remove ConstantPool::lock

Write klass and resolved_references constant pool fields lock free.

Reviewed-by: jrose, twisti
This commit is contained in:
Coleen Phillimore 2014-06-19 11:16:10 -04:00
parent c1c9f333d5
commit 243d697d71
10 changed files with 127 additions and 180 deletions

View file

@ -286,7 +286,9 @@ void ConstantPoolCacheEntry::set_method_handle_common(constantPoolHandle cpool,
// the lock, so that when the losing writer returns, he can use the linked
// cache entry.
MonitorLockerEx ml(cpool->lock());
// Use the lock from the metaspace for this, which cannot stop for safepoint.
Mutex* metaspace_lock = cpool->pool_holder()->class_loader_data()->metaspace_lock();
MutexLockerEx ml(metaspace_lock, Mutex::_no_safepoint_check_flag);
if (!is_f1_null()) {
return;
}