From 8cbc550e9aa45f02e9fee86edeca3a74e70b6d9f Mon Sep 17 00:00:00 2001 From: Marouane El Hallaoui Date: Tue, 10 Oct 2023 15:52:29 +0100 Subject: [PATCH 1/9] update to 22+18-jvmci-b01 --- common.json | 14 +++++++------- .../compiler/hotspot/JVMCIVersionCheck.java | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common.json b/common.json index 1cec2ebc15f8..b44a57ec20eb 100644 --- a/common.json +++ b/common.json @@ -42,13 +42,13 @@ "labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-debug", "platformspecific": true }, "labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-sulong", "platformspecific": true }, - "oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "17", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]}, - "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+17-jvmci-b01", "platformspecific": true }, - "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+17-jvmci-b01-debug", "platformspecific": true }, - "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+17-jvmci-b01-sulong", "platformspecific": true }, - "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+17-jvmci-b01", "platformspecific": true }, - "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+17-jvmci-b01-debug", "platformspecific": true }, - "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+17-jvmci-b01-sulong", "platformspecific": true } + "oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "18", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]}, + "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-20231009131940-fe79b27679", "platformspecific": true }, + "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-20231009131940-fe79b27679-debug", "platformspecific": true }, + "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-20231009131940-fe79b27679-sulong", "platformspecific": true }, + "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-20231009131940-fe79b27679+f701d142d7", "platformspecific": true }, + "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-20231009131940-fe79b27679+f701d142d7-debug", "platformspecific": true }, + "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-20231009131940-fe79b27679+f701d142d7-sulong", "platformspecific": true } }, "eclipse": { diff --git a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java index 30da62e4dbea..93ec678914b8 100644 --- a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java +++ b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java @@ -48,7 +48,7 @@ public final class JVMCIVersionCheck { */ private static final Map JVMCI_MIN_VERSIONS = Map.of( "21", new Version(23, 1, 15), - "22", new Version("22+17", 1)); + "22", new Version("22+18", 1)); private static final int NA = 0; /** From 42bb9e3a31aa0738c3729c38529232d0f8fe3c97 Mon Sep 17 00:00:00 2001 From: Yudi Zheng Date: Tue, 10 Oct 2023 21:15:00 +0200 Subject: [PATCH 2/9] JVMCIUseFastLocking defaults to true after b18. --- .../src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java | 2 +- .../graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java index dcc3b77fb125..e324eb17e00b 100644 --- a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java +++ b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java @@ -120,7 +120,7 @@ private HotSpotGraalRuntime.HotSpotGC getSelectedGC() throws GraalError { public final int hugeMethodLimit = getFlag("HugeMethodLimit", Integer.class); public final boolean printInlining = getFlag("PrintInlining", Boolean.class); public final boolean inline = getFlag("Inline", Boolean.class); - public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class); + public final boolean useFastLocking = getFlag("JVMCIUseFastLocking", Boolean.class, true, !(JDK >= 22 && JDK_BUILD >= 18)); private final boolean useHeavyMonitors = JDK < 22 && getFlag("UseHeavyMonitors", Boolean.class); // Use only heavy monitors for locking diff --git a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java index dbdac5c2639e..9cc047467baa 100644 --- a/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java +++ b/compiler/src/jdk.internal.vm.compiler/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigAccess.java @@ -115,7 +115,7 @@ public static boolean jvmciGE(Version v) { } public static final int JDK = Runtime.version().feature(); - public static final int JDK_UPDATE = Runtime.version().update(); + public static final int JDK_BUILD = Runtime.version().build().orElse(0); public static final Version JVMCI_VERSION; public static final boolean JVMCI; public static final boolean JDK_PRERELEASE; From 452246101651d3606095e68722ffc879d5c78a20 Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Wed, 11 Oct 2023 14:59:05 +0200 Subject: [PATCH 3/9] svm: fix symbol detection in JvmFuncsFallbacksBuildTask on linux [GR-49358] --- substratevm/mx.substratevm/mx_substratevm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/substratevm/mx.substratevm/mx_substratevm.py b/substratevm/mx.substratevm/mx_substratevm.py index 9d118dd13a28..08e081fdd513 100644 --- a/substratevm/mx.substratevm/mx_substratevm.py +++ b/substratevm/mx.substratevm/mx_substratevm.py @@ -1665,7 +1665,7 @@ def collector(line): else: # Linux objdump objdump --wide --syms # 0000000000000000 *UND* 0000000000000000 JVM_InitStackTraceElement - found_undef = line_tokens[1] = '*UND*' + found_undef = line_tokens[1] == '*UND*' if found_undef: symbol_candiate = line_tokens[-1] mx.logvv('Found undefined symbol: ' + symbol_candiate) From 5d79164dd0628830cad02daa7ec4f7abf0016545 Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Wed, 11 Oct 2023 15:29:29 +0200 Subject: [PATCH 4/9] svm: remove String.split substitution since JDK-8262994 was fixed in JDK 21 --- .../svm/core/jdk/JavaLangSubstitutions.java | 69 ------------------- 1 file changed, 69 deletions(-) diff --git a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaLangSubstitutions.java b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaLangSubstitutions.java index a61fe0fe92a2..8facaf26d072 100644 --- a/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaLangSubstitutions.java +++ b/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jdk/JavaLangSubstitutions.java @@ -32,7 +32,6 @@ import java.io.InputStream; import java.io.PrintStream; import java.net.URL; -import java.util.ArrayList; import java.util.Arrays; import java.util.Enumeration; import java.util.List; @@ -41,7 +40,6 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.function.BooleanSupplier; -import java.util.regex.Pattern; import java.util.stream.Stream; import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode; @@ -187,73 +185,6 @@ public String intern() { @Alias // int hash; - /** - * This is a copy of String.split from the JDK, but with the fastpath loop factored out into a - * separate method. This allows inlining and constant folding of the condition for call sites - * where the regex is a constant (which is a common usage pattern). - * - * JDK-8262994 should make that refactoring in OpenJDK, after which this substitution can be - * removed. - */ - @Substitute - public String[] split(String regex, int limit) { - /* - * fastpath if the regex is a (1) one-char String and this character is not one of the - * RegEx's meta characters ".$|()[{^?*+\\", or (2) two-char String and the first char is the - * backslash and the second is not the ascii digit or ascii letter. - */ - char ch = 0; - if (((regex.length() == 1 && - ".$|()[{^?*+\\".indexOf(ch = regex.charAt(0)) == -1) || - (regex.length() == 2 && - regex.charAt(0) == '\\' && - (((ch = regex.charAt(1)) - '0') | ('9' - ch)) < 0 && - ((ch - 'a') | ('z' - ch)) < 0 && - ((ch - 'A') | ('Z' - ch)) < 0)) && - (ch < Character.MIN_HIGH_SURROGATE || - ch > Character.MAX_LOW_SURROGATE)) { - return StringHelper.simpleSplit(SubstrateUtil.cast(this, String.class), limit, ch); - } - return Pattern.compile(regex).split(SubstrateUtil.cast(this, String.class), limit); - } -} - -final class StringHelper { - static String[] simpleSplit(String that, int limit, char ch) { - int off = 0; - int next = 0; - boolean limited = limit > 0; - ArrayList list = new ArrayList<>(); - while ((next = that.indexOf(ch, off)) != -1) { - if (!limited || list.size() < limit - 1) { - list.add(that.substring(off, next)); - off = next + 1; - } else { // last one - // assert (list.size() == limit - 1); - int last = that.length(); - list.add(that.substring(off, last)); - off = last; - break; - } - } - // If no match was found, return this - if (off == 0) { - return new String[]{that}; - } - // Add remaining segment - if (!limited || list.size() < limit) { - list.add(that.substring(off, that.length())); - } - // Construct result - int resultSize = list.size(); - if (limit == 0) { - while (resultSize > 0 && list.get(resultSize - 1).isEmpty()) { - resultSize--; - } - } - String[] result = new String[resultSize]; - return list.subList(0, resultSize).toArray(result); - } } @TargetClass(className = "java.lang.StringLatin1") From c97ced386257cd9a7019dbf7d42913b3d14e5b51 Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Wed, 11 Oct 2023 17:24:01 +0200 Subject: [PATCH 5/9] truffle: ignore @Restricted warnings in c.o.truffle.nfi.backend.panama [GR-49385] --- .../com/oracle/truffle/nfi/backend/panama/ErrorContext.java | 2 +- .../oracle/truffle/nfi/backend/panama/PanamaNFIBackend.java | 2 +- .../oracle/truffle/nfi/backend/panama/PanamaSignature.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/ErrorContext.java b/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/ErrorContext.java index 9c83e9437813..5ec4bce2b302 100644 --- a/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/ErrorContext.java +++ b/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/ErrorContext.java @@ -76,7 +76,7 @@ public void setNativeErrno(int nativeErrno) { this.nativeErrno = nativeErrno; } - @SuppressWarnings("preview") + @SuppressWarnings({"preview", "restricted"}) MemorySegment getErrnoLocation() { Linker linker = Linker.nativeLinker(); FunctionDescriptor desc = FunctionDescriptor.of(ValueLayout.JAVA_LONG); diff --git a/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaNFIBackend.java b/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaNFIBackend.java index dd078c40a995..addce143a8af 100644 --- a/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaNFIBackend.java +++ b/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaNFIBackend.java @@ -110,7 +110,7 @@ protected LoadLibraryNode(PanamaNFILanguage language, String name) { } @TruffleBoundary - @SuppressWarnings("preview") + @SuppressWarnings({"preview", "restricted"}) private SymbolLookup doLoad() { PanamaNFIContext ctx = PanamaNFIContext.get(this); try { diff --git a/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaSignature.java b/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaSignature.java index e578dc6fea8f..0ce8f534f7fb 100644 --- a/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaSignature.java +++ b/truffle/src/com.oracle.truffle.nfi.backend.panama/src/com/oracle/truffle/nfi/backend/panama/PanamaSignature.java @@ -147,7 +147,7 @@ MethodType getUpcallMethodType() { } @TruffleBoundary - @SuppressWarnings("preview") + @SuppressWarnings({"preview", "restricted"}) MemorySegment bind(MethodHandle cachedHandle, Object receiver) { MethodHandle bound = cachedHandle.bindTo(receiver); @SuppressWarnings("preview") @@ -310,7 +310,7 @@ public static CachedSignatureInfo prepareSignatureInfo(PanamaType retType, ArgsS static MethodHandle createDowncallHandle(@SuppressWarnings("preview") FunctionDescriptor descriptor) { int parameterCount = descriptor.argumentLayouts().size(); - @SuppressWarnings("preview") + @SuppressWarnings({"preview", "restricted"}) MethodHandle handle = Linker.nativeLinker().downcallHandle(descriptor).asSpreader(Object[].class, parameterCount).asType( MethodType.methodType(Object.class, new Class[]{MemorySegment.class, Object[].class})); return handle; From bf87b4fddfcf576b8987ee7f36e49b41f47d0ef1 Mon Sep 17 00:00:00 2001 From: Marouane El Hallaoui Date: Thu, 12 Oct 2023 16:03:24 +0100 Subject: [PATCH 6/9] use deployed artifacts --- common.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common.json b/common.json index b44a57ec20eb..42a80700de64 100644 --- a/common.json +++ b/common.json @@ -43,12 +43,12 @@ "labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+35-jvmci-23.1-b15-sulong", "platformspecific": true }, "oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "18", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]}, - "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-20231009131940-fe79b27679", "platformspecific": true }, - "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-20231009131940-fe79b27679-debug", "platformspecific": true }, - "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-20231009131940-fe79b27679-sulong", "platformspecific": true }, - "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-20231009131940-fe79b27679+f701d142d7", "platformspecific": true }, - "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-20231009131940-fe79b27679+f701d142d7-debug", "platformspecific": true }, - "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-20231009131940-fe79b27679+f701d142d7-sulong", "platformspecific": true } + "labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01", "platformspecific": true }, + "labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-debug", "platformspecific": true }, + "labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+18-jvmci-b01-sulong", "platformspecific": true }, + "labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01", "platformspecific": true }, + "labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-debug", "platformspecific": true }, + "labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+18-jvmci-b01-sulong", "platformspecific": true } }, "eclipse": { From 78cb9c05d1f530a3ac4a5224c312ee5800384d57 Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Fri, 13 Oct 2023 09:17:54 +0200 Subject: [PATCH 7/9] sdk/ci: fix job names wrt JDK latest --- sdk/ci/ci.jsonnet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/ci/ci.jsonnet b/sdk/ci/ci.jsonnet index 0e2aa0a43f7e..f48c6180ed21 100644 --- a/sdk/ci/ci.jsonnet +++ b/sdk/ci/ci.jsonnet @@ -6,7 +6,7 @@ downloads+: { EXTRA_JAVA_HOMES: common.jdks_data['oraclejdk21'], }, - name: 'gate-sdk-oraclejdk' + self.jdk_version + '-' + self.os + '-' + self.arch, + name: 'gate-sdk-oracle' + self.jdk_name + '-' + self.os + '-' + self.arch, setup: [ ["cd", "./sdk"], ], From f549a82891e204f652021939ed5a53c733e3d7b5 Mon Sep 17 00:00:00 2001 From: Josef Eisl Date: Fri, 13 Oct 2023 11:59:41 +0200 Subject: [PATCH 8/9] truffle: disable SpotBugs as long is panama is preview [GR-49448] --- truffle/mx.truffle/suite.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/truffle/mx.truffle/suite.py b/truffle/mx.truffle/suite.py index 69d008f16b74..4873a09ac546 100644 --- a/truffle/mx.truffle/suite.py +++ b/truffle/mx.truffle/suite.py @@ -837,6 +837,8 @@ "javaCompliance" : "21+", "annotationProcessors" : ["TRUFFLE_DSL_PROCESSOR"], "workingSets" : "Truffle", + # disable SpotBugs as long is panama is preview [GR-49448] + "spotbugs" : "false", }, "com.oracle.truffle.nfi.backend.spi" : { From 81aafab919601dfac922a20219ed6ce66bbdbce2 Mon Sep 17 00:00:00 2001 From: Andreas Woess Date: Mon, 16 Oct 2023 01:29:11 +0000 Subject: [PATCH 9/9] [GR-48852] [GR-49249] [GR-49344] Test JS on jdk-latest. PullRequest: js/2944 --- vm/mx.vm/suite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vm/mx.vm/suite.py b/vm/mx.vm/suite.py index 3a059cc69812..d611a12b1775 100644 --- a/vm/mx.vm/suite.py +++ b/vm/mx.vm/suite.py @@ -33,7 +33,7 @@ "name": "graal-nodejs", "subdir": True, "dynamic": True, - "version": "6dd82d9f89f1be47d34b82f16d99afffd2a309af", + "version": "e0f922185f627f2bf8e3d9117996a698c7f8980b", "urls" : [ {"url" : "https://github.com/graalvm/graaljs.git", "kind" : "git"}, ] @@ -42,7 +42,7 @@ "name": "graal-js", "subdir": True, "dynamic": True, - "version": "6dd82d9f89f1be47d34b82f16d99afffd2a309af", + "version": "e0f922185f627f2bf8e3d9117996a698c7f8980b", "urls": [ {"url": "https://github.com/graalvm/graaljs.git", "kind" : "git"}, ]