8207924: serviceability/sa/TestUniverse.java#id0 intermittently fails with assert(get_instanceKlass()->is_loaded()) failed: must be at least loaded

InstanceKlass::implementors() needs the Compile_lock

Reviewed-by: thartmann, eosterlund
This commit is contained in:
Coleen Phillimore 2018-08-11 12:49:33 -04:00
parent 5a80204c23
commit d1aea148fe
4 changed files with 50 additions and 41 deletions

View file

@ -382,7 +382,12 @@ C2V_VMENTRY(jobject, getImplementor, (JNIEnv *, jobject, jobject jvmci_type))
err_msg("Expected interface type, got %s", klass->external_name()));
}
InstanceKlass* iklass = InstanceKlass::cast(klass);
JVMCIKlassHandle handle(THREAD, iklass->implementor());
JVMCIKlassHandle handle(THREAD);
{
// Need Compile_lock around implementor()
MutexLocker locker(Compile_lock);
handle = iklass->implementor();
}
oop implementor = CompilerToVM::get_jvmci_type(handle, CHECK_NULL);
return JNIHandles::make_local(THREAD, implementor);
C2V_END