Skip to content

Commit 94b2b1b

Browse files
committed
Merge remote-tracking branch 'origin/master' into ds/GR-60088
2 parents f3a994b + 1e902bb commit 94b2b1b

File tree

456 files changed

+19045
-7146
lines changed

Some content is hidden

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

456 files changed

+19045
-7146
lines changed

.github/workflows/micronaut.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
# SOFTWARE.
4040
#
41-
name: Nightly Micronaut Tests
41+
name: Weekly Micronaut Tests
4242

4343
on:
4444
push:
@@ -48,7 +48,7 @@ on:
4848
paths:
4949
- '.github/workflows/micronaut.yml'
5050
schedule:
51-
- cron: '0 2 * * *'
51+
- cron: '0 2 * * 1'
5252
workflow_dispatch:
5353

5454
env:

.github/workflows/quarkus.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2020, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
# SOFTWARE.
4040
#
41-
name: Nightly Quarkus Tests
41+
name: Weekly Quarkus Tests
4242

4343
on:
4444
push:
@@ -48,7 +48,7 @@ on:
4848
paths:
4949
- '.github/workflows/quarkus.yml'
5050
schedule:
51-
- cron: '0 3 * * *'
51+
- cron: '0 3 * * 1'
5252
workflow_dispatch:
5353

5454
env:

.github/workflows/spring.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2024, 2024, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# The Universal Permissive License (UPL), Version 1.0
@@ -38,7 +38,7 @@
3838
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3939
# SOFTWARE.
4040
#
41-
name: Nightly Spring Tests
41+
name: Weekly Spring Tests
4242

4343
on:
4444
push:
@@ -48,7 +48,7 @@ on:
4848
paths:
4949
- '.github/workflows/spring.yml'
5050
schedule:
51-
- cron: '0 4 * * *'
51+
- cron: '0 4 * * 1'
5252
workflow_dispatch:
5353

5454
env:

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

5757
"eclipse": {

compiler/ci/ci_common/benchmark-builders.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +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,
17+
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.barista + PR_bench_libgraal,
1818
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.specjvm2008 + PR_bench_libgraal,
1919
c.on_demand + hw.e3 + jdk + cc.libgraal + bench.dacapo_size_variants,
2020
c.on_demand + hw.e3 + jdk + cc.libgraal + bench.scala_dacapo_size_variants,

compiler/ci/ci_common/benchmark-suites.libsonnet

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,15 @@
117117

118118
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 + {
119119
suite:: suite_name,
120-
local barista_version = "v0.2.0",
120+
local barista_version = "v0.3.0",
121121
local suite_version_args = if suite_version != null then ["--bench-suite-version=" + suite_version] else [],
122122
local prefix_barista_arg = if std.length(cmd_app_prefix) > 0 then [std.format("--cmd-app-prefix=%s", std.join(" ", cmd_app_prefix))] else [],
123123
local all_barista_args = prefix_barista_arg + non_prefix_barista_args,
124124
local barista_args_with_separator = if std.length(all_barista_args) > 0 then ["--"] + all_barista_args else [],
125125
downloads+: {
126126
"WRK": { "name": "wrk", "version": "a211dd5", platformspecific: true},
127127
"WRK2": { "name": "wrk2", "version": "2.1", platformspecific: true},
128-
"BARISTA_BENCHMARKS": { "name": "barista", "version": "0.2.0"}
128+
"BARISTA_BENCHMARKS": { "name": "barista", "version": "0.3.0"}
129129
},
130130
packages+: {
131131
maven: "==3.8.6",
@@ -141,7 +141,7 @@
141141
self.benchmark_cmd + ["barista:*"] + suite_version_args + ["--"] + self.extra_vm_args + barista_args_with_separator
142142
],
143143
notify_emails+: ["andrija.kolic@oracle.com"],
144-
timelimit: "1:20:00",
144+
timelimit: "2:00:00",
145145
should_use_hwloc: false, // hwloc-bind is passed to barista with '--cmd-app-prefix'
146146
environment+: {
147147
BARISTA_HOME: "$BUILD_DIR/barista-suite",
@@ -151,7 +151,7 @@
151151
max_jdk_version:: max_jdk_version,
152152
forks_batches:: 3,
153153
bench_forks_per_batch:: 4,
154-
forks_timelimit:: "3:30:00"
154+
forks_timelimit:: "4:30:00"
155155
},
156156

157157
barista: self.barista_template(),
Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
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.truffle.test;
26+
27+
import static com.oracle.truffle.runtime.OptimizedRuntimeOptions.SingleTierCompilationThreshold;
28+
29+
import java.util.concurrent.CountDownLatch;
30+
import java.util.concurrent.atomic.AtomicBoolean;
31+
import java.util.concurrent.atomic.AtomicReference;
32+
import java.util.function.Supplier;
33+
34+
import org.graalvm.polyglot.Context;
35+
import org.junit.Assert;
36+
import org.junit.Assume;
37+
import org.junit.Test;
38+
39+
import com.oracle.truffle.api.CallTarget;
40+
import com.oracle.truffle.api.CompilerDirectives;
41+
import com.oracle.truffle.api.Truffle;
42+
import com.oracle.truffle.api.dsl.Cached;
43+
import com.oracle.truffle.api.dsl.Specialization;
44+
import com.oracle.truffle.api.frame.VirtualFrame;
45+
import com.oracle.truffle.api.nodes.DirectCallNode;
46+
import com.oracle.truffle.api.nodes.ExecutableNode;
47+
import com.oracle.truffle.api.nodes.Node;
48+
import com.oracle.truffle.api.nodes.RootNode;
49+
import com.oracle.truffle.compiler.TruffleCompilerListener;
50+
import com.oracle.truffle.runtime.AbstractCompilationTask;
51+
import com.oracle.truffle.runtime.OptimizedCallTarget;
52+
import com.oracle.truffle.runtime.OptimizedTruffleRuntime;
53+
import com.oracle.truffle.runtime.OptimizedTruffleRuntimeListener;
54+
55+
/*
56+
* Test that reproduces the not-yet fixed bug GR-42688 and makes sure the issue is alleviated by MaximumCompilations limit.
57+
*/
58+
public class GR42688Test {
59+
60+
@SuppressWarnings("truffle-inlining")
61+
public abstract static class ClassNode extends Node {
62+
63+
public abstract Class<?> execute(Object value);
64+
65+
@SuppressWarnings("unused")
66+
@Specialization
67+
public Class<?> doInt(int n) {
68+
return Integer.class;
69+
}
70+
71+
@SuppressWarnings("unused")
72+
@Specialization
73+
public Class<?> doDouble(double n) {
74+
return Double.class;
75+
}
76+
}
77+
78+
public abstract static class CalleeNode extends ExecutableNode {
79+
protected CalleeNode() {
80+
super(null);
81+
}
82+
83+
@Override
84+
public final Object execute(VirtualFrame frame) {
85+
return execute(frame.getArguments()[0], frame.getArguments()[1]);
86+
}
87+
88+
public abstract Object execute(Object value, Object klass);
89+
90+
// One classNode per specialization instance, intended here and representative of more
91+
// complex nodes which also create new helper node instances for new specialization
92+
// instances
93+
@SuppressWarnings("unused")
94+
@Specialization(guards = "classNode.execute(value) == cachedClass", limit = "4")
95+
public boolean doCached(Object value, Class<?> checkedAgainst,
96+
@Cached ClassNode classNode,
97+
@Cached("classNode.execute(value)") Class<?> cachedClass) {
98+
return cachedClass == checkedAgainst;
99+
}
100+
}
101+
102+
public static class CalleeRoot extends RootNode {
103+
104+
@Child private CalleeNode calleeNode;
105+
private final CountDownLatch compilationStartLatch;
106+
private final CountDownLatch compilationFinishedLatch;
107+
108+
protected CalleeRoot(CountDownLatch compilationStartLatch, CountDownLatch compilationFinishedLatch) {
109+
super(null);
110+
this.compilationStartLatch = compilationStartLatch;
111+
this.compilationFinishedLatch = compilationFinishedLatch;
112+
this.calleeNode = GR42688TestFactory.CalleeNodeGen.create();
113+
}
114+
115+
@Override
116+
public final Object execute(VirtualFrame frame) {
117+
if (CompilerDirectives.inInterpreter()) {
118+
if (frame.getArguments()[0] instanceof Double) {
119+
compilationStartLatch.countDown();
120+
try {
121+
compilationFinishedLatch.await();
122+
} catch (InterruptedException ie) {
123+
throw new AssertionError(ie);
124+
}
125+
}
126+
}
127+
return calleeNode.execute(frame);
128+
}
129+
130+
@Override
131+
public String getName() {
132+
return "callee";
133+
}
134+
135+
@Override
136+
public String toString() {
137+
return getName();
138+
}
139+
}
140+
141+
private static class CallerRoot extends RootNode {
142+
@Child private DirectCallNode callNode;
143+
private final String name;
144+
145+
CallerRoot(CallTarget target, String name) {
146+
super(null);
147+
this.name = name;
148+
this.callNode = Truffle.getRuntime().createDirectCallNode(target);
149+
}
150+
151+
@Override
152+
public Object execute(VirtualFrame frame) {
153+
return callNode.call(frame.getArguments());
154+
}
155+
156+
@Override
157+
public String getName() {
158+
return name;
159+
}
160+
161+
@Override
162+
public String toString() {
163+
return getName();
164+
}
165+
}
166+
167+
@Test
168+
public void testDeoptLoopStoppedByMaximumCompilations() {
169+
Assume.assumeTrue(Truffle.getRuntime() instanceof OptimizedTruffleRuntime);
170+
OptimizedTruffleRuntime optimizedTruffleRuntime = (OptimizedTruffleRuntime) Truffle.getRuntime();
171+
AtomicReference<OptimizedCallTarget> calleeRef = new AtomicReference<>();
172+
AtomicReference<OptimizedCallTarget> callerRef = new AtomicReference<>();
173+
CountDownLatch calleeCompilationStartLatch = new CountDownLatch(1);
174+
CountDownLatch calleeCompilationFinishedLatch = new CountDownLatch(1);
175+
AtomicBoolean intCallerCompilationFailed = new AtomicBoolean();
176+
optimizedTruffleRuntime.addListener(new OptimizedTruffleRuntimeListener() {
177+
@Override
178+
public void onCompilationSuccess(OptimizedCallTarget target, AbstractCompilationTask task, TruffleCompilerListener.GraphInfo graph, TruffleCompilerListener.CompilationResultInfo result) {
179+
if (target == calleeRef.get()) {
180+
calleeCompilationFinishedLatch.countDown();
181+
}
182+
}
183+
184+
@Override
185+
public void onCompilationStarted(OptimizedCallTarget target, AbstractCompilationTask task) {
186+
if (target == calleeRef.get()) {
187+
try {
188+
calleeCompilationStartLatch.await();
189+
} catch (InterruptedException ie) {
190+
throw new AssertionError(ie);
191+
}
192+
}
193+
}
194+
195+
@Override
196+
public void onCompilationFailed(OptimizedCallTarget target, String reason, boolean bailout, boolean permanentBailout, int tier, Supplier<String> lazyStackTrace) {
197+
if (target == callerRef.get() && "Maximum compilation count 100 reached.".equals(reason)) {
198+
intCallerCompilationFailed.set(true);
199+
}
200+
}
201+
});
202+
try (Context context = Context.newBuilder().allowExperimentalOptions(true).option("engine.CompileImmediately", "false").option("engine.BackgroundCompilation", "true").option(
203+
"engine.DynamicCompilationThresholds", "false").option("engine.MultiTier", "false").option("engine.Splitting", "false").option("engine.SingleTierCompilationThreshold",
204+
"10").option("engine.CompilationFailureAction", "Silent").build()) {
205+
context.enter();
206+
OptimizedCallTarget callee = (OptimizedCallTarget) new CalleeRoot(calleeCompilationStartLatch, calleeCompilationFinishedLatch).getCallTarget();
207+
OptimizedCallTarget intCaller = (OptimizedCallTarget) new CallerRoot(callee, "intCaller").getCallTarget();
208+
calleeRef.set(callee);
209+
callerRef.set(intCaller);
210+
211+
final int compilationThreshold = callee.getOptionValue(SingleTierCompilationThreshold);
212+
213+
for (int i = 0; i < compilationThreshold; i++) {
214+
callee.call(42, Integer.class);
215+
}
216+
/*
217+
* The loop above triggers compilation in a separate thread, but using a compilation
218+
* listener, the compilation is delayed until the following call reaches a certain
219+
* point.
220+
*/
221+
callee.call(3.14, Double.class);
222+
Assert.assertTrue(callee.isValid());
223+
/*
224+
* The compiled callee is still valid for integer, because the compilation finished
225+
* before the AST respecialized for double. The respecialization for double made it
226+
* invalid for integer, it would need another specialization round to be valid both for
227+
* integer and double.
228+
*/
229+
callee.call(42, Integer.class);
230+
Assert.assertTrue(callee.isValid());
231+
/*
232+
* The intCaller uses the compiled callee for executions in the interpreter, which is
233+
* valid for integer, but when intCaller is compiled, in inlines the AST for callee,
234+
* which is not valid for integer and calling the compiled callee results in an
235+
* immediate deopt, but the deopt lands outside the callee AST, which means the compiled
236+
* callee is used again without the AST getting a chance to respecialize. Therefore, the
237+
* deopts of the intCaller are repeated until the MaximumRepeatedCompilations limit
238+
* kicks in and marks the intCaller call target as permanent opt fail which means no
239+
* further compilations of it are attempted.
240+
*/
241+
for (int i = 0; i < 1000000000 && !intCallerCompilationFailed.get(); i++) {
242+
intCaller.call(42, Integer.class);
243+
}
244+
Assert.assertTrue(intCallerCompilationFailed.get());
245+
}
246+
}
247+
}

0 commit comments

Comments
 (0)