Skip to content

Commit 8647014

Browse files
committed
Merge tag 'jdk-25.0.2' into mandrel/25.0
2 parents fe50bbd + 981ecb6 commit 8647014

File tree

110 files changed

+3165
-4652
lines changed

Some content is hidden

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

110 files changed

+3165
-4652
lines changed

common.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,13 @@
4545

4646
"oraclejdk24": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24.0.1+9", "platformspecific": true, "extrabundles": ["static-libs"]},
4747

48-
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25.0.1+8", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.1+8-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.1+8-jvmci-b01-sulong", "platformspecific": true }
48+
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25.0.2+10", "platformspecific": true, "extrabundles": ["static-libs"]},
49+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25.0.2+10-jvmci-b01", "platformspecific": true },
50+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25.0.2+10-jvmci-b01-debug", "platformspecific": true },
51+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25.0.2+10-jvmci-b01-sulong", "platformspecific": true },
52+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25.0.2+10-jvmci-b01", "platformspecific": true },
53+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25.0.2+10-jvmci-b01-debug", "platformspecific": true },
54+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25.0.2+10-jvmci-b01-sulong", "platformspecific": true }
5555
},
5656

5757
"eclipse": {

compiler/mx.compiler/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
"groupId" : "org.graalvm.compiler",
77
"version" : "25.0.2.0",
8-
"release" : False,
8+
"release" : True,
99
"url" : "http://www.graalvm.org/",
1010
"developer" : {
1111
"name" : "GraalVM Development",

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

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,58 @@ public void test300() {
5656
public void testMinus300() {
5757
test("boxSnippet", -300);
5858
}
59+
60+
public static Object boxInt(int arg) {
61+
return arg;
62+
}
63+
64+
public static Object boxLong(long arg) {
65+
return arg;
66+
}
67+
68+
public static Object boxByte(byte arg) {
69+
return arg;
70+
}
71+
72+
public static Object boxChar(char arg) {
73+
return arg;
74+
}
75+
76+
public static Object boxBoolean(boolean arg) {
77+
return arg;
78+
}
79+
80+
public static Object boxShort(short arg) {
81+
return arg;
82+
}
83+
84+
@Test
85+
public void boxInt0() {
86+
test("boxInt", 0);
87+
}
88+
89+
@Test
90+
public void boxByte0() {
91+
test("boxByte", (byte) 0);
92+
}
93+
94+
@Test
95+
public void boxLong0() {
96+
test("boxLong", (long) 0);
97+
}
98+
99+
@Test
100+
public void boxChar0() {
101+
test("boxChar", (char) 0);
102+
}
103+
104+
@Test
105+
public void boxBoolean0() {
106+
test("boxBoolean", false);
107+
}
108+
109+
@Test
110+
public void boxShort0() {
111+
test("boxShort", (short) 0);
112+
}
59113
}

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/hotspot/test/HotSpotCompressedKlassPointerTest.java

Lines changed: 0 additions & 95 deletions
This file was deleted.
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/*
2+
* Copyright (c) 2025, 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 java.io.IOException;
28+
import java.util.LinkedList;
29+
import java.util.Map;
30+
import java.util.concurrent.ConcurrentHashMap;
31+
import java.util.concurrent.CountDownLatch;
32+
import java.util.concurrent.TimeUnit;
33+
import java.util.concurrent.atomic.AtomicInteger;
34+
import java.util.regex.Matcher;
35+
import java.util.regex.Pattern;
36+
37+
import org.graalvm.polyglot.Context;
38+
import org.graalvm.polyglot.Source;
39+
import org.junit.Assert;
40+
import org.junit.Assume;
41+
import org.junit.Test;
42+
43+
import com.oracle.truffle.api.Truffle;
44+
import com.oracle.truffle.api.instrumentation.test.InstrumentationTestLanguage;
45+
import com.oracle.truffle.api.source.SourceSection;
46+
import com.oracle.truffle.api.test.SubprocessTestUtils;
47+
import com.oracle.truffle.compiler.TruffleCompilerListener;
48+
import com.oracle.truffle.runtime.AbstractCompilationTask;
49+
import com.oracle.truffle.runtime.FixedPointMath;
50+
import com.oracle.truffle.runtime.OptimizedCallTarget;
51+
import com.oracle.truffle.runtime.OptimizedTruffleRuntime;
52+
import com.oracle.truffle.runtime.OptimizedTruffleRuntimeListener;
53+
54+
public class DynamicCompilationThresholdsTest {
55+
private static final Pattern TARGET_NAME_PATTERN = Pattern.compile("DynamicCompilationThresholdsTest(\\d+)");
56+
static AtomicInteger ID = new AtomicInteger();
57+
58+
@SuppressWarnings("unused")
59+
static class SourceCompilation {
60+
private final int id;
61+
private final Source source;
62+
private final CountDownLatch compilationDoneLatch = new CountDownLatch(1);
63+
private final CountDownLatch compilationStartedLatch = new CountDownLatch(1);
64+
private final CountDownLatch compilationGoLatch = new CountDownLatch(1);
65+
66+
SourceCompilation(int id, Source source) {
67+
this.id = id;
68+
this.source = source;
69+
}
70+
}
71+
72+
Map<Integer, SourceCompilation> compilationMap = new ConcurrentHashMap<>();
73+
74+
@Test
75+
public void testDynamicCompilationThreshods() throws IOException, InterruptedException {
76+
Assume.assumeTrue(Truffle.getRuntime() instanceof OptimizedTruffleRuntime);
77+
Runnable test = () -> {
78+
OptimizedTruffleRuntime optimizedTruffleRuntime = (OptimizedTruffleRuntime) Truffle.getRuntime();
79+
OptimizedTruffleRuntimeListener listener = new OptimizedTruffleRuntimeListener() {
80+
@Override
81+
public void onCompilationSuccess(OptimizedCallTarget target, AbstractCompilationTask task, TruffleCompilerListener.GraphInfo graph,
82+
TruffleCompilerListener.CompilationResultInfo result) {
83+
if (getSourceCompilation(target) instanceof SourceCompilation compilation) {
84+
compilation.compilationDoneLatch.countDown();
85+
}
86+
}
87+
88+
private SourceCompilation getSourceCompilation(OptimizedCallTarget target) {
89+
if (target.getRootNode().getSourceSection() instanceof SourceSection section && section.getSource() != null) {
90+
Matcher matcher = TARGET_NAME_PATTERN.matcher(section.getSource().getName());
91+
if (matcher.find()) {
92+
return compilationMap.get(Integer.parseInt(matcher.group(1)));
93+
}
94+
}
95+
return null;
96+
}
97+
98+
@Override
99+
public void onCompilationStarted(OptimizedCallTarget target, AbstractCompilationTask task) {
100+
if (getSourceCompilation(target) instanceof SourceCompilation compilation) {
101+
compilation.compilationStartedLatch.countDown();
102+
try {
103+
compilation.compilationGoLatch.await();
104+
} catch (InterruptedException ie) {
105+
throw new AssertionError(ie);
106+
}
107+
}
108+
}
109+
};
110+
optimizedTruffleRuntime.addListener(listener);
111+
try (Context context = Context.newBuilder().allowExperimentalOptions(true) //
112+
.option("engine.BackgroundCompilation", "true") //
113+
.option("engine.CompileImmediately", "false") //
114+
.option("engine.SingleTierCompilationThreshold", "1") //
115+
.option("engine.MultiTier", "false") //
116+
.option("engine.DynamicCompilationThresholds", "true") //
117+
.option("engine.DynamicCompilationThresholdsMaxNormalLoad", "20") //
118+
.option("engine.DynamicCompilationThresholdsMinNormalLoad", "10") //
119+
.option("engine.DynamicCompilationThresholdsMinScale", "0.1") //
120+
.option("engine.CompilerThreads", "1").build()) {
121+
int firstCompilation = submitCompilation(context);
122+
waitForCompilationStart(firstCompilation);
123+
LinkedList<Integer> scales = new LinkedList<>();
124+
int firstScale = FixedPointMath.toFixedPoint(0.1);
125+
Assert.assertEquals(firstScale, optimizedTruffleRuntime.compilationThresholdScale());
126+
scales.push(firstScale);
127+
for (int i = 1; i <= 10; i++) {
128+
submitCompilation(context);
129+
int scale = FixedPointMath.toFixedPoint(0.1 + 0.9 * i / 10);
130+
Assert.assertEquals(scale, optimizedTruffleRuntime.compilationThresholdScale());
131+
scales.push(scale);
132+
}
133+
for (int i = 1; i <= 10; i++) {
134+
submitCompilation(context);
135+
int scale = FixedPointMath.toFixedPoint(1.0);
136+
Assert.assertEquals(scale, optimizedTruffleRuntime.compilationThresholdScale());
137+
scales.push(scale);
138+
}
139+
for (int i = 1; i <= 10; i++) {
140+
submitCompilation(context);
141+
int scale = FixedPointMath.toFixedPoint(1.0 + 0.9 * i / 10);
142+
Assert.assertEquals(scale, optimizedTruffleRuntime.compilationThresholdScale());
143+
scales.push(scale);
144+
}
145+
allowCompilationToProceed(firstCompilation);
146+
waitForCompilationDone(firstCompilation);
147+
scales.pop();
148+
for (int i = firstCompilation + 1; i <= 30; i++) {
149+
waitForCompilationStart(i);
150+
Assert.assertEquals((int) scales.pop(), optimizedTruffleRuntime.compilationThresholdScale());
151+
allowCompilationToProceed(i);
152+
waitForCompilationDone(i);
153+
}
154+
Assert.assertTrue(scales.isEmpty());
155+
} catch (IOException | InterruptedException e) {
156+
throw new AssertionError(e);
157+
} finally {
158+
optimizedTruffleRuntime.removeListener(listener);
159+
}
160+
};
161+
SubprocessTestUtils.newBuilder(DynamicCompilationThresholdsTest.class, test).run();
162+
}
163+
164+
private void allowCompilationToProceed(int id) {
165+
compilationMap.get(id).compilationGoLatch.countDown();
166+
}
167+
168+
private void waitForCompilationStart(int id) throws InterruptedException {
169+
if (!compilationMap.get(id).compilationStartedLatch.await(5, TimeUnit.MINUTES)) {
170+
throw new AssertionError("Compilation of source " + id + " did not start in time");
171+
}
172+
}
173+
174+
private void waitForCompilationDone(int id) throws InterruptedException {
175+
if (!compilationMap.get(id).compilationDoneLatch.await(5, TimeUnit.MINUTES)) {
176+
throw new AssertionError("Compilation of source " + id + " did not finish in time");
177+
}
178+
}
179+
180+
int submitCompilation(Context context) throws IOException {
181+
int id = ID.getAndIncrement();
182+
Source source = Source.newBuilder(InstrumentationTestLanguage.ID, "CONSTANT(" + id + ")", "DynamicCompilationThresholdsTest" + id).build();
183+
SourceCompilation compilation = new SourceCompilation(id, source);
184+
compilationMap.put(id, compilation);
185+
context.eval(source);
186+
return id;
187+
}
188+
}

0 commit comments

Comments
 (0)