Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JVM_IsValhallaEnabled() for Valhalla builds #16019

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions runtime/j9vm/exports.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -418,3 +418,9 @@ if(J9VM_OPT_JITSERVER)
JITServer_CreateServer
)
endif()

if(J9VM_OPT_VALHALLA_VALUE_TYPES)
jvm_add_exports(jvm
JVM_IsValhallaEnabled
)
endif()
5 changes: 5 additions & 0 deletions runtime/j9vm/j9vmnatives.xml
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,11 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-excepti
<export name="_JVM_CopySwapMemory@44"/>
<export name="JVM_BeforeHalt"/>
<export name="AsyncGetCallTrace"/>

<!-- Additions for Valhalla -->
<export name="JVM_IsValhallaEnabled">
<include-if condition="spec.flags.opt_valhallaValueTypes"/>
</export>
</exports>

<exports group="jdk11">
Expand Down
8 changes: 8 additions & 0 deletions runtime/j9vm/javanextvmi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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" */
2 changes: 2 additions & 0 deletions runtime/redirector/forwarders.m4
Original file line number Diff line number Diff line change
Expand Up @@ -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)])