8146201: [AOT] Class static initializers that are not pure should not be executed during static compilation

Reviewed-by: kvn
This commit is contained in:
Dean Long 2018-03-20 10:23:14 -07:00
parent 0df6b5baee
commit 91649ef44b
3 changed files with 14 additions and 11 deletions

View file

@ -480,6 +480,9 @@ C2V_END
C2V_VMENTRY(jobject, resolveTypeInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index))
constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool);
Klass* resolved_klass = cp->klass_at(index, CHECK_NULL);
if (resolved_klass->is_instance_klass()) {
InstanceKlass::cast(resolved_klass)->link_class_or_fail(THREAD);
}
oop klass = CompilerToVM::get_jvmci_type(resolved_klass, CHECK_NULL);
return JNIHandles::make_local(THREAD, klass);
C2V_END