Skip to content

Commit db14b7b

Browse files
authored
Merge pull request #840 (24.2.1 merge)
[24.2] Sync with upstream for April 2025 CPU. Specifically merge in upstream tag vm-24.2.1 in preparation of the Mandrel 24.2.1.0-Final release.
2 parents b2caa5a + a056fef commit db14b7b

File tree

193 files changed

+3458
-2296
lines changed

Some content is hidden

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

193 files changed

+3458
-2296
lines changed

.github/workflows/mandrel.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
repo: ${{ github.repository }}
3636
version: ${{ github.ref }}
3737
mandrel-packaging-version: "24.2"
38-
jdk: "24/ea"
38+
jdk: "24/ga"
3939
q-main-ea-win:
4040
name: "Q main M 24.2 windows EA"
4141
uses: ./.github/workflows/base-windows.yml
@@ -44,4 +44,4 @@ jobs:
4444
repo: ${{ github.repository }}
4545
version: ${{ github.ref }}
4646
mandrel-packaging-version: "24.2"
47-
jdk: "24/ea"
47+
jdk: "24/ga"

common.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -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": "24", "build_id": "jdk-24+36", "platformspecific": true, "extrabundles": ["static-libs"]},
49-
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24+36-jvmci-b01", "platformspecific": true },
50-
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24+36-jvmci-b01-debug", "platformspecific": true },
51-
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24+36-jvmci-b01-sulong", "platformspecific": true },
52-
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24+36-jvmci-b01", "platformspecific": true },
53-
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24+36-jvmci-b01-debug", "platformspecific": true },
54-
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24+36-jvmci-b01-sulong", "platformspecific": true }
48+
"oraclejdk-latest": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24.0.1+9", "platformspecific": true, "extrabundles": ["static-libs"]},
49+
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-24.0.1+9-jvmci-b01", "platformspecific": true },
50+
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-24.0.1+9-jvmci-b01-debug", "platformspecific": true },
51+
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-24.0.1+9-jvmci-b01-sulong", "platformspecific": true },
52+
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-24.0.1+9-jvmci-b01", "platformspecific": true },
53+
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-24.0.1+9-jvmci-b01-debug", "platformspecific": true },
54+
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-24.0.1+9-jvmci-b01-sulong", "platformspecific": true }
5555
},
5656

5757
"eclipse": {

compiler/ci/ci_common/benchmark-suites.libsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
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.3",
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,

compiler/mx.compiler/suite.py

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

66
"groupId" : "org.graalvm.compiler",
7-
"version" : "24.2.0.1",
8-
"release" : False,
7+
"version" : "24.2.1.0",
8+
"release" : True,
99
"url" : "http://www.graalvm.org/",
1010
"developer" : {
1111
"name" : "GraalVM Development",
@@ -579,8 +579,7 @@
579579
"jdk.graal.compiler.options to org.graalvm.nativeimage.driver,org.graalvm.nativeimage.junitsupport",
580580
"jdk.graal.compiler.phases.common to org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.configure",
581581
"jdk.graal.compiler.serviceprovider to jdk.graal.compiler.management,org.graalvm.nativeimage.driver,org.graalvm.nativeimage.agent.jvmtibase,org.graalvm.nativeimage.agent.diagnostics",
582-
"jdk.graal.compiler.util.args",
583-
"jdk.graal.compiler.util.json",
582+
"jdk.graal.compiler.util.json to org.graalvm.nativeimage.librarysupport,org.graalvm.nativeimage.agent.tracing,org.graalvm.nativeimage.configure,org.graalvm.nativeimage.driver",
584583
],
585584
"uses" : [
586585
"jdk.graal.compiler.code.DisassemblerProvider",

compiler/src/jdk.graal.compiler.test/src/jdk/graal/compiler/replacements/test/UnsafeReplacementsTest.java

Lines changed: 12 additions & 2 deletions
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
@@ -24,9 +24,10 @@
2424
*/
2525
package jdk.graal.compiler.replacements.test;
2626

27-
import jdk.graal.compiler.test.AddExports;
2827
import org.junit.Test;
2928

29+
import jdk.graal.compiler.test.AddExports;
30+
3031
@AddExports("java.base/jdk.internal.misc")
3132
public class UnsafeReplacementsTest extends MethodSubstitutionTest {
3233

@@ -155,6 +156,15 @@ public void testCompareAndSet() {
155156
test("unsafeCompareAndSetDouble");
156157
}
157158

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -384,12 +384,12 @@ public void testVariadicLength() {
384384
b.beginBlock();
385385

386386
b.beginReturn();
387-
b.beginVeryComplexOperation();
387+
b.beginVariadicOperation();
388388
b.emitLoadConstant(3L);
389389
for (int i = 0; i < numVariadic; i++) {
390390
b.emitLoadNull();
391391
}
392-
b.endVeryComplexOperation();
392+
b.endVariadicOperation();
393393
b.endReturn();
394394

395395
b.endBlock();

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/core/amd64/AMD64LIRGenerator.java

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,9 @@ private AllocatableValue asAllocatable(Value value, ValueKind<?> kind) {
246246
}
247247
}
248248

249-
private Value emitCompareAndSwap(boolean isLogic, LIRKind accessKind, Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue, BarrierType barrierType) {
249+
private Value emitCompareAndSwapHelper(boolean isLogic, LIRKind accessKind, Value address, Value expectedValue, Value newValue, BarrierType barrierType) {
250250
ValueKind<?> kind = newValue.getValueKind();
251-
assert kind.equals(expectedValue.getValueKind());
251+
GraalError.guarantee(kind.equals(expectedValue.getValueKind()), "%s != %s", kind, expectedValue.getValueKind());
252252

253253
AMD64AddressValue addressValue = asAddressValue(address);
254254
LIRKind integerAccessKind = accessKind;
@@ -269,15 +269,20 @@ private Value emitCompareAndSwap(boolean isLogic, LIRKind accessKind, Value addr
269269
AllocatableValue allocatableNewValue = asAllocatable(reinterpretedNewValue, integerAccessKind);
270270
emitMove(aRes, reinterpretedExpectedValue);
271271
emitCompareAndSwapOp(isLogic, integerAccessKind, memKind, aRes, addressValue, allocatableNewValue, barrierType);
272+
return aRes;
273+
}
274+
275+
private Value emitCompareAndSwap(boolean isLogic, LIRKind accessKind, Value address, Value expectedValue, Value newValue, Value trueValue, Value falseValue, BarrierType barrierType) {
276+
Value aRes = emitCompareAndSwapHelper(isLogic, accessKind, address, expectedValue, newValue, barrierType);
272277

273278
if (isLogic) {
274279
assert trueValue.getValueKind().equals(falseValue.getValueKind());
275280
return emitCondMoveOp(Condition.EQ, trueValue, falseValue, false, false);
276281
} else {
277-
if (isXmm) {
282+
if (((AMD64Kind) accessKind.getPlatformKind()).isXMM()) {
278283
return arithmeticLIRGen.emitReinterpret(accessKind, aRes);
279284
} else {
280-
Variable result = newVariable(kind);
285+
Variable result = newVariable(newValue.getValueKind());
281286
emitMove(result, aRes);
282287
return result;
283288
}
@@ -297,13 +302,11 @@ public Value emitValueCompareAndSwap(LIRKind accessKind, Value address, Value ex
297302

298303
public void emitCompareAndSwapBranch(boolean isLogic, LIRKind kind, AMD64AddressValue address, Value expectedValue, Value newValue, Condition condition, LabelRef trueLabel, LabelRef falseLabel,
299304
double trueLabelProbability, BarrierType barrierType) {
300-
assert kind.getPlatformKind().getSizeInBytes() <= expectedValue.getValueKind().getPlatformKind().getSizeInBytes() : kind + " " + expectedValue;
301-
assert kind.getPlatformKind().getSizeInBytes() <= newValue.getValueKind().getPlatformKind().getSizeInBytes() : kind + " " + newValue;
302-
assert condition == Condition.EQ || condition == Condition.NE : Assertions.errorMessage(condition, address, expectedValue, newValue);
303-
AMD64Kind memKind = (AMD64Kind) kind.getPlatformKind();
304-
RegisterValue raxValue = AMD64.rax.asValue(kind);
305-
emitMove(raxValue, expectedValue);
306-
emitCompareAndSwapOp(isLogic, kind, memKind, raxValue, address, asAllocatable(newValue), barrierType);
305+
GraalError.guarantee(kind.getPlatformKind().getSizeInBytes() <= expectedValue.getValueKind().getPlatformKind().getSizeInBytes(), "kind=%s, expectedValue=%s", kind, expectedValue);
306+
GraalError.guarantee(kind.getPlatformKind().getSizeInBytes() <= newValue.getValueKind().getPlatformKind().getSizeInBytes(), "kind=%s, newValue=%s", kind, newValue);
307+
GraalError.guarantee(condition == Condition.EQ || condition == Condition.NE, Assertions.errorMessage(condition, address, expectedValue, newValue));
308+
309+
emitCompareAndSwapHelper(isLogic, kind, address, expectedValue, newValue, barrierType);
307310
append(new BranchOp(condition, trueLabel, falseLabel, trueLabelProbability));
308311
}
309312

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ public final class JVMCIVersionCheck {
5555
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
5656
"21", Map.of(DEFAULT_VENDOR_ENTRY, createLegacyVersion(23, 1, 33)),
5757
"24", Map.of(
58-
"Oracle Corporation", createLabsJDKVersion("24+36", 1),
59-
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24+36", 1)));
58+
"Oracle Corporation", createLabsJDKVersion("24.0.1+9", 1),
59+
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("24.0.1+9", 1)));
6060
private static final int NA = 0;
6161
/**
6262
* Minimum Java release supported by Graal.

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/aarch64/AArch64HotSpotMove.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 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,7 +27,6 @@
2727
import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.HINT;
2828
import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL;
2929
import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.REG;
30-
import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.STACK;
3130
import static jdk.vm.ci.aarch64.AArch64.zr;
3231
import static jdk.vm.ci.code.ValueUtil.asRegister;
3332
import static jdk.vm.ci.code.ValueUtil.isRegister;
@@ -51,7 +50,7 @@ public static class LoadHotSpotObjectConstantInline extends AArch64LIRInstructio
5150
public static final LIRInstructionClass<LoadHotSpotObjectConstantInline> TYPE = LIRInstructionClass.create(LoadHotSpotObjectConstantInline.class);
5251

5352
private HotSpotConstant constant;
54-
@Def({REG, STACK}) AllocatableValue result;
53+
@Def({REG}) AllocatableValue result;
5554

5655
public LoadHotSpotObjectConstantInline(HotSpotConstant constant, AllocatableValue result) {
5756
super(TYPE);
@@ -79,6 +78,11 @@ public AllocatableValue getResult() {
7978
public Constant getConstant() {
8079
return constant;
8180
}
81+
82+
@Override
83+
public boolean canRematerializeToStack() {
84+
return false;
85+
}
8286
}
8387

8488
/**

compiler/src/jdk.graal.compiler/src/jdk/graal/compiler/hotspot/amd64/AMD64HotSpotMove.java

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2013, 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2013, 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
@@ -24,12 +24,12 @@
2424
*/
2525
package jdk.graal.compiler.hotspot.amd64;
2626

27-
import static jdk.vm.ci.code.ValueUtil.asRegister;
28-
import static jdk.vm.ci.code.ValueUtil.isRegister;
29-
import static jdk.vm.ci.code.ValueUtil.isStackSlot;
3027
import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.HINT;
3128
import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.REG;
3229
import static jdk.graal.compiler.lir.LIRInstruction.OperandFlag.STACK;
30+
import static jdk.vm.ci.code.ValueUtil.asRegister;
31+
import static jdk.vm.ci.code.ValueUtil.isRegister;
32+
import static jdk.vm.ci.code.ValueUtil.isStackSlot;
3333

3434
import jdk.graal.compiler.asm.amd64.AMD64Address;
3535
import jdk.graal.compiler.asm.amd64.AMD64MacroAssembler;
@@ -41,7 +41,6 @@
4141
import jdk.graal.compiler.lir.StandardOp.LoadConstantOp;
4242
import jdk.graal.compiler.lir.amd64.AMD64LIRInstruction;
4343
import jdk.graal.compiler.lir.asm.CompilationResultBuilder;
44-
4544
import jdk.vm.ci.code.Register;
4645
import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant;
4746
import jdk.vm.ci.hotspot.HotSpotObjectConstant;
@@ -104,6 +103,16 @@ public Constant getConstant() {
104103
public AllocatableValue getResult() {
105104
return result;
106105
}
106+
107+
@Override
108+
public boolean canRematerializeToStack() {
109+
/*
110+
* This is slightly too lenient, formally we would also need to check if the target
111+
* allows inlining objects. In practice that is always true, and we do not have access
112+
* to the relevant information here.
113+
*/
114+
return input.isCompressed();
115+
}
107116
}
108117

109118
public static final class BaseMove extends AMD64LIRInstruction {
@@ -167,6 +176,11 @@ public Constant getConstant() {
167176
public AllocatableValue getResult() {
168177
return result;
169178
}
179+
180+
@Override
181+
public boolean canRematerializeToStack() {
182+
return input.isCompressed();
183+
}
170184
}
171185

172186
/**

0 commit comments

Comments
 (0)