Skip to content

Commit

Permalink
Add JVM_IsValhallaEnabled() for Valhalla builds
Browse files Browse the repository at this point in the history
Closes eclipse-openj9#16010

Signed-off-by: Hang Shao <hangshao@ca.ibm.com>
  • Loading branch information
hangshao0 committed Sep 29, 2022
1 parent 6af5b7b commit b2b75c7
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
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)])

0 comments on commit b2b75c7

Please sign in to comment.