Skip to content

Commit a02f67b

Browse files
committed
Merge tag 'jdk-25.0.1' into mandrel/25.0
2 parents 98f933b + 05ec025 commit a02f67b

File tree

272 files changed

+5993
-2347
lines changed

Some content is hidden

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

272 files changed

+5993
-2347
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+37", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+37-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+37-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+37-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+37-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+37-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+37-jvmci-b01-sulong", "platformspecific": true }
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 }
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.1.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/OptimizeOffsetAddressTest.java

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,20 @@
2727
import org.junit.Assume;
2828
import org.junit.Test;
2929

30-
import jdk.graal.compiler.core.phases.EconomyHighTier;
31-
import jdk.graal.compiler.core.phases.EconomyMidTier;
3230
import jdk.graal.compiler.graph.Graph;
3331
import jdk.graal.compiler.nodes.StructuredGraph;
3432
import jdk.graal.compiler.nodes.calc.AddNode;
33+
import jdk.graal.compiler.phases.common.CanonicalizerPhase;
34+
import jdk.graal.compiler.phases.common.DeoptimizationGroupingPhase;
3535
import jdk.graal.compiler.phases.common.FloatingReadPhase;
36+
import jdk.graal.compiler.phases.common.FrameStateAssignmentPhase;
37+
import jdk.graal.compiler.phases.common.GuardLoweringPhase;
38+
import jdk.graal.compiler.phases.common.HighTierLoweringPhase;
39+
import jdk.graal.compiler.phases.common.LoopSafepointInsertionPhase;
40+
import jdk.graal.compiler.phases.common.MidTierLoweringPhase;
3641
import jdk.graal.compiler.phases.common.OptimizeOffsetAddressPhase;
42+
import jdk.graal.compiler.phases.common.RemoveValueProxyPhase;
43+
import jdk.graal.compiler.phases.common.WriteBarrierAdditionPhase;
3744
import jdk.graal.compiler.phases.tiers.Suites;
3845

3946
/**
@@ -55,9 +62,22 @@ public void testSnippet0() {
5562

5663
StructuredGraph graph = parseEager("snippet0", StructuredGraph.AllowAssumptions.YES);
5764

58-
new EconomyHighTier().apply(graph, getDefaultHighTierContext());
65+
// resembling an economy phase plan with floating reads
66+
67+
CanonicalizerPhase canonicalizer = CanonicalizerPhase.createSingleShot();
68+
canonicalizer.apply(graph, getDefaultHighTierContext());
69+
new HighTierLoweringPhase(canonicalizer, true).apply(graph, getDefaultHighTierContext());
70+
5971
new FloatingReadPhase(createCanonicalizerPhase()).apply(graph, getDefaultMidTierContext());
60-
new EconomyMidTier().apply(graph, getDefaultMidTierContext());
72+
73+
new RemoveValueProxyPhase(canonicalizer).apply(graph, getDefaultMidTierContext());
74+
new LoopSafepointInsertionPhase().apply(graph, getDefaultMidTierContext());
75+
new GuardLoweringPhase().apply(graph, getDefaultMidTierContext());
76+
new MidTierLoweringPhase(canonicalizer).apply(graph, getDefaultMidTierContext());
77+
new FrameStateAssignmentPhase().apply(graph, getDefaultMidTierContext());
78+
new DeoptimizationGroupingPhase().apply(graph, getDefaultMidTierContext());
79+
canonicalizer.apply(graph, getDefaultMidTierContext());
80+
new WriteBarrierAdditionPhase().apply(graph, getDefaultMidTierContext());
6181

6282
assertTrue(graph.getNodes().filter(AddNode.class).count() == 4);
6383
new OptimizeOffsetAddressPhase(createCanonicalizerPhase()).apply(graph, getDefaultLowTierContext());

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,12 @@
4848
import jdk.graal.compiler.hotspot.meta.UnimplementedGraalIntrinsics;
4949
import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.Plugins;
5050
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin;
51+
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin.ConditionalInvocationPlugin;
5152
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins;
5253
import jdk.graal.compiler.options.OptionValues;
5354
import jdk.graal.compiler.runtime.RuntimeProvider;
5455
import jdk.graal.compiler.test.GraalTest;
56+
import jdk.vm.ci.code.Architecture;
5557
import jdk.vm.ci.hotspot.HotSpotVMConfigStore;
5658
import jdk.vm.ci.hotspot.VMIntrinsicMethod;
5759
import jdk.vm.ci.meta.MetaAccessProvider;
@@ -144,6 +146,16 @@ public interface Refiner {
144146
public final GraalHotSpotVMConfig config = rt.getVMConfig();
145147
public final UnimplementedGraalIntrinsics unimplementedGraalIntrinsics = new UnimplementedGraalIntrinsics(rt.getTarget().arch);
146148

149+
private static boolean isApplicable(InvocationPlugin plugin, Architecture arch) {
150+
if (plugin == null) {
151+
return false;
152+
}
153+
if (plugin instanceof ConditionalInvocationPlugin conditionalInvocationPlugin) {
154+
return conditionalInvocationPlugin.isApplicable(arch);
155+
}
156+
return true;
157+
}
158+
147159
@Test
148160
@SuppressWarnings("try")
149161
public void test() throws ClassNotFoundException, NoSuchFieldException {
@@ -171,12 +183,10 @@ public void test() throws ClassNotFoundException, NoSuchFieldException {
171183

172184
InvocationPlugin plugin = invocationPlugins.lookupInvocation(method, Graal.getRequiredCapability(OptionValues.class));
173185
String m = String.format("%s.%s%s", intrinsic.declaringClass, intrinsic.name, intrinsic.descriptor);
174-
if (plugin == null) {
175-
if (method != null) {
176-
IntrinsicMethod intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
177-
if (intrinsicMethod != null) {
178-
continue;
179-
}
186+
if (!isApplicable(plugin, providers.getLowerer().getTarget().arch)) {
187+
IntrinsicMethod intrinsicMethod = providers.getConstantReflection().getMethodHandleAccess().lookupMethodHandleIntrinsic(method);
188+
if (intrinsicMethod != null) {
189+
continue;
180190
}
181191
if (!unimplementedGraalIntrinsics.isDocumented(m) && isIntrinsicAvailable(intrinsic) && isIntrinsicSupportedByC2(intrinsic)) {
182192
missing.add(m);

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ArrayUtilsIndexOfWithMaskTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -42,7 +42,7 @@ public class ArrayUtilsIndexOfWithMaskTest extends GraalCompilerTest {
4242

4343
@Override
4444
protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) {
45-
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins, getReplacements());
45+
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins);
4646
super.registerInvocationPlugins(invocationPlugins);
4747
}
4848

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ArrayUtilsRegionEqualsWithMaskConstantTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public class ArrayUtilsRegionEqualsWithMaskConstantTest extends GraalCompilerTes
5858

5959
@Override
6060
protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) {
61-
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins, getReplacements());
61+
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins);
6262
super.registerInvocationPlugins(invocationPlugins);
6363
}
6464

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ArrayUtilsRegionEqualsWithMaskTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ArrayUtilsRegionEqualsWithMaskTest extends GraalCompilerTest {
4141

4242
@Override
4343
protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) {
44-
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins, getReplacements());
44+
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins);
4545
super.registerInvocationPlugins(invocationPlugins);
4646
}
4747

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ArrayUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ArrayUtilsTest extends GraalCompilerTest {
4141

4242
@Override
4343
protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) {
44-
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins, getReplacements());
44+
TruffleInvocationPlugins.register(getBackend().getTarget().arch, invocationPlugins);
4545
super.registerInvocationPlugins(invocationPlugins);
4646
}
4747

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/DeoptLoopDetectionTest.java

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,48 @@ public Object execute(VirtualFrame frame) {
107107
}, "alwaysDeopt", CallTarget::call, 1);
108108
}
109109

110+
@Test
111+
public void testAlwaysDeoptNoInvalidate() {
112+
AssertionError expectedError = Assert.assertThrows(AssertionError.class, () -> assertDeoptLoop(new BaseRootNode() {
113+
@CompilerDirectives.TruffleBoundary
114+
static void boundaryMethod() {
115+
116+
}
117+
118+
@Override
119+
public Object execute(VirtualFrame frame) {
120+
int arg = (int) frame.getArguments()[0];
121+
int threshold = TruffleCompilerOptions.DeoptCycleDetectionThreshold.getDefaultValue();
122+
if (arg < threshold) {
123+
CompilerDirectives.transferToInterpreterAndInvalidate();
124+
}
125+
// call boundary method to prevent compiler from moving the following deoptimization
126+
// up
127+
boundaryMethod();
128+
CompilerDirectives.transferToInterpreter();
129+
return null;
130+
}
131+
}, "alwaysDeoptNoInvalidate", new Consumer<CallTarget>() {
132+
int i;
133+
134+
@Override
135+
public void accept(CallTarget callTarget) {
136+
callTarget.call(i++);
137+
if (i == TruffleCompilerOptions.DeoptCycleDetectionThreshold.getDefaultValue() + 1) {
138+
/*
139+
* Invalidate the target that was just deoptimized (but not invalidated) by
140+
* transferToInterpreter. The exact same compilation is then repeated in the
141+
* next iteration, but because deoptimize nodes with deoptimization action
142+
* "None" (like the one used for transferToInterpreter) don't trigger deopt loop
143+
* detection, no deopt loop should be detected.
144+
*/
145+
((OptimizedCallTarget) callTarget).invalidate("Force one more recompile");
146+
}
147+
}
148+
}, 1));
149+
Assert.assertEquals("No deopt loop detected after " + MAX_EXECUTIONS + " executions", expectedError.getMessage());
150+
}
151+
110152
@Test
111153
public void testLocalDeopt() {
112154
assertDeoptLoop(new BaseRootNode() {

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/truffle/test/ExactMathTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class ExactMathTest extends TruffleCompilerImplTest {
4141

4242
@Override
4343
protected void registerInvocationPlugins(InvocationPlugins invocationPlugins) {
44-
TruffleGraphBuilderPlugins.registerExactMathPlugins(invocationPlugins, getTypes(), getReplacements(), getLowerer());
44+
TruffleGraphBuilderPlugins.registerExactMathPlugins(invocationPlugins, getTypes());
4545
super.registerInvocationPlugins(invocationPlugins);
4646
}
4747

0 commit comments

Comments
 (0)