Skip to content

Commit 6351a81

Browse files
authored
Merge pull request #819 from zakkak/2025-01-21-jan_cpu_2025
[24.1] Sync with upstream for January 2025 CPU
2 parents 1a28d65 + 9280f71 commit 6351a81

File tree

74 files changed

+1642
-402
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+1642
-402
lines changed

common.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
55
],
66

7-
"mx_version": "7.27.5.1",
7+
"mx_version": "7.27.5.3",
88

99
"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
1010
"jdks": {
@@ -45,13 +45,13 @@
4545
"labsjdk-ee-21-llvm": {"name": "labsjdk", "version": "ee-21.0.2+13-jvmci-23.1-b33-sulong", "platformspecific": true },
4646
"graalvm-ee-21": {"name": "graalvm-java21", "version": "23.1.3", "platformspecific": true },
4747

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

5757
"eclipse": {

compiler/ci/ci_common/benchmark-builders.jsonnet

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.dacapo + PR_bench_libgraal,
1515
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.scala_dacapo + PR_bench_libgraal,
1616
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.renaissance + PR_bench_libgraal,
17+
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.barista,
1718
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.specjvm2008 + PR_bench_libgraal,
1819
c.on_demand + hw.e3 + jdk + cc.libgraal + bench.dacapo_size_variants,
1920
c.on_demand + hw.e3 + jdk + cc.libgraal + bench.scala_dacapo_size_variants,

compiler/ci/ci_common/benchmark-suites.libsonnet

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

99
// convenient sets of benchmark suites for easy reuse
1010
groups:: {
11-
open_suites:: unique_suites([$.awfy, $.dacapo, $.scala_dacapo, $.renaissance]),
11+
open_suites:: unique_suites([$.awfy, $.dacapo, $.scala_dacapo, $.renaissance, $.barista]),
1212
spec_suites:: unique_suites([$.specjvm2008, $.specjbb2015]),
1313
jmh_micros_suites:: unique_suites([$.micros_graal_dist]),
1414
graal_internals_suites:: unique_suites([$.micros_graal_whitebox]),
@@ -112,6 +112,47 @@
112112

113113
renaissance: self.renaissance_template(),
114114

115+
barista_template(suite_version=null, suite_name="barista", max_jdk_version=null, cmd_app_prefix=["hwloc-bind --cpubind node:0.core:0-3.pu:0 --membind node:0"], non_prefix_barista_args=[]):: cc.compiler_benchmark + {
116+
suite:: suite_name,
117+
local barista_version = "v0.2.0",
118+
local suite_version_args = if suite_version != null then ["--bench-suite-version=" + suite_version] else [],
119+
local prefix_barista_arg = if std.length(cmd_app_prefix) > 0 then [std.format("--cmd-app-prefix=%s", std.join(" ", cmd_app_prefix))] else [],
120+
local all_barista_args = prefix_barista_arg + non_prefix_barista_args,
121+
local barista_args_with_separator = if std.length(all_barista_args) > 0 then ["--"] + all_barista_args else [],
122+
downloads+: {
123+
"WRK": { "name": "wrk", "version": "a211dd5", platformspecific: true},
124+
"WRK2": { "name": "wrk2", "version": "2.1", platformspecific: true},
125+
"BARISTA_BENCHMARKS": { "name": "barista", "version": "0.2.0"}
126+
},
127+
packages+: {
128+
maven: "==3.8.6",
129+
"pip:toml": "==0.10.2"
130+
},
131+
setup: [
132+
["set-export", "PATH", "$WRK:$PATH"],
133+
["set-export", "PATH", "$WRK2:$PATH"],
134+
["git", "clone", "--depth", "1", "--branch", barista_version, ["mx", "urlrewrite", "https://github.com/graalvm/barista-suite.git"], "$BARISTA_HOME"],
135+
["cp", "-r", "$BARISTA_BENCHMARKS/*", "$BARISTA_HOME"] // copy the prebuilt jar/nib files
136+
] + super.setup,
137+
run+: [
138+
self.benchmark_cmd + ["barista:*"] + suite_version_args + ["--"] + self.extra_vm_args + barista_args_with_separator
139+
],
140+
notify_emails+: ["[email protected]"],
141+
timelimit: "1:20:00",
142+
should_use_hwloc: false, // hwloc-bind is passed to barista with '--cmd-app-prefix'
143+
environment+: {
144+
BARISTA_HOME: "$BUILD_DIR/barista-suite",
145+
XMX: "500m"
146+
},
147+
min_jdk_version:: 8,
148+
max_jdk_version:: max_jdk_version,
149+
forks_batches:: 3,
150+
bench_forks_per_batch:: 4,
151+
forks_timelimit:: "3:30:00"
152+
},
153+
154+
barista: self.barista_template(),
155+
115156
specjbb2015: cc.compiler_benchmark + c.heap.large_with_large_young_gen + bc.bench_max_threads + {
116157
suite:: "specjbb2015",
117158
downloads+: {

compiler/mx.compiler/mx_compiler.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,11 @@ def apply(self, config):
816816
if limited_modules is None or jmd.name in limited_modules:
817817
mainClassArgs.extend(['-JUnitOpenPackages', jmd.name + '/*'])
818818
vmArgs.append('--add-modules=' + jmd.name)
819+
for dependency, packages in jmd.concealedRequires.items():
820+
if dependency != "jdk.internal.vm.ci":
821+
# JVMCI exporting is done dynamically
822+
for p in packages:
823+
vmArgs.append(f'--add-exports={dependency}/{p}={jmd.name}')
819824

820825
vmArgs.append('-Djdk.graal.TrackNodeSourcePosition=true')
821826
vmArgs.append('-esa')

compiler/mx.compiler/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"sourceinprojectwhitelist" : [],
55

66
"groupId" : "org.graalvm.compiler",
7-
"version" : "24.1.1.1",
7+
"version" : "24.1.2.0",
88
"release" : False,
99
"url" : "http://www.graalvm.org/",
1010
"developer" : {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/*
2+
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
package jdk.graal.compiler.core.aarch64.test;
26+
27+
import jdk.graal.compiler.core.test.GraalCompilerTest;
28+
import org.junit.Test;
29+
30+
/**
31+
* Add/sub with an immediate MIN_VALUE may result in infinite recursion since MIN_VALUE < 0 and
32+
* -MIN_VALUE < 0.
33+
*/
34+
public class AddSubInfiniteRecursionTest extends GraalCompilerTest {
35+
public static int testAddIntMinValue(int arg) {
36+
return arg + Integer.MIN_VALUE;
37+
}
38+
39+
public static int testSubIntMinValue(int arg) {
40+
return arg - Integer.MIN_VALUE;
41+
}
42+
43+
@Test
44+
public void runIntMinValue() {
45+
test("testAddIntMinValue", 0);
46+
test("testSubIntMinValue", 0);
47+
}
48+
}

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/LoopSafepointStateVerificationTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
import jdk.graal.compiler.nodes.LoopEndNode;
4343
import jdk.graal.compiler.nodes.PhiNode;
4444
import jdk.graal.compiler.nodes.StructuredGraph;
45+
import jdk.graal.compiler.nodes.LoopBeginNode.SafepointState;
4546
import jdk.graal.compiler.nodes.StructuredGraph.AllowAssumptions;
4647
import jdk.graal.compiler.nodes.loop.LoopEx;
4748
import jdk.graal.compiler.nodes.util.GraphUtil;
@@ -97,8 +98,8 @@ public Optional<NotApplicable> notApplicableTo(GraphState graphState) {
9798
@Override
9899
protected void run(StructuredGraph graph, HighTierContext context) {
99100
for (LoopBeginNode lb : graph.getNodes(LoopBeginNode.TYPE)) {
100-
lb.disableSafepoint();
101-
lb.disableGuestSafepoint();
101+
lb.disableSafepoint(SafepointState.MUST_NEVER_SAFEPOINT);
102+
lb.disableGuestSafepoint(SafepointState.MUST_NEVER_SAFEPOINT);
102103
}
103104
}
104105

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/core/test/deopt/MonitorDeoptTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import jdk.graal.compiler.nodes.FixedWithNextNode;
4040
import jdk.graal.compiler.nodes.LoopBeginNode;
4141
import jdk.graal.compiler.nodes.StructuredGraph;
42+
import jdk.graal.compiler.nodes.LoopBeginNode.SafepointState;
4243
import jdk.graal.compiler.nodes.StructuredGraph.AllowAssumptions;
4344

4445
public final class MonitorDeoptTest extends GraalCompilerTest {
@@ -180,7 +181,7 @@ private static LoopBeginNode findFirstLoop(StructuredGraph graph) {
180181
*/
181182
private static void removeLoopSafepoint(StructuredGraph graph) {
182183
LoopBeginNode loopBegin = findFirstLoop(graph);
183-
loopBegin.disableSafepoint();
184+
loopBegin.disableSafepoint(SafepointState.MUST_NEVER_SAFEPOINT);
184185
}
185186

186187
@Test

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/asm/aarch64/AArch64MacroAssembler.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ public void neg(int size, Register dst, Register src, ShiftType shiftType, int s
10841084
*/
10851085
public void add(int size, Register dst, Register src, int immediate, Register scratch) {
10861086
assert (!dst.equals(zr) && !src.equals(zr)) : dst + " " + src;
1087-
if (immediate < 0) {
1087+
if (-immediate > 0) {
10881088
sub(size, dst, src, -immediate, scratch);
10891089
} else if (NumUtil.isUnsignedNbit(24, immediate) || !dst.equals(src)) {
10901090
add(size, dst, src, immediate);
@@ -1109,7 +1109,7 @@ public void add(int size, Register dst, Register src, int immediate, Register sc
11091109
@Override
11101110
public void add(int size, Register dst, Register src, int immediate) {
11111111
assert (!dst.equals(zr) && !src.equals(zr)) : dst + " " + src;
1112-
if (immediate < 0) {
1112+
if (-immediate > 0) {
11131113
sub(size, dst, src, -immediate);
11141114
} else if (isAddSubtractImmediate(immediate, false)) {
11151115
if (!(dst.equals(src) && immediate == 0)) {
@@ -1156,7 +1156,7 @@ public void add(int size, Register dst, Register src, long immediate) {
11561156
@Override
11571157
public void adds(int size, Register dst, Register src, int immediate) {
11581158
assert (!dst.equals(sp) && !src.equals(zr)) : dst + " " + src;
1159-
if (immediate < 0) {
1159+
if (-immediate > 0) {
11601160
subs(size, dst, src, -immediate);
11611161
} else {
11621162
super.adds(size, dst, src, immediate);
@@ -1176,7 +1176,7 @@ public void adds(int size, Register dst, Register src, int immediate) {
11761176
*/
11771177
public void sub(int size, Register dst, Register src, int immediate, Register scratch) {
11781178
assert (!dst.equals(zr) && !src.equals(zr)) : dst + " " + src;
1179-
if (immediate < 0) {
1179+
if (-immediate > 0) {
11801180
add(size, dst, src, -immediate, scratch);
11811181
}
11821182
if (NumUtil.isUnsignedNbit(24, immediate) || !dst.equals(src)) {
@@ -1202,7 +1202,7 @@ public void sub(int size, Register dst, Register src, int immediate, Register sc
12021202
@Override
12031203
public void sub(int size, Register dst, Register src, int immediate) {
12041204
assert (!dst.equals(zr) && !src.equals(zr)) : dst + " " + src;
1205-
if (immediate < 0) {
1205+
if (-immediate > 0) {
12061206
add(size, dst, src, -immediate);
12071207
} else if (isAddSubtractImmediate(immediate, false)) {
12081208
if (!(dst.equals(src) && immediate == 0)) {
@@ -1229,7 +1229,7 @@ public void sub(int size, Register dst, Register src, int immediate) {
12291229
@Override
12301230
public void subs(int size, Register dst, Register src, int immediate) {
12311231
assert (!dst.equals(sp) && !src.equals(zr)) : dst + " " + src;
1232-
if (immediate < 0) {
1232+
if (-immediate > 0) {
12331233
adds(size, dst, src, -immediate);
12341234
} else {
12351235
super.subs(size, dst, src, immediate);

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

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,9 @@ static class Options {
171171

172172
@Override
173173
public HotSpotGraalCompiler createCompiler(JVMCIRuntime runtime) {
174-
ensureInitialized();
175174
HotSpotJVMCIRuntime hsRuntime = (HotSpotJVMCIRuntime) runtime;
175+
checkUnsafeAccess(hsRuntime);
176+
ensureInitialized();
176177
if (optionsFailure != null) {
177178
System.err.printf("Error parsing Graal options: %s%nError: A fatal exception has occurred. Program will exit.%n", optionsFailure.getMessage());
178179
HotSpotGraalServices.exit(1, hsRuntime);
@@ -197,6 +198,28 @@ public HotSpotGraalCompiler createCompiler(JVMCIRuntime runtime) {
197198
return compiler;
198199
}
199200

201+
/**
202+
* Exit the VM now if {@code jdk.internal.misc.Unsafe} is not accessible.
203+
*/
204+
private void checkUnsafeAccess(HotSpotJVMCIRuntime hsRuntime) {
205+
if (Services.IS_IN_NATIVE_IMAGE) {
206+
// Access checks were performed when building libgraal.
207+
return;
208+
}
209+
try {
210+
jdk.internal.misc.Unsafe.getUnsafe();
211+
} catch (IllegalAccessError e) {
212+
Module module = getClass().getModule();
213+
String targets = module.getName();
214+
String ee = "com.oracle.graal.graal_enterprise";
215+
if (module.getDescriptor().exports().stream().anyMatch(export -> export.targets().contains(ee))) {
216+
targets += "," + ee;
217+
}
218+
System.err.printf("Error: jargraal requires --add-exports=java.base/jdk.internal.misc=%s to be specified to the launcher.%n", targets);
219+
HotSpotGraalServices.exit(1, hsRuntime);
220+
}
221+
}
222+
200223
/**
201224
* Creates a new {@link HotSpotGraalRuntime} object and a new {@link HotSpotGraalCompiler} and
202225
* returns the latter.

0 commit comments

Comments
 (0)