mirror of
https://github.com/JetBrains/JetBrainsRuntime.git
synced 2025-12-06 09:29:38 +01:00
8305404: Compile_lock not needed for InstanceKlass::implementor()
Reviewed-by: eosterlund, fparain
This commit is contained in:
@@ -623,14 +623,14 @@ ciInstanceKlass* ciInstanceKlass::implementor() {
|
||||
} else {
|
||||
// Go into the VM to fetch the implementor.
|
||||
VM_ENTRY_MARK;
|
||||
MutexLocker ml(Compile_lock);
|
||||
Klass* k = get_instanceKlass()->implementor();
|
||||
if (k != nullptr) {
|
||||
if (k == get_instanceKlass()) {
|
||||
InstanceKlass* ik = get_instanceKlass();
|
||||
Klass* implk = ik->implementor();
|
||||
if (implk != nullptr) {
|
||||
if (implk == ik) {
|
||||
// More than one implementors. Use 'this' in this case.
|
||||
impl = this;
|
||||
} else {
|
||||
impl = CURRENT_THREAD_ENV->get_instance_klass(k);
|
||||
impl = CURRENT_THREAD_ENV->get_instance_klass(implk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,12 +450,7 @@ C2V_VMENTRY_NULL(jobject, getImplementor, (JNIEnv* env, jobject, ARGUMENT_PAIR(k
|
||||
err_msg("Expected interface type, got %s", klass->external_name()));
|
||||
}
|
||||
InstanceKlass* iklass = InstanceKlass::cast(klass);
|
||||
JVMCIKlassHandle handle(THREAD);
|
||||
{
|
||||
// Need Compile_lock around implementor()
|
||||
MutexLocker locker(Compile_lock);
|
||||
handle = iklass->implementor();
|
||||
}
|
||||
JVMCIKlassHandle handle(THREAD, iklass->implementor());
|
||||
JVMCIObject implementor = JVMCIENV->get_jvmci_type(handle, JVMCI_CHECK_NULL);
|
||||
return JVMCIENV->get_jobject(implementor);
|
||||
C2V_END
|
||||
|
||||
Reference in New Issue
Block a user