Skip to content

Commit 9625aeb

Browse files
OracleLabsAutomationzapster
authored andcommitted
[GR-60186] Update labsjdk to 24+26-jvmci-b01
PullRequest: graal/19475
2 parents 212ab6e + f6442ba commit 9625aeb

File tree

22 files changed

+123
-57
lines changed

22 files changed

+123
-57
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": "24", "build_id": "jdk-24+25-3126", "platformspecific": true, "extrabundles": ["static-libs"]},
11+
"galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+26-3309", "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": "24", "build_id": "jdk-24+25", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+25-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+25-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+25-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+25-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+25-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+25-jvmci-b01-sulong", "platformspecific": true }
48+
"oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+26", "platformspecific": true, "extrabundles": ["static-libs"]},
49+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+26-jvmci-b01", "platformspecific": true },
50+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+26-jvmci-b01-debug", "platformspecific": true },
51+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+26-jvmci-b01-sulong", "platformspecific": true },
52+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+26-jvmci-b01", "platformspecific": true },
53+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+26-jvmci-b01-debug", "platformspecific": true },
54+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+26-jvmci-b01-sulong", "platformspecific": true }
5555
},
5656

5757
"eclipse": {

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
@@ -55,8 +55,8 @@ public final class JVMCIVersionCheck {
5555
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
5656
"21", Map.of(DEFAULT_VENDOR_ENTRY, createLegacyVersion(23, 1, 33)),
5757
"24", Map.of(
58-
"Oracle Corporation", createLabsJDKVersion("24+25", 1),
59-
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24+25", 1)));
58+
"Oracle Corporation", createLabsJDKVersion("24+26", 1),
59+
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24+26", 1)));
6060
private static final int NA = 0;
6161
/**
6262
* Minimum Java release supported by Graal.

sdk/mx.sdk/mx_sdk_vm_impl.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2306,6 +2306,9 @@ def _get_extra_jvm_args():
23062306
extra_jvm_args = mx.list_to_cmd_line(image_config.extra_jvm_args)
23072307
if isinstance(self.subject.component, mx_sdk.GraalVmTruffleComponent) or image_config.is_polyglot:
23082308
extra_jvm_args = ' '.join([extra_jvm_args, '--enable-native-access=org.graalvm.truffle'])
2309+
# GR-59703: Migrate sun.misc.* usages.
2310+
if mx.VersionSpec("23.0.0") <= mx.get_jdk(tag='default').version:
2311+
extra_jvm_args = ' '.join([extra_jvm_args, '--sun-misc-unsafe-memory-access=allow'])
23092312
if not _jlink_libraries():
23102313
if mx.is_windows():
23112314
extra_jvm_args = ' '.join([extra_jvm_args, r'--upgrade-module-path "%location%\..\..\jvmci\graal.jar"'])

sdk/src/org.graalvm.launcher.native/src/launcher.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,10 @@ static void parse_vm_options(int argc, char **argv, std::string exeDir, JavaVMIn
558558

559559
/* Allow Truffle NFI Panama to use Linker#{downcallHandle,upcallStub} without warnings. */
560560
vmArgs.push_back("--enable-native-access=org.graalvm.truffle");
561+
// GR-59703: Migrate sun.misc.* usages.
562+
#if LAUNCHER_JDK_VERSION >= 23
563+
vmArgs.push_back("--sun-misc-unsafe-memory-access=allow");
564+
#endif
561565
}
562566

563567
jint nOptions = jvmMode ? vmArgs.size() : 1 + vmArgs.size();

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@
6464
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/os/linux/os_linux.hpp")
6565
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/os/linux/os_linux.inline.hpp")
6666
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+24/src/hotspot/os/posix/include/jvm_md.h")
67-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+25/src/hotspot/os/posix/os_posix.cpp")
67+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+26/src/hotspot/os/posix/os_posix.cpp")
6868
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+20/src/hotspot/os/posix/os_posix.hpp")
6969
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/os/posix/os_posix.inline.hpp")
7070
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+25/src/hotspot/share/memory/allocation.hpp")
7171
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/memory/allocation.inline.hpp")
7272
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/memory/allStatic.hpp")
7373
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/nmt/memTag.hpp")
7474
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+24/src/hotspot/share/runtime/os.cpp")
75-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+25/src/hotspot/share/runtime/os.hpp")
75+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+26/src/hotspot/share/runtime/os.hpp")
7676
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/runtime/os.inline.hpp")
7777
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/checkedCast.hpp")
7878
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/compilerWarnings_gcc.hpp")
@@ -86,8 +86,8 @@
8686
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/logging/log.hpp")
8787
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/memory/allocation.cpp")
8888
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+25/src/hotspot/share/runtime/globals.hpp")
89-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+22/src/hotspot/share/utilities/debug.cpp")
90-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+16/src/hotspot/share/utilities/debug.hpp")
89+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+26/src/hotspot/share/utilities/debug.cpp")
90+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+26/src/hotspot/share/utilities/debug.hpp")
9191
public class ContainerLibrary {
9292
static final int VERSION = 240100;
9393

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/dcmd/AbstractDCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ private DCmdOption<?> findOption(String optionName) {
146146
return null;
147147
}
148148

149-
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+18/src/hotspot/share/services/diagnosticArgument.cpp#L140-L166")
149+
@BasedOnJDKFile("https://github.com/openjdk/jdk/blob/jdk-24+26/src/hotspot/share/services/diagnosticArgument.cpp#L141-L171")
150150
private static Object parseValue(DCmdOption<?> option, String valueString) {
151151
Class<?> type = option.type();
152152
if (type == Boolean.class) {

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,15 @@ public boolean getAsBoolean() {
5454
final class Target_jdk_internal_foreign_MemorySessionImpl {
5555
@Substitute
5656
@SuppressWarnings("static-method")
57-
Target_java_lang_foreign_Arena asArena() {
57+
@TargetElement(name = "asArena", onlyWith = JDK21OrEarlier.class)
58+
Target_java_lang_foreign_Arena asArenaJDK21() {
59+
throw ForeignDisabledSubstitutions.fail();
60+
}
61+
62+
@Substitute
63+
@SuppressWarnings("static-method")
64+
@TargetElement(onlyWith = JDKLatest.class)
65+
Target_jdk_internal_foreign_ArenaImpl asArena() {
5866
throw ForeignDisabledSubstitutions.fail();
5967
}
6068
}
@@ -63,6 +71,10 @@ Target_java_lang_foreign_Arena asArena() {
6371
final class Target_java_lang_foreign_Arena {
6472
}
6573

74+
@TargetClass(className = "jdk.internal.foreign.ArenaImpl", onlyWith = {ForeignDisabled.class, JDKLatest.class})
75+
final class Target_jdk_internal_foreign_ArenaImpl {
76+
}
77+
6678
@TargetClass(className = "java.lang.foreign.Linker", onlyWith = ForeignDisabled.class)
6779
final class Target_java_lang_foreign_Linker {
6880
}

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2007, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
33
* Copyright (c) 2020, 2020, Red Hat Inc. All rights reserved.
44
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55
*
@@ -714,6 +714,7 @@ public static Enumeration<URL> findResources(String name) {
714714
final class Target_jdk_internal_logger_LoggerFinderLoader {
715715
// Checkstyle: stop
716716
@Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset, isFinal = true)//
717+
@TargetElement(onlyWith = JDK21OrEarlier.class)//
717718
static Permission READ_PERMISSION;
718719
// Checkstyle: resume
719720
}

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -33,7 +33,6 @@
3333
import java.lang.reflect.Field;
3434
import java.lang.reflect.Modifier;
3535
import java.nio.charset.CharsetDecoder;
36-
import java.security.AccessControlContext;
3736
import java.util.concurrent.ForkJoinPool;
3837

3938
import org.graalvm.nativeimage.ImageSingletons;
@@ -313,15 +312,6 @@ private static synchronized ForkJoinPool initializeCommonPool() {
313312
}
314313
}
315314

316-
@TargetClass(value = java.util.concurrent.ForkJoinPool.class, innerClass = "DefaultForkJoinWorkerThreadFactory", onlyWith = JDKLatest.class)
317-
@SuppressWarnings("removal")
318-
final class Target_java_util_concurrent_ForkJoinPool_DefaultForkJoinWorkerThreadFactory {
319-
@Alias @RecomputeFieldValue(kind = Reset) //
320-
static AccessControlContext regularACC;
321-
@Alias @RecomputeFieldValue(kind = Reset) //
322-
static AccessControlContext commonACC;
323-
}
324-
325315
/** Dummy class to have a class with the file's name. */
326316
public final class RecomputedFields {
327317
}

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

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -28,7 +28,6 @@
2828

2929
import java.lang.ref.ReferenceQueue;
3030
import java.lang.reflect.Constructor;
31-
import java.lang.reflect.InvocationTargetException;
3231
import java.net.URL;
3332
import java.security.AccessControlContext;
3433
import java.security.CodeSource;
@@ -47,6 +46,7 @@
4746
import java.util.WeakHashMap;
4847
import java.util.function.BooleanSupplier;
4948
import java.util.function.Predicate;
49+
import java.util.function.Supplier;
5050

5151
import org.graalvm.nativeimage.Platform;
5252
import org.graalvm.nativeimage.Platforms;
@@ -65,6 +65,7 @@
6565
import com.oracle.svm.core.annotate.TargetElement;
6666
import com.oracle.svm.core.graal.snippets.CEntryPointSnippets;
6767
import com.oracle.svm.core.thread.Target_java_lang_Thread;
68+
import com.oracle.svm.core.thread.Target_java_lang_ThreadLocal;
6869
import com.oracle.svm.core.util.BasedOnJDKFile;
6970
import com.oracle.svm.core.util.VMError;
7071
import com.oracle.svm.util.ReflectionUtil;
@@ -196,7 +197,13 @@ final class Target_java_security_Provider_ServiceKey {
196197
final class Target_java_security_Provider {
197198
@Alias //
198199
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Custom, declClass = ServiceKeyComputer.class) //
199-
private static Target_java_security_Provider_ServiceKey previousKey;
200+
@TargetElement(name = "previousKey", onlyWith = JDK21OrEarlier.class) //
201+
private static Target_java_security_Provider_ServiceKey previousKeyJDK21;
202+
203+
@Alias //
204+
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Custom, declClass = ThreadLocalServiceKeyComputer.class) //
205+
@TargetElement(onlyWith = JDKLatest.class) //
206+
private static Target_java_lang_ThreadLocal previousKey;
200207
}
201208

202209
@TargetClass(value = java.security.Provider.class, innerClass = "Service")
@@ -211,17 +218,40 @@ final class Target_java_security_Provider_Service {
211218
private Object constructorCache;
212219
}
213220

221+
class ServiceKeyProvider {
222+
static Object getNewServiceKey() {
223+
Class<?> serviceKey = ReflectionUtil.lookupClass("java.security.Provider$ServiceKey");
224+
Constructor<?> constructor = ReflectionUtil.lookupConstructor(serviceKey, String.class, String.class, boolean.class);
225+
return ReflectionUtil.newInstance(constructor, "", "", false);
226+
}
227+
228+
/**
229+
* Originally the thread local creates a new default service key each time. Here we always
230+
* return the singleton default service key. This default key will be replaced with an actual
231+
* key in {@code java.security.Provider.parseLegacy}
232+
*/
233+
static Supplier<Object> getNewServiceKeySupplier() {
234+
final Object singleton = ServiceKeyProvider.getNewServiceKey();
235+
return () -> singleton;
236+
}
237+
}
238+
214239
@Platforms(Platform.HOSTED_ONLY.class)
215240
class ServiceKeyComputer implements FieldValueTransformer {
216241
@Override
217242
public Object transform(Object receiver, Object originalValue) {
218-
try {
219-
Class<?> serviceKey = Class.forName("java.security.Provider$ServiceKey");
220-
Constructor<?> constructor = ReflectionUtil.lookupConstructor(serviceKey, String.class, String.class, boolean.class);
221-
return constructor.newInstance("", "", false);
222-
} catch (InstantiationException | IllegalAccessException | InvocationTargetException | ClassNotFoundException e) {
223-
throw VMError.shouldNotReachHere(e);
224-
}
243+
return ServiceKeyProvider.getNewServiceKey();
244+
}
245+
}
246+
247+
@Platforms(Platform.HOSTED_ONLY.class)
248+
class ThreadLocalServiceKeyComputer implements FieldValueTransformer {
249+
@Override
250+
public Object transform(Object receiver, Object originalValue) {
251+
// Originally the thread local creates a new default service key each time.
252+
// Here we always return the singleton default service key. This default key
253+
// will be replaced with an actual key in Provider.parseLegacy
254+
return ThreadLocal.withInitial(ServiceKeyProvider.getNewServiceKeySupplier());
225255
}
226256
}
227257

0 commit comments

Comments
 (0)