Skip to content

Commit bd060d2

Browse files
[GR-50929] Update JVMCI to 23+1-jvmci-b01
PullRequest: graal/16376
2 parents e39f0cc + b942c31 commit bd060d2

File tree

9 files changed

+42
-40
lines changed

9 files changed

+42
-40
lines changed

common.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@
4444
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b26-debug", "platformspecific": true },
4545
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.1+11-jvmci-23.1-b26-sulong", "platformspecific": true },
4646

47-
"oraclejdk-latest": {"name": "jpg-jdk", "version": "22", "build_id": "27", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
48-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-22+27-jvmci-b01", "platformspecific": true },
49-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-22+27-jvmci-b01-debug", "platformspecific": true },
50-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-22+27-jvmci-b01-sulong", "platformspecific": true },
51-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-22+27-jvmci-b01", "platformspecific": true },
52-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-22+27-jvmci-b01-debug", "platformspecific": true },
53-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-22+27-jvmci-b01-sulong", "platformspecific": true }
47+
"oraclejdk-latest": {"name": "jpg-jdk", "version": "23", "build_id": "1", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
48+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-23+1-jvmci-b01", "platformspecific": true },
49+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-23+1-jvmci-b01-debug", "platformspecific": true },
50+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-23+1-jvmci-b01-sulong", "platformspecific": true },
51+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-23+1-jvmci-b01", "platformspecific": true },
52+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-23+1-jvmci-b01-debug", "platformspecific": true },
53+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-23+1-jvmci-b01-sulong", "platformspecific": true }
5454
},
5555

5656
"eclipse": {

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ private HotSpotGraalRuntime.HotSpotGC getSelectedGC() throws GraalError {
129129
// of the mark word.
130130
public final int lockingMode = getFlag("LockingMode", Integer.class);
131131

132-
public final int lockingModeMonitor = getConstant("LockingMode::LM_MONITOR", Integer.class, 0, JDK >= 22 && JDK_BUILD >= 18);
133-
public final int lockingModeStack = getConstant("LockingMode::LM_LEGACY", Integer.class, 1, JDK >= 22 && JDK_BUILD >= 18);
134-
public final int lockingModeLightweight = getConstant("LockingMode::LM_LIGHTWEIGHT", Integer.class, 2, JDK >= 22 && JDK_BUILD >= 18);
132+
public final int lockingModeMonitor = getConstant("LockingMode::LM_MONITOR", Integer.class, 0, JDK >= 22);
133+
public final int lockingModeStack = getConstant("LockingMode::LM_LEGACY", Integer.class, 1, JDK >= 22);
134+
public final int lockingModeLightweight = getConstant("LockingMode::LM_LIGHTWEIGHT", Integer.class, 2, JDK >= 22);
135135

136136
public final boolean foldStableValues = getFlag("FoldStableValues", Boolean.class);
137137
public final int maxVectorSize = getFlag("MaxVectorSize", Integer.class);
@@ -350,7 +350,7 @@ public int threadLastJavaFpOffset() {
350350
public final int objectMonitorEntryList = getFieldOffset("ObjectMonitor::_EntryList", Integer.class, "ObjectWaiter*");
351351
public final int objectMonitorSucc = getFieldOffset("ObjectMonitor::_succ", Integer.class, "JavaThread*");
352352

353-
public final long objectMonitorAnonymousOwner = getConstant("ObjectMonitor::ANONYMOUS_OWNER", Long.class, 1L, JDK >= 22 && JDK_BUILD >= 18);
353+
public final long objectMonitorAnonymousOwner = getConstant("ObjectMonitor::ANONYMOUS_OWNER", Long.class, 1L, JDK >= 22);
354354

355355
public final int markWordNoHashInPlace = getConstant("markWord::no_hash_in_place", Integer.class);
356356
public final int markWordNoLockInPlace = getConstant("markWord::no_lock_in_place", Integer.class);
@@ -598,9 +598,9 @@ private long getZGCAddressField(String name) {
598598
// Tracking of the number of monitors held by the current thread. This is used by loom but in
599599
// JDK 20 was enabled by default to ensure it was correctly implemented.
600600
public final int threadHeldMonitorCountOffset = getFieldOffset("JavaThread::_held_monitor_count", Integer.class, JDK >= 22 ? "intx" : "int64_t");
601-
public final int threadLockStackOffset = getFieldOffset("JavaThread::_lock_stack", Integer.class, "LockStack", -1, JDK >= 22 && JDK_BUILD >= 18);
602-
public final int lockStackTopOffset = getFieldOffset("LockStack::_top", Integer.class, "uint32_t", -1, JDK >= 22 && JDK_BUILD >= 18);
603-
public final int lockStackEndOffset = getConstant("LockStack::_end_offset", Integer.class, -1, JDK >= 22 && JDK_BUILD >= 18);
601+
public final int threadLockStackOffset = getFieldOffset("JavaThread::_lock_stack", Integer.class, "LockStack", -1, JDK >= 22);
602+
public final int lockStackTopOffset = getFieldOffset("LockStack::_top", Integer.class, "uint32_t", -1, JDK >= 22);
603+
public final int lockStackEndOffset = getConstant("LockStack::_end_offset", Integer.class, -1, JDK >= 22);
604604

605605
public final long throwAndPostJvmtiExceptionAddress = getAddress("JVMCIRuntime::throw_and_post_jvmti_exception");
606606
public final long throwKlassExternalNameExceptionAddress = getAddress("JVMCIRuntime::throw_klass_external_name_exception");

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
import java.util.stream.Collectors;
3838

3939
import jdk.graal.compiler.debug.Assertions;
40-
4140
import jdk.vm.ci.common.JVMCIError;
4241
import jdk.vm.ci.hotspot.HotSpotVMConfigAccess;
4342
import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
@@ -114,7 +113,6 @@ public static boolean jvmciGE(JVMCIVersionCheck.Version v) {
114113
}
115114

116115
public static final int JDK = Runtime.version().feature();
117-
public static final int JDK_BUILD = Runtime.version().build().orElse(0);
118116
public static final JVMCIVersionCheck.Version JVMCI_VERSION;
119117
public static final boolean JVMCI;
120118
public static final boolean JDK_PRERELEASE;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ public final class JVMCIVersionCheck {
5353
*/
5454
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
5555
"21", Map.of(DEFAULT_VENDOR_ENTRY, new Version(23, 1, 26)),
56-
"22", Map.of(
57-
"Oracle Corporation", new Version("22+27", 1),
58-
DEFAULT_VENDOR_ENTRY, new Version("22+27", 1)));
56+
"23", Map.of(
57+
"Oracle Corporation", new Version("23+1", 1),
58+
DEFAULT_VENDOR_ENTRY, new Version("23+1", 1)));
5959
private static final int NA = 0;
6060
/**
6161
* Minimum Java release supported by Graal.

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/replacements/classfile/Classfile.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class Classfile {
4949
private final List<ClassfileBytecode> codeAttributes;
5050

5151
private static final int MAJOR_VERSION_JAVA_MIN = 51; // JDK7
52-
private static final int MAJOR_VERSION_JAVA_MAX = 66; // JDK22
52+
private static final int MAJOR_VERSION_JAVA_MAX = 67; // JDK23
5353
private static final int MAGIC = 0xCAFEBABE;
5454

5555
/**

substratevm/mx.substratevm/mx_substratevm.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,12 +1910,17 @@ def compute_graal_compiler_flags_map(self):
19101910
required_exports = mx_javamodules.requiredExports(distributions_transitive, get_jdk())
19111911
exports_flags = mx_sdk_vm.AbstractNativeImageConfig.get_add_exports_list(required_exports)
19121912

1913-
graal_compiler_flags_map['21'] = exports_flags
1914-
# Currently JDK 22 has the same flags
1915-
graal_compiler_flags_map['22'] = graal_compiler_flags_map['21']
1913+
min_version = 21
1914+
graal_compiler_flags_map[str(min_version)] = exports_flags
1915+
1916+
feature_version = get_jdk().javaCompliance.value
1917+
if str(feature_version) not in graal_compiler_flags_map and feature_version > min_version:
1918+
# Unless specified otherwise, newer JDK versions use the same flags as JDK 21
1919+
graal_compiler_flags_map[str(feature_version)] = graal_compiler_flags_map[str(min_version)]
1920+
19161921
# DO NOT ADD ANY NEW ADD-OPENS OR ADD-EXPORTS HERE!
19171922
#
1918-
# Instead provide the correct requiresConcealed entries in the moduleInfo
1923+
# Instead, provide the correct requiresConcealed entries in the moduleInfo
19191924
# section of org.graalvm.nativeimage.builder in the substratevm suite.py.
19201925

19211926
graal_compiler_flags_base = [

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jni/functions/JNIFunctions.java

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
import com.oracle.svm.core.jni.headers.JNIObjectRefType;
103103
import com.oracle.svm.core.jni.headers.JNIValue;
104104
import com.oracle.svm.core.jni.headers.JNIVersion;
105-
import com.oracle.svm.core.jni.headers.JNIVersionJDK22OrLater;
105+
import com.oracle.svm.core.jni.headers.JNIVersionJDKLatest;
106106
import com.oracle.svm.core.log.Log;
107107
import com.oracle.svm.core.monitor.MonitorInflationCause;
108108
import com.oracle.svm.core.monitor.MonitorSupport;
@@ -158,13 +158,10 @@ public final class JNIFunctions {
158158
@CEntryPointOptions(prologue = CEntryPointOptions.NoPrologue.class, epilogue = CEntryPointOptions.NoEpilogue.class)
159159
@Uninterruptible(reason = "No need to enter the isolate and also no way to report errors if unable to.")
160160
static int GetVersion(JNIEnvironment env) {
161-
switch (JavaVersionUtil.JAVA_SPEC) {
162-
case 21:
163-
return JNIVersion.JNI_VERSION_21();
164-
case 22:
165-
return JNIVersionJDK22OrLater.JNI_VERSION_22();
166-
default:
167-
throw VMError.shouldNotReachHere("Unsupported Java version " + JavaVersionUtil.JAVA_SPEC);
161+
if (JavaVersionUtil.JAVA_SPEC == 21) {
162+
return JNIVersion.JNI_VERSION_21();
163+
} else {
164+
return JNIVersionJDKLatest.JNI_VERSION_LATEST();
168165
}
169166
}
170167

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/jni/headers/JNIVersion.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@
2424
*/
2525
package com.oracle.svm.core.jni.headers;
2626

27-
import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
2827
import org.graalvm.nativeimage.c.CContext;
2928
import org.graalvm.nativeimage.c.constant.CConstant;
3029

3130
import com.oracle.svm.core.Uninterruptible;
3231

32+
import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
33+
3334
@CContext(JNIHeaderDirectives.class)
3435
public final class JNIVersion {
3536
@Uninterruptible(reason = "Called from uninterruptible code.", mayBeInlined = true)
3637
public static boolean isSupported(int version) {
37-
return (JavaVersionUtil.JAVA_SPEC >= 22 && version == JNIVersionJDK22OrLater.JNI_VERSION_22()) ||
38+
return (JavaVersionUtil.JAVA_SPEC >= 22 && version == JNIVersionJDKLatest.JNI_VERSION_LATEST()) ||
3839
version == JNI_VERSION_21() ||
3940
version == JNI_VERSION_20() ||
4041
version == JNI_VERSION_19() ||
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,11 @@
2424
*/
2525
package com.oracle.svm.core.jni.headers;
2626

27-
import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
2827
import org.graalvm.nativeimage.c.CContext;
2928
import org.graalvm.nativeimage.c.constant.CConstant;
3029

30+
import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
31+
3132
final class JNIHeaderDirectivesJDK22OrLater extends JNIHeaderDirectives {
3233
@Override
3334
public boolean isInConfiguration() {
@@ -36,19 +37,19 @@ public boolean isInConfiguration() {
3637
}
3738

3839
@CContext(JNIHeaderDirectivesJDK22OrLater.class)
39-
public final class JNIVersionJDK22OrLater {
40+
public final class JNIVersionJDKLatest {
4041

4142
// Checkstyle: stop
4243

4344
/*
44-
* GR-48572: there is not yet a JNI_VERSION_22 constant defined. As soon as it gets available,
45-
* the "value" property of the CConstant annotation below must be removed.
45+
* GR-50948: there is not yet a JNI_VERSION_XX constant defined for JDK latest. As soon as it
46+
* gets available, the "value" property of the CConstant annotation below must be removed.
4647
*/
4748
@CConstant(value = "JNI_VERSION_21")
48-
public static native int JNI_VERSION_22();
49+
public static native int JNI_VERSION_LATEST();
4950

5051
// Checkstyle: resume
5152

52-
private JNIVersionJDK22OrLater() {
53+
private JNIVersionJDKLatest() {
5354
}
5455
}

0 commit comments

Comments
 (0)