diff --git a/runtime/j9vm/exports.cmake b/runtime/j9vm/exports.cmake index 27d2d2796b0..a07cf566121 100644 --- a/runtime/j9vm/exports.cmake +++ b/runtime/j9vm/exports.cmake @@ -418,3 +418,9 @@ if(J9VM_OPT_JITSERVER) JITServer_CreateServer ) endif() + +if(J9VM_OPT_VALHALLA_VALUE_TYPES) + jvm_add_exports(jvm + JVM_IsValhallaEnabled + ) +endif() diff --git a/runtime/j9vm/j9vmnatives.xml b/runtime/j9vm/j9vmnatives.xml index c95f8591fee..a3f5656c9e3 100644 --- a/runtime/j9vm/j9vmnatives.xml +++ b/runtime/j9vm/j9vmnatives.xml @@ -318,6 +318,11 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti + + + + + diff --git a/runtime/j9vm/javanextvmi.cpp b/runtime/j9vm/javanextvmi.cpp index 6bef75347e7..6fd60862d8d 100644 --- a/runtime/j9vm/javanextvmi.cpp +++ b/runtime/j9vm/javanextvmi.cpp @@ -445,4 +445,12 @@ JVM_VirtualThreadHideFrames(JNIEnv *env, jobject vthread, jboolean hide) } #endif /* JAVA_SPEC_VERSION >= 20 */ +#if defined(J9VM_OPT_VALHALLA_VALUE_TYPES) +JNIEXPORT jboolean JNICALL +JVM_IsValhallaEnabled() +{ + return JNI_TRUE; +} +#endif /* defined(J9VM_OPT_VALHALLA_VALUE_TYPES) */ + } /* extern "C" */ diff --git a/runtime/redirector/forwarders.m4 b/runtime/redirector/forwarders.m4 index 36f94e3ecc6..95f2b62fc94 100644 --- a/runtime/redirector/forwarders.m4 +++ b/runtime/redirector/forwarders.m4 @@ -404,3 +404,5 @@ _IF([JAVA_SPEC_VERSION >= 20], [_X(JVM_GetClassFileVersion, JNICALL, false, jint, JNIEnv *env, jclass cls)]) _IF([JAVA_SPEC_VERSION >= 20], [_X(JVM_VirtualThreadHideFrames, JNICALL, false, void, JNIEnv *env, jobject vthread, jboolean hide)]) +_IF([defined(J9VM_OPT_VALHALLA_VALUE_TYPES)], + [_X(JVM_IsValhallaEnabled, JNICALL, false, jboolean, void)])