Skip to content

Commit ebeee6d

Browse files
committed
8305404: Compile_lock not needed for InstanceKlass::implementor()
Reviewed-by: eosterlund, fparain
1 parent d2ce04b commit ebeee6d

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

src/hotspot/share/ci/ciInstanceKlass.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -623,14 +623,14 @@ ciInstanceKlass* ciInstanceKlass::implementor() {
623623
} else {
624624
// Go into the VM to fetch the implementor.
625625
VM_ENTRY_MARK;
626-
MutexLocker ml(Compile_lock);
627-
Klass* k = get_instanceKlass()->implementor();
628-
if (k != nullptr) {
629-
if (k == get_instanceKlass()) {
626+
InstanceKlass* ik = get_instanceKlass();
627+
Klass* implk = ik->implementor();
628+
if (implk != nullptr) {
629+
if (implk == ik) {
630630
// More than one implementors. Use 'this' in this case.
631631
impl = this;
632632
} else {
633-
impl = CURRENT_THREAD_ENV->get_instance_klass(k);
633+
impl = CURRENT_THREAD_ENV->get_instance_klass(implk);
634634
}
635635
}
636636
}

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

+1-6
Original file line numberDiff line numberDiff line change
@@ -450,12 +450,7 @@ C2V_VMENTRY_NULL(jobject, getImplementor, (JNIEnv* env, jobject, ARGUMENT_PAIR(k
450450
err_msg("Expected interface type, got %s", klass->external_name()));
451451
}
452452
InstanceKlass* iklass = InstanceKlass::cast(klass);
453-
JVMCIKlassHandle handle(THREAD);
454-
{
455-
// Need Compile_lock around implementor()
456-
MutexLocker locker(Compile_lock);
457-
handle = iklass->implementor();
458-
}
453+
JVMCIKlassHandle handle(THREAD, iklass->implementor());
459454
JVMCIObject implementor = JVMCIENV->get_jvmci_type(handle, JVMCI_CHECK_NULL);
460455
return JVMCIENV->get_jobject(implementor);
461456
C2V_END

0 commit comments

Comments
 (0)