Skip to content

Commit 179ecf3

Browse files
authored
Merge branch 'master' into GR-60108
2 parents 72f442f + e1edcf1 commit 179ecf3

File tree

190 files changed

+3552
-1032
lines changed

Some content is hidden

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

190 files changed

+3552
-1032
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!--
2+
Please use the following template for Backport PRs
3+
4+
Make sure to use `git cherry-pick -x` when cherry picking the commits to backport.
5+
6+
Reference the upstream pull requests being backported, e.g. https://github.com/oracle/graal/pull/9836
7+
if not upstream pull requests exists, then reference the upstream commit directly,
8+
e.g. https://github.com/oracle/graal/commit/6e859d90dde01a23e6973e25984419f29edc9c2b
9+
10+
Example:
11+
12+
This PR backports:
13+
- https://github.com/oracle/graal/pull/7427
14+
- part of https://github.com/oracle/graal/pull/10864
15+
-->
16+
**This PR backports:**
17+
- https://github.com/oracle/graal/pull/
18+
19+
<!-- Mention any conflicts and their resolution or that the backport applied cleanly -->
20+
**Conflicts:** There were no conflicts.
21+
22+
<!-- Add the backport issue that this PR closes -->
23+
Closes: https://github.com/graalvm/graalvm-community-jdk21u/issues/

MAINTAINING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ Between step 1 and 3 no new pull requests should be merged.
2626

2727
* [Boris Ulasevich](https://github.com/bulasevich)
2828
* [Cesar Soares](https://github.com/JohnTortugo)
29+
* [John Spurling](https://github.com/synecdoche)
2930
* [Volker Simonis](https://github.com/simonis/)

compiler/mx.compiler/suite.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"sourceinprojectwhitelist" : [],
55

66
"groupId" : "org.graalvm.compiler",
7-
"version" : "23.1.8",
7+
"version" : "23.1.9",
88
"release" : False,
99
"url" : "http://www.graalvm.org/",
1010
"developer" : {
@@ -85,33 +85,39 @@
8585
"urls" : ["https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/batik-all-1.7.jar"],
8686
},
8787

88-
"ASM_9.5" : {
89-
"digest" : "sha512:9e65f2983783725bae196ca939b45246958731246df1c495089c8ea5ce646de77c4e01a5a9ba10642016bb3258e1727e9ebcece6e74d9e3c32f528025d76b955",
88+
"ASM_9.7.1" : {
89+
"digest" : "sha512:4767b01603dad5c79cc1e2b5f3722f72b1059d928f184f446ba11badeb1b381b3a3a9a801cc43d25d396df950b09d19597c73173c411b1da890de808b94f1f50",
90+
"sourceDigest" : "sha512:d7c0de5912d04949a3d06cad366ff35a877da2682d9c74579625d62686032ea9349aff6102b17f92e9ec7eb4e9b1cd906b649c6a3ac798bfb9e31e5425de009d",
9091
"maven" : {
9192
"groupId" : "org.ow2.asm",
9293
"artifactId" : "asm",
93-
"version" : "9.5",
94+
"version" : "9.7.1",
9495
},
96+
"license" : "BSD-new",
9597
},
9698

97-
"ASM_TREE_9.5" : {
98-
"digest" : "sha512:816de8f84c216a7bd97b2458bde64a4b99a039b7b59fbd1ef52edf8bf869edabb93967736fe0c61e8eb3e1520e0cefe69ba59cda12df30f9f85db75fb6c064f3",
99+
"ASM_TREE_9.7.1" : {
100+
"digest" : "sha512:e55008c392fdd35e95d3404766b12dd4b46e13d5c362fcd0ab42a65751a82737eaf0ebc857691d1916190d34407adfde4437615d69c278785416fd911e00978d",
101+
"sourceDigest" : "sha512:3cea80bc7b55679dfa3d2065c6cb6951007cc7817082e9fcf4c5e3cdc073c22eddf7c7899cff60b1092049ec9038e8d3aa9a8828ef731739bda8b5afcec30e86",
99102
"maven" : {
100103
"groupId" : "org.ow2.asm",
101104
"artifactId" : "asm-tree",
102-
"version" : "9.5",
105+
"version" : "9.7.1",
103106
},
104-
"dependencies" : ["ASM_9.5"],
107+
"dependencies" : ["ASM_9.7.1"],
108+
"license" : "BSD-new",
105109
},
106110

107-
"ASM_UTIL_9.5" : {
108-
"digest" : "sha512:f68284d8f8fd029f3f428112225b2035ed3a4216cf3b34e0aacc83c32a6d44ab5e5d128b60a13ef768e3396041a62cf63f7fd3445dc5a05ce0ae03a2b2ed3080",
111+
"ASM_UTIL_9.7.1" : {
112+
"digest" : "sha512:522d793d15a2c5ea6504a50222cf0750f1eab7b881cf289675042539b1aba8b3868197b1bebe729de728dd10020eb028ae16252dcd5d84fdcbf7f925832bc269",
113+
"sourceDigest" : "sha512:387aa887bfec24aec287d9aacebfdc0c2e1ab16a4adce933aecac6fc41545ce43a3eea0ed139db52dd0d0af910cfd2162aa4d6330a81b32b64b36f03b49db66a",
109114
"maven" : {
110115
"groupId" : "org.ow2.asm",
111116
"artifactId" : "asm-util",
112-
"version" : "9.5",
117+
"version" : "9.7.1",
113118
},
114-
"dependencies" : ["ASM_9.5"],
119+
"dependencies" : ["ASM_9.7.1"],
120+
"license" : "BSD-new",
115121
},
116122

117123
"HSDIS" : {
@@ -236,8 +242,8 @@
236242
"dependencies" : [
237243
"jdk.internal.vm.compiler",
238244
"mx:JUNIT",
239-
"ASM_TREE_9.5",
240-
"ASM_UTIL_9.5",
245+
"ASM_TREE_9.7.1",
246+
"ASM_UTIL_9.7.1",
241247
"JAVA_ALLOCATION_INSTRUMENTER",
242248
"truffle:TRUFFLE_SL_TEST",
243249
"truffle:TRUFFLE_TEST",
@@ -456,8 +462,8 @@
456462
"truffle:TRUFFLE_COMPILER",
457463
"truffle:TRUFFLE_RUNTIME",
458464
"regex:TREGEX",
459-
"ASM_TREE_9.5",
460-
"ASM_UTIL_9.5",
465+
"ASM_TREE_9.7.1",
466+
"ASM_UTIL_9.7.1",
461467
],
462468
"exclude" : [
463469
"mx:JUNIT",
Lines changed: 48 additions & 0 deletions
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 org.graalvm.compiler.core.aarch64.test;
26+
27+
import org.graalvm.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.internal.vm.compiler.test/src/org/graalvm/compiler/hotspot/test/ObjectCloneTest.java

Lines changed: 104 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2017, 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
@@ -27,29 +27,40 @@
2727
import java.util.ArrayList;
2828
import java.util.Optional;
2929

30+
import org.junit.Assert;
31+
import org.junit.Test;
32+
3033
import org.graalvm.compiler.api.directives.GraalDirectives;
34+
import org.graalvm.compiler.core.common.GraalOptions;
3135
import org.graalvm.compiler.core.test.GraalCompilerTest;
3236
import org.graalvm.compiler.hotspot.replacements.ObjectCloneNode;
3337
import org.graalvm.compiler.nodes.GraphState;
3438
import org.graalvm.compiler.nodes.StructuredGraph;
3539
import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration;
3640
import org.graalvm.compiler.options.OptionValues;
3741
import org.graalvm.compiler.phases.BasePhase;
42+
import org.graalvm.compiler.phases.common.HighTierLoweringPhase;
3843
import org.graalvm.compiler.phases.tiers.HighTierContext;
3944
import org.graalvm.compiler.phases.tiers.Suites;
40-
import org.graalvm.compiler.virtual.phases.ea.FinalPartialEscapePhase;
41-
import org.junit.Assert;
42-
import org.junit.Test;
45+
46+
import jdk.vm.ci.code.InstalledCode;
47+
import jdk.vm.ci.meta.ResolvedJavaMethod;
4348

4449
/**
4550
* Exercise intrinsification of {@link Object#clone}.
4651
*/
4752
public class ObjectCloneTest extends GraalCompilerTest {
4853

54+
@Override
55+
protected InstalledCode getCode(final ResolvedJavaMethod installedCodeOwner, StructuredGraph graph, boolean forceCompile, boolean installAsDefault, OptionValues options) {
56+
OptionValues newOptions = new OptionValues(options, GraalOptions.PartialEscapeAnalysis, false);
57+
return super.getCode(installedCodeOwner, graph, forceCompile, installAsDefault, newOptions);
58+
}
59+
4960
@Override
5061
protected Suites createSuites(OptionValues opts) {
5162
Suites suites = super.createSuites(opts);
52-
var pos = suites.getHighTier().findPhase(FinalPartialEscapePhase.class);
63+
var pos = suites.getHighTier().findPhase(HighTierLoweringPhase.class);
5364
pos.previous();
5465
pos.add(new BasePhase<HighTierContext>() {
5566
@Override
@@ -71,10 +82,36 @@ protected void run(StructuredGraph graph, HighTierContext context) {
7182
return suites;
7283
}
7384

85+
@BytecodeParserNeverInline
7486
public static Object cloneArray(int[] array) {
7587
return array.clone();
7688
}
7789

90+
private static final class ArrayHolder<T> {
91+
T[] array;
92+
93+
private ArrayHolder(T[] array) {
94+
this.array = array;
95+
}
96+
}
97+
98+
public static Object[] cloneGenericObjectArray(ArrayHolder<Object> holder) {
99+
return holder.array.clone();
100+
}
101+
102+
public static Number[] cloneDynamicObjectArray(ArrayHolder<Number> holder) {
103+
return holder.array.clone();
104+
}
105+
106+
public static Integer[] cloneConcreteObjectArray(ArrayHolder<Integer> holder) {
107+
return holder.array.clone();
108+
}
109+
110+
@BytecodeParserNeverInline
111+
public static <T> T[] cloneArrayGeneric(T[] array) {
112+
return array.clone();
113+
}
114+
78115
public static Object cloneList(ArrayList<?> list) {
79116
return list.clone();
80117
}
@@ -115,6 +152,21 @@ public void testArray() throws Throwable {
115152
test("cloneArray", new int[]{1, 2, 4, 3});
116153
}
117154

155+
@Test
156+
public void testGenericObjectArray() throws Throwable {
157+
test("cloneGenericObjectArray", new ArrayHolder<>(new Integer[]{1, 2, 4, 3}));
158+
}
159+
160+
@Test
161+
public void testDynamicObjectArray() throws Throwable {
162+
test("cloneDynamicObjectArray", new ArrayHolder<>(new Number[]{1, 2, 4, 3}));
163+
}
164+
165+
@Test
166+
public void testConcreteObjectArray() throws Throwable {
167+
test("cloneConcreteObjectArray", new ArrayHolder<>(new Integer[]{1, 2, 3, 4}));
168+
}
169+
118170
@Test
119171
public void testList() throws Throwable {
120172
ArrayList<Object> list = new ArrayList<>();
@@ -142,10 +194,13 @@ public void testCloneConstantArray() {
142194

143195
public static Object cloneArrayWithImpreciseStamp(int[] inputArray, int count) {
144196
int[] array = inputArray;
145-
for (int i = 0; i < count; i++) {
146-
if (i > 3) {
147-
array = new int[i];
148-
array[i - 1] = i;
197+
for (int j = 0; j < count; j++) {
198+
for (int i = 0; i < j; i++) {
199+
if (i > 3) {
200+
array = new int[i];
201+
array[i - 1] = i;
202+
}
203+
GraalDirectives.controlFlowAnchor();
149204
}
150205
GraalDirectives.controlFlowAnchor();
151206
}
@@ -156,4 +211,44 @@ public static Object cloneArrayWithImpreciseStamp(int[] inputArray, int count) {
156211
public void testCloneArrayWithImpreciseStamp() {
157212
test("cloneArrayWithImpreciseStamp", ARRAY, ARRAY.length);
158213
}
214+
215+
public static Object cloneArrayWithImpreciseStampInlined(int[] inputArray, int count) {
216+
int[] array = inputArray;
217+
for (int j = 0; j < count; j++) {
218+
for (int i = 0; i < j; i++) {
219+
if (i > 3) {
220+
array = new int[i];
221+
array[i - 1] = i;
222+
}
223+
GraalDirectives.controlFlowAnchor();
224+
}
225+
GraalDirectives.controlFlowAnchor();
226+
}
227+
return cloneArray(array);
228+
}
229+
230+
@Test
231+
public void testCloneArrayWithImpreciseStampInlined() {
232+
test("cloneArrayWithImpreciseStampInlined", ARRAY, ARRAY.length);
233+
}
234+
235+
public static Object cloneArrayWithImpreciseStampInlinedGeneric(Integer[] inputArray, int count) {
236+
Integer[] array = inputArray;
237+
for (int j = 0; j < count; j++) {
238+
for (int i = 0; i < j; i++) {
239+
if (i > 3) {
240+
array = new Integer[i];
241+
array[i - 1] = i;
242+
}
243+
GraalDirectives.controlFlowAnchor();
244+
}
245+
GraalDirectives.controlFlowAnchor();
246+
}
247+
return cloneArrayGeneric(array);
248+
}
249+
250+
@Test
251+
public void testCloneArrayWithImpreciseStampInlinedGeneric() {
252+
test("cloneArrayWithImpreciseStampInlinedGeneric", new Integer[]{1, 2, 3, 4}, ARRAY.length);
253+
}
159254
}

compiler/src/jdk.internal.vm.compiler.test/src/org/graalvm/compiler/replacements/test/UnsafeReplacementsTest.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2018, 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
@@ -155,6 +155,15 @@ public void testCompareAndSet() {
155155
test("unsafeCompareAndSetDouble");
156156
}
157157

158+
public static Boolean unsafeCompareAndSetFloatVar(Container c) {
159+
return unsafe.compareAndSetFloat(c, floatOffset, 1.0f, 2.0f);
160+
}
161+
162+
@Test
163+
public void testUnsafeCompareAndSetFloatVar() {
164+
test("unsafeCompareAndSetFloatVar", new Container());
165+
}
166+
158167
public static boolean unsafeWeakCompareAndSetBoolean() {
159168
Container container = new Container();
160169
boolean success = false;

0 commit comments

Comments
 (0)