Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/common.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ local common_json = import "../common.json";
} + {
[name]: common_json.jdks[name] + { jdk_version:: 21 }
for name in ["oraclejdk21"] + variants("labsjdk-ce-21") + variants("labsjdk-ee-21")
} + {
[name]: common_json.jdks[name] + { jdk_version:: 22 }
for name in ["oraclejdk22"]
},
assert std.assertEqual(std.objectFields(common_json.jdks), std.objectFields(jdks_data)),

Expand Down Expand Up @@ -58,6 +61,7 @@ local common_json = import "../common.json";
"windows-jdk19": { packages+: { "devkit:VS2022-17.1.0+1": "==0" }},
"windows-jdk20": { packages+: { "devkit:VS2022-17.1.0+1": "==0" }},
"windows-jdk21": { packages+: { "devkit:VS2022-17.1.0+1": "==1" }},
"windows-jdk22": { packages+: { "devkit:VS2022-17.1.0+1": "==1" }},
"linux-jdk17": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }},
"linux-jdk19": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }},
"linux-jdk20": { packages+: { "devkit:gcc11.2.0-OL6.4+1": "==0" }},
Expand Down
3 changes: 2 additions & 1 deletion common.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@
"labsjdk-ce-21-llvm": {"name": "labsjdk", "version": "ce-21+27-jvmci-23.1-b08-sulong", "platformspecific": true },
"labsjdk-ee-21": {"name": "labsjdk", "version": "ee-21+27-jvmci-23.1-b08", "platformspecific": true },
"labsjdk-ee-21Debug": {"name": "labsjdk", "version": "ee-21+27-jvmci-23.1-b08-debug", "platformspecific": true },
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+27-jvmci-23.1-b08-sulong", "platformspecific": true }
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21+27-jvmci-23.1-b08-sulong", "platformspecific": true },

"oraclejdk22": {"name": "jpg-jdk", "version": "22", "build_id": "1", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]}
},

"eclipse": {
Expand Down
2 changes: 1 addition & 1 deletion compiler/mx.compiler/mx_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ def java_base_unittest(args):
# Remove GRAAL_MANAGEMENT from the module path as it
# depends on the java.management module which is not in
# the limited module set
base_modules = ['java.base', 'java.logging', 'jdk.internal.vm.ci', 'jdk.unsupported', 'jdk.compiler']
base_modules = ['java.base', 'java.logging', 'jdk.internal.vm.ci', 'jdk.unsupported', 'jdk.compiler', 'java.instrument']
compiler_modules = [as_java_module(d, jdk).name for d in _graal_config().dists if d.name != 'GRAAL_MANAGEMENT']
root_module_names = base_modules + compiler_modules
extra_args = ['--limit-modules=' + ','.join(root_module_names)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class Classfile {
private final List<ClassfileBytecode> codeAttributes;

private static final int MAJOR_VERSION_JAVA_MIN = 51; // JDK7
private static final int MAJOR_VERSION_JAVA_MAX = 65; // JDK21
private static final int MAJOR_VERSION_JAVA_MAX = 66; // JDK22
private static final int MAGIC = 0xCAFEBABE;

/**
Expand Down
3 changes: 2 additions & 1 deletion substratevm/mx.substratevm/mx_substratevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1719,8 +1719,9 @@ def compute_graal_compiler_flags_map(self):
graal_compiler_flags_map['19-ea'] = graal_compiler_flags_map['19']
# Currently JDK 20 and JDK 19 have the same flags
graal_compiler_flags_map['20'] = graal_compiler_flags_map['19']
# Currently JDK 21 and JDK 20 have the same flags
# Currently JDK 22, JDK 21 and JDK 20 have the same flags
graal_compiler_flags_map['21'] = graal_compiler_flags_map['20']
graal_compiler_flags_map['22'] = graal_compiler_flags_map['21']
# DO NOT ADD ANY NEW ADD-OPENS OR ADD-EXPORTS HERE!
#
# Instead provide the correct requiresConcealed entries in the moduleInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.core.jdk;

import java.util.function.BooleanSupplier;

import org.graalvm.compiler.serviceprovider.JavaVersionUtil;

public class JDK21OrEarlier implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return JavaVersionUtil.JAVA_SPEC <= 21;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package com.oracle.svm.core.jdk;

import java.util.function.BooleanSupplier;

import org.graalvm.compiler.serviceprovider.JavaVersionUtil;

public class JDK22OrLater implements BooleanSupplier {
@Override
public boolean getAsBoolean() {
return JavaVersionUtil.JAVA_SPEC >= 22;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import java.util.Objects;
import java.util.concurrent.ThreadFactory;

import com.oracle.svm.core.jdk.JDK21OrEarlier;
import org.graalvm.compiler.api.directives.GraalDirectives;
import org.graalvm.compiler.replacements.ReplacementsUtil;
import org.graalvm.compiler.serviceprovider.JavaVersionUtil;
Expand Down Expand Up @@ -95,14 +96,16 @@ public final class Target_java_lang_Thread {
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
volatile boolean interrupted;

@Inject @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
@Inject //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
long parentThreadId;

@Inject //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
public boolean jfrExcluded;

@Inject @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.NewInstance, declClass = ThreadData.class)//
@Inject //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.NewInstance, declClass = ThreadData.class)//
UnacquiredThreadData threadData;

@Alias//
Expand All @@ -111,19 +114,23 @@ public final class Target_java_lang_Thread {
@Alias//
volatile String name;

@Alias @TargetElement(onlyWith = JDK17OrEarlier.class)//
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class)//
int priority;

/* Whether or not the thread is a daemon . */
@Alias @TargetElement(onlyWith = JDK17OrEarlier.class)//
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class)//
boolean daemon;

/* What will be run. */
@Alias @TargetElement(onlyWith = JDK17OrEarlier.class)//
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class)//
Runnable target;

/* The group of this thread */
@Alias @TargetElement(onlyWith = JDK17OrEarlier.class)//
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class)//
ThreadGroup group;

@Alias//
Expand All @@ -136,18 +143,22 @@ public final class Target_java_lang_Thread {
* The requested stack size for this thread, or 0 if the creator did not specify a stack size.
* It is up to the VM to do whatever it likes with this number; some VMs will ignore it.
*/
@Alias @TargetElement(onlyWith = JDK17OrEarlier.class)//
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class)//
long stackSize;

@Alias @TargetElement(onlyWith = JDK19OrLater.class)//
@Alias //
@TargetElement(onlyWith = JDK19OrLater.class)//
Target_java_lang_Thread_FieldHolder holder;

/* Thread ID */
@Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Custom, declClass = ThreadIdRecomputation.class) //
@Alias //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Custom, declClass = ThreadIdRecomputation.class) //
public long tid;

/** We have our own atomic number in {@link JavaThreads#threadSeqNumber}. */
@Delete @TargetElement(onlyWith = JDK17OrEarlier.class)//
@Delete //
@TargetElement(onlyWith = JDK17OrEarlier.class)//
static long threadSeqNumber;
/** We have our own atomic number in {@link JavaThreads#threadInitNumber}. */
@Delete//
Expand All @@ -158,34 +169,43 @@ public final class Target_java_lang_Thread {
* For unstarted threads created during image generation like the main thread, we do not want to
* inherit a (more or less random) access control context.
*/
@Alias @RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
@Alias //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
public AccessControlContext inheritedAccessControlContext;

@Alias @TargetElement(onlyWith = JDK17OrEarlier.class) //
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class) //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Custom, declClass = ThreadStatusRecomputation.class) //
volatile int threadStatus;

@Alias @TargetElement(onlyWith = JDK17OrEarlier.class) //
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class) //
Object blockerLock;
@Alias @TargetElement(onlyWith = JDK19OrLater.class) //
@Alias //
@TargetElement(onlyWith = JDK19OrLater.class) //
Object interruptLock;

@Alias @TargetElement(onlyWith = JDK17OrEarlier.class) //
@Alias //
@TargetElement(onlyWith = JDK17OrEarlier.class) //
volatile Target_sun_nio_ch_Interruptible blocker;

@Alias @TargetElement(onlyWith = JDK19OrLater.class) //
@Alias //
@TargetElement(onlyWith = JDK19OrLater.class) //
volatile Target_sun_nio_ch_Interruptible nioBlocker;

/** @see JavaThreads#setCurrentThreadLockHelper */
@Inject @TargetElement(onlyWith = ContinuationsSupported.class) //
@Inject //
@TargetElement(onlyWith = ContinuationsSupported.class) //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
Object lockHelper;

@Inject @TargetElement(onlyWith = JDK19OrLater.class) //
@Inject //
@TargetElement(onlyWith = JDK19OrLater.class) //
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset) //
Object[] scopedValueCache;

@Alias @TargetElement(onlyWith = JDK20OrLater.class) //
@Alias //
@TargetElement(onlyWith = JDK20OrLater.class) //
Object scopedValueBindings;

@Alias
Expand Down Expand Up @@ -305,7 +325,8 @@ static Thread currentCarrierThread() {
}

/** On HotSpot, a field in C++ class {@code JavaThread}. Loads and stores are unordered. */
@Inject @TargetElement(onlyWith = ContinuationsSupported.class)//
@Inject //
@TargetElement(onlyWith = ContinuationsSupported.class)//
@RecomputeFieldValue(kind = RecomputeFieldValue.Kind.Reset)//
Thread vthread = null;

Expand Down Expand Up @@ -505,6 +526,7 @@ private void resume0() {
}

@Substitute
@TargetElement(onlyWith = JDK21OrEarlier.class)
@SuppressWarnings({"static-method"})
private int countStackFrames() {
throw VMError.unsupportedFeature("The deprecated method Thread.countStackFrames is not supported");
Expand Down Expand Up @@ -632,12 +654,13 @@ private static void clearInterruptEvent() {
@TargetElement(onlyWith = JDK19OrLater.class)
native void setInterrupt();

@Alias
@Alias //
@TargetElement(onlyWith = JDK19OrLater.class)
native void clearInterrupt();

/** Carrier threads only: the current innermost continuation. */
@Alias @TargetElement(onlyWith = LoomJDK.class) //
@Alias //
@TargetElement(onlyWith = LoomJDK.class) //
Target_jdk_internal_vm_Continuation cont;

@Alias
Expand Down Expand Up @@ -788,7 +811,8 @@ interface Target_java_lang_Thread_Builder {
@TargetClass(value = Thread.class, innerClass = "Constants", onlyWith = JDK19OrLater.class)
final class Target_java_lang_Thread_Constants {
// Checkstyle: stop
@SuppressWarnings("removal") @Alias static AccessControlContext NO_PERMISSIONS_ACC;
@SuppressWarnings("removal") //
@Alias static AccessControlContext NO_PERMISSIONS_ACC;

@Alias //
@TargetElement(onlyWith = JDK20OrEarlier.class) //
Expand Down
31 changes: 28 additions & 3 deletions vm/ci/ci_common/libgraal.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ local utils = import '../../../ci/ci_common/common-utils.libsonnet';
"gate-vm-libgraal_compiler_zgc-labsjdk-21-linux-amd64": {},
"gate-vm-libgraal_compiler_quickbuild-labsjdk-21-linux-amd64": {},
"gate-vm-libgraal_truffle_quickbuild-labsjdk-21-linux-amd64": t("1:10:00"),
"gate-vm-libgraal_compiler-oraclejdk-22-linux-amd64": {},
},

# See definition of `dailies` local variable in ../../compiler/ci_common/gate.jsonnet
Expand Down Expand Up @@ -115,6 +116,7 @@ local utils = import '../../../ci/ci_common/common-utils.libsonnet';
vm["custom_vm_" + os(os_arch)] +
g.make_build(jdk, os_arch, task, extra_tasks=self, suite="vm",
include_common_os_arch=false,
jdk_name = if jdk == "22" then "oraclejdk" else "labsjdk",
gates_manifest=gates,
dailies_manifest=dailies,
weeklies_manifest=weeklies,
Expand All @@ -133,6 +135,28 @@ local utils = import '../../../ci/ci_common/common-utils.libsonnet';
]
],

# Builds run on OracleJDK22
local oraclejdk22_builds = [
c["gate_vm_" + underscore(os_arch)] +
svm_common(os_arch, jdk) +
vm["custom_vm_" + os(os_arch)] +
g.make_build(jdk, os_arch, task, extra_tasks=self, suite="vm",
include_common_os_arch=false,
jdk_name="oraclejdk",
gates_manifest=gates,
dailies_manifest=dailies,
weeklies_manifest=weeklies,
monthlies_manifest=monthlies).build +
vm["vm_java_" + jdk]
for jdk in [
"22"
]
for os_arch in ["linux-amd64"]
for task in [
"libgraal_compiler",
]
],

local adjust_windows_version(gate) = (
# replace 2016 with 2019
gate + { capabilities: [ if x == "windows_server_2016" then "windows_server_2019" else x for x in gate.capabilities ] }
Expand Down Expand Up @@ -161,8 +185,8 @@ local utils = import '../../../ci/ci_common/common-utils.libsonnet';
]
],

# Builds run on only on linux-amd64-jdk21
local linux_amd64_jdk21_builds = [
# Coverage builds only on jdk21
local coverage_jdk21_builds = [
c["gate_vm_" + underscore(os_arch)] +
svm_common(os_arch, jdk) +
vm["custom_vm_" + os(os_arch)] +
Expand All @@ -189,8 +213,9 @@ local utils = import '../../../ci/ci_common/common-utils.libsonnet';
# Complete set of builds defined in this file
local all_builds =
all_platforms_builds +
oraclejdk22_builds +
all_platforms_zgc_builds +
linux_amd64_jdk21_builds,
coverage_jdk21_builds,

builds: if
g.check_manifest(gates, all_builds, std.thisFile, "gates").result
Expand Down
1 change: 1 addition & 0 deletions vm/ci/ci_includes/vm.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ local graal_common = import '../../../ci/ci_common/common.jsonnet';
vm_java_17:: graal_common.labsjdk17 + vm_common.vm_env_mixin('17'),
vm_java_20:: graal_common.labsjdk20 + vm_common.vm_env_mixin('20'),
vm_java_21:: graal_common.labsjdk21 + vm_common.vm_env_mixin('21'),
vm_java_22:: graal_common.oraclejdk22 + vm_common.vm_env_mixin('22'),

vm_java_17_llvm:: self.vm_java_17 + graal_common['labsjdk-ce-17-llvm'],
vm_java_20_llvm:: self.vm_java_20 + graal_common['labsjdk-ce-20-llvm'],
Expand Down