Skip to content

Commit 993ea44

Browse files
[GR-63992] Update labsjdk to 25+17-jvmci-b01
PullRequest: graal/20478
2 parents e5da13a + a97d163 commit 993ea44

File tree

13 files changed

+138
-54
lines changed

13 files changed

+138
-54
lines changed

common.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {
11-
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+15-1632", "platformspecific": true, "extrabundles": ["static-libs"]},
11+
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+17-1898", "platformspecific": true, "extrabundles": ["static-libs"]},
1212

1313
"oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]},
1414
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true },
@@ -45,13 +45,13 @@
4545

4646
"oraclejdk23": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+37", "platformspecific": true, "extrabundles": ["static-libs"]},
4747

48-
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+16", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+16-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+16-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+16-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+16-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+16-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+16-jvmci-b01-sulong", "platformspecific": true }
48+
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+17", "platformspecific": true, "extrabundles": ["static-libs"]},
49+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+17-jvmci-b01", "platformspecific": true },
50+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+17-jvmci-b01-debug", "platformspecific": true },
51+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+17-jvmci-b01-sulong", "platformspecific": true },
52+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+17-jvmci-b01", "platformspecific": true },
53+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+17-jvmci-b01-debug", "platformspecific": true },
54+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+17-jvmci-b01-sulong", "platformspecific": true }
5555
},
5656

5757
"eclipse": {

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/GraalHotSpotVMConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ public int threadTlabTopOffset() {
518518
public final long poly1305ProcessBlocks = getFieldValue("StubRoutines::_poly1305_processBlocks", Long.class, "address");
519519
public final long chacha20Block = getFieldValue("StubRoutines::_chacha20Block", Long.class, "address");
520520

521-
public final long intpolyMontgomeryMultP256 = getFieldValue("StubRoutines::_intpoly_montgomeryMult_P256", Long.class, "address", 0L, JDK >= 23);
521+
public final long intpolyMontgomeryMultP256 = getFieldValue("StubRoutines::_intpoly_montgomeryMult_P256", Long.class, "address", 0L, JDK >= 25);
522522
public final long intpolyAssign = getFieldValue("StubRoutines::_intpoly_assign", Long.class, "address", 0L, JDK >= 23);
523523

524524
public final long throwDelayedStackOverflowErrorEntry = getFieldValue(JDK >= 24 ? "CompilerToVM::Data::SharedRuntime_throw_delayed_StackOverflowError_entry"

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/JVMCIVersionCheck.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public final class JVMCIVersionCheck {
5656
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
5757
"21", Map.of(DEFAULT_VENDOR_ENTRY, createLegacyVersion(23, 1, 33)),
5858
"25", Map.of(
59-
"Oracle Corporation", createLabsJDKVersion("25+16", 1),
60-
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("25+16", 1)));
59+
"Oracle Corporation", createLabsJDKVersion("25+17", 1),
60+
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("25+17", 1)));
6161
private static final int NA = 0;
6262
/**
6363
* Minimum Java release supported by Graal.

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
14631463

14641464
private static void registerP256Plugins(InvocationPlugins plugins, GraalHotSpotVMConfig config, Replacements replacements) {
14651465
Registration r = new Registration(plugins, "sun.security.util.math.intpoly.MontgomeryIntegerPolynomialP256", replacements);
1466-
r.registerConditional(config.intpolyMontgomeryMultP256 != 0L, new InvocationPlugin("multImpl", Receiver.class, long[].class, long[].class, long[].class) {
1466+
r.registerConditional(config.intpolyMontgomeryMultP256 != 0L, new InvocationPlugin("mult", Receiver.class, long[].class, long[].class, long[].class) {
14671467
@Override
14681468
public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver receiver, ValueNode aIn, ValueNode bIn, ValueNode rOut) {
14691469
try (InvocationPluginHelper helper = new InvocationPluginHelper(b, targetMethod)) {

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/c/locale/LocaleCHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class LocaleCHelper {
6161
@CFunction(value = "svm_initialize_locale", transition = NO_TRANSITION)
6262
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+17/src/java.base/unix/native/libjava/java_props_md.c#L71-L357")
6363
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+17/src/java.base/unix/native/libjava/java_props_md.c#L436-L460")
64-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+24/src/java.base/windows/native/libjava/java_props_md.c#L254-L713")
64+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+17/src/java.base/windows/native/libjava/java_props_md.c#L263-L722")
6565
static native int initializeLocale();
6666

6767
@CFunction(value = "svm_get_locale", transition = NO_TRANSITION)

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/container/ContainerLibrary.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/os/linux/cgroupV2Subsystem_linux.hpp")
6161
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/os/linux/osContainer_linux.cpp")
6262
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/os/linux/osContainer_linux.hpp")
63-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/os/linux/os_linux.cpp")
63+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+17/src/hotspot/os/linux/os_linux.cpp")
6464
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/os/linux/os_linux.hpp")
6565
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/os/linux/os_linux.inline.hpp")
6666
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/os/posix/include/jvm_md.h")
@@ -71,7 +71,7 @@
7171
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/share/memory/allocation.inline.hpp")
7272
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/share/memory/allStatic.hpp")
7373
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/share/nmt/memTag.hpp")
74-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+15/src/hotspot/share/runtime/os.cpp")
74+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+17/src/hotspot/share/runtime/os.cpp")
7575
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/share/runtime/os.hpp")
7676
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/share/runtime/os.inline.hpp")
7777
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+13/src/hotspot/share/utilities/checkedCast.hpp")

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/DeferredCommonPool.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
*/
2525
package com.oracle.svm.core.jdk;
2626

27+
import java.lang.reflect.Method;
2728
import java.util.Collection;
2829
import java.util.List;
2930
import java.util.concurrent.Callable;
@@ -45,6 +46,8 @@
4546
*/
4647
public final class DeferredCommonPool extends ForkJoinPool {
4748

49+
private static final Method methodInvokeAllUninterruptibly = JavaVersionUtil.JAVA_SPEC >= 22 ? ReflectionUtil.lookupMethod(ForkJoinPool.class, "invokeAllUninterruptibly", Collection.class) : null;
50+
4851
public DeferredCommonPool() {
4952
super(1, new DisallowingForkJoinWorkerThreadFactory(), null, false);
5053
}
@@ -87,9 +90,8 @@ public ForkJoinTask<?> submit(Runnable task) {
8790
@SuppressWarnings({"unchecked", "static-method", "all"})
8891
public <T> List<Future<T>> invokeAllUninterruptibly(Collection<? extends Callable<T>> tasks) {
8992
VMError.guarantee(JavaVersionUtil.JAVA_SPEC >= 22, "invokeAllUninterruptibly only exists in JDK 22+");
90-
var m = ReflectionUtil.lookupMethod(ForkJoinPool.class, "invokeAllUninterruptibly", Collection.class);
9193
try {
92-
return (List<Future<T>>) m.invoke(ForkJoinPool.commonPool(), tasks);
94+
return (List<Future<T>>) methodInvokeAllUninterruptibly.invoke(ForkJoinPool.commonPool(), tasks);
9395
} catch (ReflectiveOperationException e) {
9496
throw VMError.shouldNotReachHere(e);
9597
}

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/RecomputedFields.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import com.oracle.svm.core.annotate.RecomputeFieldValue;
4747
import com.oracle.svm.core.annotate.Substitute;
4848
import com.oracle.svm.core.annotate.TargetClass;
49+
import com.oracle.svm.core.annotate.TargetElement;
4950
import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature;
5051
import com.oracle.svm.core.feature.InternalFeature;
5152
import com.oracle.svm.core.util.BasedOnJDKFile;
@@ -261,6 +262,10 @@ public static int getCommonPoolParallelism() {
261262
@Alias //
262263
Target_java_util_concurrent_ForkJoinPool(byte forCommonPoolOnly) {
263264
}
265+
266+
@Alias //
267+
@TargetElement(onlyWith = JDKLatest.class)
268+
public static native ForkJoinPool asyncCommonPool();
264269
}
265270

266271
/**

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/Target_java_util_concurrent_CompletableFuture.java

Lines changed: 72 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,43 +33,104 @@
3333
import com.oracle.svm.core.annotate.Alias;
3434
import com.oracle.svm.core.annotate.InjectAccessors;
3535
import com.oracle.svm.core.annotate.TargetClass;
36+
import com.oracle.svm.core.annotate.TargetElement;
3637
import com.oracle.svm.core.feature.AutomaticallyRegisteredFeature;
3738
import com.oracle.svm.core.feature.InternalFeature;
39+
import com.oracle.svm.core.util.VMError;
40+
41+
import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
3842

3943
@TargetClass(java.util.concurrent.CompletableFuture.class)
4044
final class Target_java_util_concurrent_CompletableFuture {
4145
// Checkstyle: stop
42-
@Alias @InjectAccessors(CompletableFutureUseCommonPoolAccessor.class) //
46+
@Alias @InjectAccessors(CompletableFutureUseCommonPoolJDK21Accessor.class) //
47+
@TargetElement(onlyWith = JDK21OrEarlier.class) //
4348
private static boolean USE_COMMON_POOL;
4449

45-
@Alias @InjectAccessors(CompletableFutureAsyncPoolAccessor.class) //
50+
@Alias @InjectAccessors(CompletableFutureAsyncPoolJDK21Accessor.class) //
51+
@TargetElement(onlyWith = JDK21OrEarlier.class) //
4652
private static Executor ASYNC_POOL;
53+
54+
@Alias @InjectAccessors(CompletableFutureAsyncPoolAccessor.class) //
55+
@TargetElement(name = "ASYNC_POOL", onlyWith = JDKLatest.class) //
56+
private static ForkJoinPool ASYNC_POOL_JDK_LATEST;
4757
// Checkstyle: resume
4858
}
4959

50-
class CompletableFutureUseCommonPoolAccessor {
60+
@TargetClass(className = "java.util.concurrent.DelayScheduler", onlyWith = JDKLatest.class)
61+
final class Target_java_util_concurrent_DelayScheduler {
62+
@Alias @InjectAccessors(DelaySchedulerNanoTimeOffsetAccessor.class) //
63+
private static long nanoTimeOffset;
64+
}
65+
66+
class DelaySchedulerNanoTimeOffsetAccessor {
67+
static long get() {
68+
return DelaySchedulerNanoTimeOffsetHolder.NANO_TIME_OFFSET;
69+
}
70+
}
71+
72+
/**
73+
* Holder for {@link DelaySchedulerNanoTimeOffsetHolder#NANO_TIME_OFFSET}. Initialized at runtime
74+
* via {@link CompletableFutureFeature}.
75+
*/
76+
class DelaySchedulerNanoTimeOffsetHolder {
77+
78+
public static final long NANO_TIME_OFFSET;
79+
80+
static {
81+
if (SubstrateUtil.HOSTED) {
82+
throw VMError.shouldNotReachHere(DelaySchedulerNanoTimeOffsetHolder.class.getName() + " must only be initialized at runtime");
83+
}
84+
NANO_TIME_OFFSET = Math.min(System.nanoTime(), 0L) + Long.MIN_VALUE;
85+
}
86+
}
87+
88+
class CompletableFutureUseCommonPoolJDK21Accessor {
5189
static boolean get() {
52-
return CompletableFutureFieldHolder.USE_COMMON_POOL;
90+
return CompletableFutureJDK21FieldHolder.USE_COMMON_POOL;
5391
}
5492
}
5593

56-
class CompletableFutureAsyncPoolAccessor {
94+
class CompletableFutureAsyncPoolJDK21Accessor {
5795
static Executor get() {
96+
return CompletableFutureJDK21FieldHolder.ASYNC_POOL;
97+
}
98+
}
99+
100+
class CompletableFutureAsyncPoolAccessor {
101+
static ForkJoinPool get() {
58102
return CompletableFutureFieldHolder.ASYNC_POOL;
59103
}
60104
}
61105

62106
/* Note that this class is initialized at run time. */
63-
class CompletableFutureFieldHolder {
107+
class CompletableFutureJDK21FieldHolder {
64108
/* The following is copied from CompletableFuture. */
65109

66110
static final boolean USE_COMMON_POOL = ForkJoinPool.getCommonPoolParallelism() > 1;
67111

68-
static final Executor ASYNC_POOL = USE_COMMON_POOL ? ForkJoinPool.commonPool()
69-
: SubstrateUtil.cast(new Target_java_util_concurrent_CompletableFuture_ThreadPerTaskExecutor(), Executor.class);
112+
static final Executor ASYNC_POOL;
113+
114+
static {
115+
if (JavaVersionUtil.JAVA_SPEC <= 21) {
116+
if (USE_COMMON_POOL) {
117+
ASYNC_POOL = ForkJoinPool.commonPool();
118+
} else {
119+
ASYNC_POOL = SubstrateUtil.cast(new Target_java_util_concurrent_CompletableFuture_ThreadPerTaskExecutor(), Executor.class);
120+
}
121+
} else {
122+
ASYNC_POOL = null;
123+
}
124+
}
125+
}
126+
127+
/* Note that this class is initialized at run time. */
128+
class CompletableFutureFieldHolder {
129+
/* The following is copied from CompletableFuture. */
130+
static final ForkJoinPool ASYNC_POOL = Target_java_util_concurrent_ForkJoinPool.asyncCommonPool();
70131
}
71132

72-
@TargetClass(value = java.util.concurrent.CompletableFuture.class, innerClass = "ThreadPerTaskExecutor")
133+
@TargetClass(value = java.util.concurrent.CompletableFuture.class, innerClass = "ThreadPerTaskExecutor", onlyWith = JDK21OrEarlier.class)
73134
final class Target_java_util_concurrent_CompletableFuture_ThreadPerTaskExecutor {
74135
}
75136

@@ -78,5 +139,7 @@ class CompletableFutureFeature implements InternalFeature {
78139
@Override
79140
public void duringSetup(DuringSetupAccess access) {
80141
RuntimeClassInitialization.initializeAtRunTime(CompletableFutureFieldHolder.class);
142+
RuntimeClassInitialization.initializeAtRunTime(CompletableFutureJDK21FieldHolder.class);
143+
RuntimeClassInitialization.initializeAtRunTime(DelaySchedulerNanoTimeOffsetHolder.class);
81144
}
82145
}

substratevm/src/com.oracle.svm.hosted.foreign/src/com/oracle/svm/hosted/foreign/DowncallStub.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
* capture.
8787
*/
8888
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+7/src/hotspot/share/prims/nativeEntryPoint.cpp")
89-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+7/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp")
90-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+7/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp")
89+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+17/src/hotspot/cpu/x86/downcallLinker_x86_64.cpp")
90+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-25+17/src/hotspot/cpu/aarch64/downcallLinker_aarch64.cpp")
9191
class DowncallStub extends NonBytecodeMethod {
9292
public static Signature createSignature(MetaAccessProvider metaAccess) {
9393
return ResolvedSignature.fromKinds(new JavaKind[]{JavaKind.Object}, JavaKind.Object, metaAccess);

0 commit comments

Comments
 (0)