Skip to content

Commit

Permalink
8213926: WB_EnqueueInitializerForCompilation requests compilation for…
Browse files Browse the repository at this point in the history
… NULL

Backport-of: 6b0d1af
  • Loading branch information
Amos Shi authored and GoeLin committed Dec 4, 2023
1 parent 4b88beb commit b88668b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/hotspot/share/prims/whitebox.cpp
Expand Up @@ -949,7 +949,11 @@ WB_END

WB_ENTRY(jboolean, WB_EnqueueInitializerForCompilation(JNIEnv* env, jobject o, jclass klass, jint comp_level))
InstanceKlass* ik = InstanceKlass::cast(java_lang_Class::as_Klass(JNIHandles::resolve(klass)));
return WhiteBox::compile_method(ik->class_initializer(), comp_level, InvocationEntryBci, THREAD);
Method* clinit = ik->class_initializer();
if (clinit == NULL) {
return false;
}
return WhiteBox::compile_method(clinit, comp_level, InvocationEntryBci, THREAD);
WB_END

WB_ENTRY(jboolean, WB_ShouldPrintAssembly(JNIEnv* env, jobject o, jobject method, jint comp_level))
Expand Down

1 comment on commit b88668b

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.