Skip to content

Commit

Permalink
Merge pull request #18360 from JasonFengJ9/valhallaapis
Browse files Browse the repository at this point in the history
JDK22+ add latest APIs for Valhalla & enable JEP 454 tests
  • Loading branch information
hangshao0 authored Oct 27, 2023
2 parents df535b9 + 22bafa4 commit 13443f0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 19 deletions.
10 changes: 5 additions & 5 deletions jcl/src/java.base/share/classes/java/lang/Access.java
Original file line number Diff line number Diff line change
Expand Up @@ -501,15 +501,15 @@ public String join(String prefix, String suffix, String delimiter, String[] elem

/*[IF JAVA_SPEC_VERSION >= 20]*/
@Override
/*[IF (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES]*/
/*[IF JAVA_SPEC_VERSION >= 22]*/
public void ensureNativeAccess(Module mod, Class<?> clsOwner, String methodName, Class<?> clsCaller) {
mod.ensureNativeAccess(clsOwner, methodName, clsCaller);
}
/*[ELSE] (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES */
/*[ELSE] JAVA_SPEC_VERSION >= 22 */
public void ensureNativeAccess(Module mod, Class<?> clsOwner, String methodName) {
mod.ensureNativeAccess(clsOwner, methodName);
}
/*[ENDIF] (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES */
/*[ENDIF] JAVA_SPEC_VERSION >= 22 */

public void addEnableNativeAccessToAllUnnamed() {
Module.implAddEnableNativeAccessToAllUnnamed();
Expand Down Expand Up @@ -737,7 +737,7 @@ public String getLoaderNameID(ClassLoader loader) {
}
/*[ENDIF] JAVA_SPEC_VERSION >= 11 */

/*[IF (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES]*/
/*[IF JAVA_SPEC_VERSION >= 22]*/
@Override
public boolean bytesCompatible(String string, Charset charset) {
return string.bytesCompatible(charset);
Expand All @@ -747,7 +747,7 @@ public boolean bytesCompatible(String string, Charset charset) {
public void copyToSegmentRaw(String string, MemorySegment segment, long offset) {
string.copyToSegmentRaw(segment, offset);
}
/*[ENDIF] (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES */
/*[ENDIF] JAVA_SPEC_VERSION >= 22 */

/*[IF INLINE-TYPES]*/
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,11 @@ Object runNativeMethod(Addressable downcallAddr, SegmentAllocator segmtAllocator
try (Arena arena = Arena.ofConfined()) {
SetDependency(arena.scope());
returnVal = invokeNative(
/*[IF (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES]*/
/*[IF JAVA_SPEC_VERSION >= 22]*/
linkerOpts.isCritical(),
/*[ELSE] (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES */
/*[ELSE] JAVA_SPEC_VERSION >= 22 */
linkerOpts.isTrivial(),
/*[ENDIF] (JAVA_SPEC_VERSION >= 22) & !INLINE-TYPES */
/*[ENDIF] JAVA_SPEC_VERSION >= 22 */
getValidDowncallMemAddr(stateSegmt),
retMemAddr,
getValidDowncallMemAddr(downcallAddr),
Expand Down
2 changes: 1 addition & 1 deletion test/functional/Java22andUp/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<target name="build">
<if>
<not>
<matches string="${JDK_VERSION}" pattern="^(8|9|1[0-9]|2[0-2])$$" />
<matches string="${JDK_VERSION}" pattern="^(8|9|1[0-9]|2[0-1])$$" />
</not>
<then>
<antcall target="clean" inheritall="true" />
Expand Down
10 changes: 0 additions & 10 deletions test/functional/Java22andUp/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex
<playlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../TestConfig/playlist.xsd">
<test>
<testCaseName>Jep454Tests_testLinkerFfi_DownCall</testCaseName>
<disables>
<disable>
<comment>https://github.com/eclipse-openj9/openj9/issues/18349</comment>
</disable>
</disables>
<command>$(ADD_JVM_LIB_DIR_TO_LIBPATH) $(JAVA_COMMAND) $(JVM_OPTIONS) \
--enable-native-access=ALL-UNNAMED \
-Dforeign.restricted=permit \
Expand All @@ -54,11 +49,6 @@ SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0-only WITH Classpath-ex

<test>
<testCaseName>Jep454Tests_testLinkerFfi_UpCall</testCaseName>
<disables>
<disable>
<comment>https://github.com/eclipse-openj9/openj9/issues/18349</comment>
</disable>
</disables>
<command>$(ADD_JVM_LIB_DIR_TO_LIBPATH) $(JAVA_COMMAND) $(JVM_OPTIONS) \
--enable-native-access=ALL-UNNAMED \
-Dforeign.restricted=permit \
Expand Down

0 comments on commit 13443f0

Please sign in to comment.