8261662: Rename compute_loader_lock_object
Reviewed-by: dcubed, stuefe
This commit is contained in:
parent
3dc6f52a89
commit
06170b7cbf
@ -185,7 +185,7 @@ bool SystemDictionary::is_platform_class_loader(oop class_loader) {
|
||||
return (class_loader->klass() == vmClasses::jdk_internal_loader_ClassLoaders_PlatformClassLoader_klass());
|
||||
}
|
||||
|
||||
Handle SystemDictionary::compute_loader_lock_object(Handle class_loader) {
|
||||
Handle SystemDictionary::get_loader_lock_or_null(Handle class_loader) {
|
||||
// If class_loader is NULL or parallelCapable, the JVM doesn't acquire a lock while loading.
|
||||
if (is_parallelCapable(class_loader)) {
|
||||
return Handle();
|
||||
@ -692,7 +692,7 @@ InstanceKlass* SystemDictionary::resolve_instance_class_or_null(Symbol* name,
|
||||
// the define.
|
||||
// ParallelCapable Classloaders and the bootstrap classloader
|
||||
// do not acquire lock here.
|
||||
Handle lockObject = compute_loader_lock_object(class_loader);
|
||||
Handle lockObject = get_loader_lock_or_null(class_loader);
|
||||
ObjectLocker ol(lockObject, THREAD);
|
||||
|
||||
// Check again (after locking) if the class already exists in SystemDictionary
|
||||
@ -1051,7 +1051,7 @@ InstanceKlass* SystemDictionary::resolve_from_stream(Symbol* class_name,
|
||||
|
||||
// Classloaders that support parallelism, e.g. bootstrap classloader,
|
||||
// do not acquire lock here
|
||||
Handle lockObject = compute_loader_lock_object(class_loader);
|
||||
Handle lockObject = get_loader_lock_or_null(class_loader);
|
||||
ObjectLocker ol(lockObject, THREAD);
|
||||
|
||||
// Parse the stream and create a klass.
|
||||
@ -1342,7 +1342,7 @@ InstanceKlass* SystemDictionary::load_shared_class(InstanceKlass* ik,
|
||||
ClassLoaderData* loader_data = ClassLoaderData::class_loader_data(class_loader());
|
||||
{
|
||||
HandleMark hm(THREAD);
|
||||
Handle lockObject = compute_loader_lock_object(class_loader);
|
||||
Handle lockObject = get_loader_lock_or_null(class_loader);
|
||||
ObjectLocker ol(lockObject, THREAD);
|
||||
// prohibited package check assumes all classes loaded from archive call
|
||||
// restore_unshareable_info which calls ik->set_package()
|
||||
@ -1544,7 +1544,7 @@ void SystemDictionary::define_instance_class(InstanceKlass* k, Handle class_load
|
||||
// hole with systemDictionary updates and check_constraints
|
||||
if (!is_parallelCapable(class_loader)) {
|
||||
assert(ObjectSynchronizer::current_thread_holds_lock(THREAD->as_Java_thread(),
|
||||
compute_loader_lock_object(class_loader)),
|
||||
get_loader_lock_or_null(class_loader)),
|
||||
"define called without lock");
|
||||
}
|
||||
|
||||
|
@ -387,7 +387,7 @@ protected:
|
||||
static InstanceKlass* load_shared_boot_class(Symbol* class_name,
|
||||
PackageEntry* pkg_entry,
|
||||
TRAPS);
|
||||
static Handle compute_loader_lock_object(Handle class_loader);
|
||||
static Handle get_loader_lock_or_null(Handle class_loader);
|
||||
static InstanceKlass* find_or_define_instance_class(Symbol* class_name,
|
||||
Handle class_loader,
|
||||
InstanceKlass* k, TRAPS);
|
||||
|
@ -1013,7 +1013,7 @@ InstanceKlass* SystemDictionaryShared::find_or_load_shared_class(
|
||||
// Note: currently, find_or_load_shared_class is called only from
|
||||
// JVM_FindLoadedClass and used for PlatformClassLoader and AppClassLoader,
|
||||
// which are parallel-capable loaders, so a lock here is NOT taken.
|
||||
assert(compute_loader_lock_object(class_loader) == NULL, "ObjectLocker not required");
|
||||
assert(get_loader_lock_or_null(class_loader) == NULL, "ObjectLocker not required");
|
||||
{
|
||||
MutexLocker mu(THREAD, SystemDictionary_lock);
|
||||
InstanceKlass* check = dictionary->find_class(d_hash, name);
|
||||
|
Loading…
Reference in New Issue
Block a user