Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
8ae9069
Automatic merge of master into galahad
OracleLabsAutomation May 29, 2025
06289a6
Automatic merge of master into galahad
OracleLabsAutomation May 30, 2025
f15bab1
Automatic merge of master into galahad
OracleLabsAutomation May 30, 2025
d924c62
Automatic merge of master into galahad
OracleLabsAutomation May 30, 2025
649fd51
Automatic merge of master into galahad
OracleLabsAutomation May 30, 2025
7f63cd4
Automatic merge of master into galahad
OracleLabsAutomation May 30, 2025
ae2c9ad
Automatic merge of master into galahad
OracleLabsAutomation May 31, 2025
0e880ef
Automatic merge of master into galahad
OracleLabsAutomation May 31, 2025
9f77bf4
Automatic merge of master into galahad
OracleLabsAutomation May 31, 2025
1ef1fff
Automatic merge of master into galahad
OracleLabsAutomation May 31, 2025
44d0cdb
Automatic merge of master into galahad
OracleLabsAutomation May 31, 2025
56101a9
Automatic merge of master into galahad
OracleLabsAutomation May 31, 2025
786605b
Automatic merge of master into galahad
OracleLabsAutomation May 31, 2025
5c73aee
Automatic merge of master into galahad
OracleLabsAutomation Jun 2, 2025
11dd301
Automatic merge of master into galahad
OracleLabsAutomation Jun 2, 2025
fdfd58f
Automatic merge of master into galahad
OracleLabsAutomation Jun 2, 2025
7bbf0da
Automatic merge of master into galahad
OracleLabsAutomation Jun 2, 2025
bafbd07
Automatic merge of master into galahad
OracleLabsAutomation Jun 2, 2025
54d610f
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
b88fa49
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
bf9508b
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
28afc34
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
a4405ab
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
79a237c
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
d671790
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
29116f3
Automatic merge of master into galahad
OracleLabsAutomation Jun 3, 2025
7ee33c9
adopt "JDK-8357987: [JVMCI] Add support for retrieving all methods of…
teshull Jun 3, 2025
be3a62f
Update galahad jdk
teshull Jun 3, 2025
1f49d82
[JDK-8358544] Adapt "JDK-8357987: [JVMCI] Add support for retrieving …
teshull Jun 3, 2025
2982870
Automatic merge of master into galahad
OracleLabsAutomation Jun 4, 2025
6dc327c
Automatic merge of master into galahad
OracleLabsAutomation Jun 4, 2025
d16f1d8
Automatic merge of master into galahad
OracleLabsAutomation Jun 4, 2025
9399141
Adapt JDK-8353686: Optimize Math.cbrt for x86 64 bit platforms
mur47x111 Jun 2, 2025
53e3a19
[JDK-8358331] Adapt JDK-8353686: Optimize Math.cbrt for x86 64 bit pl…
mur47x111 Jun 4, 2025
00de1a0
Automatic merge of master into galahad
OracleLabsAutomation Jun 4, 2025
6be3c70
Automatic merge of master into galahad
OracleLabsAutomation Jun 4, 2025
0c2944f
adopt "JDK-8357660: [JVMCI] Add support for retrieving all BootstrapM…
teshull Jun 3, 2025
3babd84
Update galahad jdk
teshull Jun 3, 2025
9316c8d
Automatic merge of master into galahad
OracleLabsAutomation Jun 4, 2025
1dc28cc
[JDK-8358545] Adapt "JDK-8357660: [JVMCI] Add support for retrieving …
teshull Jun 4, 2025
013690b
Automatic merge of master into galahad
OracleLabsAutomation Jun 4, 2025
c8f9f1e
Automatic merge of master into galahad
OracleLabsAutomation Jun 5, 2025
799e71f
Automatic merge of master into galahad
OracleLabsAutomation Jun 5, 2025
0a52152
Automatic merge of master into galahad
OracleLabsAutomation Jun 5, 2025
7804e62
Automatic merge of master into galahad
OracleLabsAutomation Jun 5, 2025
01d2508
update JVMCI to 25+26-jvmci-b01
OracleLabsAutomation Jun 6, 2025
e72f6fa
compiler: update JVMCIVersionCheck
zapster Jun 6, 2025
6b6df08
Merge tag 'jdk-25+26'
zapster Jun 6, 2025
991768a
svm: adopt "JDK-8352738: Implement JEP 520: JFR Method Timing and Tra…
zapster Jun 6, 2025
0e98770
svm: adopt "JDK-8351594: JFR: Rate-limited sampling of Java events"
zapster Jun 6, 2025
4a2e07f
svm: review JDK 25+26 changes
zapster Jun 6, 2025
1f431a0
Espresso: Stub implementations of new JVMCI methods
gilles-duboscq Jun 6, 2025
6a7fd86
deploy labsjdk snapshots
marwan-hallaoui Jun 6, 2025
9067dbe
svm: clean-up Thread initialization
zapster Jun 7, 2025
d648724
svm: use @BasedOnJDKClass on JfrLogTag
zapster Jun 7, 2025
7b61bb2
Math.tanh/cbrt substitutions may not be always available
mur47x111 Jun 7, 2025
fdfdf80
Adapt JDK-8323497: On x64, use 32-bit immediate moves for narrow klas…
mur47x111 Jun 7, 2025
7f78711
svm: adopt "JDK-8350703: Add standard system property stdin.encoding"
zapster Jun 9, 2025
a1c87a1
svm: workaround incompatibility due to "JDK-8357987: [JVMCI] Add supp…
zapster Jun 10, 2025
261174a
svm: further adopt "JDK-8351594: JFR: Rate-limited sampling of Java e…
zapster Jun 10, 2025
6296463
svm: adopt "JDK-8348986: Improve coverage of enhanced exception messa…
zapster Jun 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+26-3156", "platformspecific": true, "extrabundles": ["static-libs"]},
"galahad-jdk": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+26-3319", "platformspecific": true, "extrabundles": ["static-libs"]},

"oraclejdk17": {"name": "jpg-jdk", "version": "17.0.7", "build_id": "jdk-17.0.7+8", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.1-b02", "platformspecific": true },
Expand Down Expand Up @@ -45,13 +45,13 @@

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

"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+25", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+25-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+25-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+25-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+25-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+25-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+25-jvmci-b01-sulong", "platformspecific": true }
"oraclejdk-latest": {"name": "jpg-jdk", "version": "25", "build_id": "jdk-25+26", "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-latest": {"name": "labsjdk", "version": "ce-25+26-jvmci-b01", "platformspecific": true },
"labsjdk-ce-latestDebug": {"name": "labsjdk", "version": "ce-25+26-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ce-latest-llvm": {"name": "labsjdk", "version": "ce-25+26-jvmci-b01-sulong", "platformspecific": true },
"labsjdk-ee-latest": {"name": "labsjdk", "version": "ee-25+26-jvmci-b01", "platformspecific": true },
"labsjdk-ee-latestDebug": {"name": "labsjdk", "version": "ee-25+26-jvmci-b01-debug", "platformspecific": true },
"labsjdk-ee-latest-llvm": {"name": "labsjdk", "version": "ee-25+26-jvmci-b01-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* Copyright (c) 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.graal.compiler.replacements.test;

import org.junit.Test;

import jdk.graal.compiler.jtt.JTTTest;

public class MathCbrtTest extends JTTTest {

public double cbrt(double d) {
return Math.cbrt(d);
}

@Test
public void testCbrt() {
for (double d = -3.0d; d <= 3.0D; d += 0.01D) {
test("cbrt", d);
}

double[] inputs = {Math.PI / 2, Math.PI, -1.0D, Double.MAX_VALUE, Double.MIN_VALUE, Double.NaN, Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY,
Double.longBitsToDouble(0x7fffffffffffffffL), Double.longBitsToDouble(0xffffffffffffffffL)};
for (double d : inputs) {
test("cbrt", d);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2012, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2012, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -53,17 +53,21 @@ public class StandardMethodSubstitutionsTest extends MethodSubstitutionTest {
public void testMathSubstitutions() {
assertInGraph(assertNotInGraph(testGraph("mathAbs"), IfNode.class), AbsNode.class); // Java
double value = 34567.891D;

testGraph("mathCos");
testGraph("mathLog");
testGraph("mathLog10");
testGraph("mathSin");
testGraph("mathSqrt");
testGraph("mathTan");
testGraph("mathAll");

if (getReplacements().hasSubstitution(getResolvedJavaMethod(Math.class, "tanh"), getInitialOptions())) {
testGraph("mathTanh");
}
if (getReplacements().hasSubstitution(getResolvedJavaMethod(Math.class, "cbrt"), getInitialOptions())) {
testGraph("mathCbrt");
}
testGraph("mathCbrt");

test("mathCos", value);
test("mathLog", value);
Expand All @@ -72,6 +76,7 @@ public void testMathSubstitutions() {
test("mathSqrt", value);
test("mathTan", value);
test("mathTanh", value);
test("mathCbrt", value);
test("mathAll", value);
}

Expand Down Expand Up @@ -141,6 +146,10 @@ public static double mathTanh(double value) {
return Math.tanh(value);
}

public static double mathCbrt(double value) {
return Math.cbrt(value);
}

public static double mathAll(double value) {
return Math.sqrt(value) + Math.log(value) + Math.log10(value) + Math.sin(value) + Math.cos(value) + Math.tan(value);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5036,6 +5036,10 @@ public final void incq(AMD64Address dst) {
AMD64MOp.INC.emit(this, OperandSize.QWORD, dst);
}

public final void movapd(Register dst, AMD64Address src) {
SSEOp.MOVAPD.emit(this, OperandSize.PD, dst, src);
}

public final void movapd(Register dst, Register src) {
SSEOp.MOVAPD.emit(this, OperandSize.PD, dst, src);
}
Expand Down Expand Up @@ -5299,6 +5303,10 @@ public final void orl(Register dst, int imm32) {
AMD64BinaryArithmetic.OR.getMIOpcode(OperandSize.DWORD, isByte(imm32)).emit(this, OperandSize.DWORD, dst, imm32);
}

public final void orpd(Register dst, Register src) {
SSEOp.OR.emit(this, OperandSize.PD, dst, src);
}

public final void orq(Register dst, Register src) {
AMD64BinaryArithmetic.OR.rmOp.emit(this, OperandSize.QWORD, dst, src);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
import jdk.graal.compiler.lir.amd64.AMD64CountTrailingZerosOp;
import jdk.graal.compiler.lir.amd64.AMD64FloatToHalfFloatOp;
import jdk.graal.compiler.lir.amd64.AMD64HalfFloatToFloatOp;
import jdk.graal.compiler.lir.amd64.AMD64MathCbrtOp;
import jdk.graal.compiler.lir.amd64.AMD64MathCopySignOp;
import jdk.graal.compiler.lir.amd64.AMD64MathCosOp;
import jdk.graal.compiler.lir.amd64.AMD64MathExpOp;
Expand Down Expand Up @@ -1311,6 +1312,11 @@ public Value emitMathExp(Value input) {
return new AMD64MathExpOp().emitLIRWrapper(getLIRGen(), input);
}

@Override
public Value emitMathCbrt(Value input) {
return new AMD64MathCbrtOp().emitLIRWrapper(getLIRGen(), input);
}

@Override
public Value emitMathPow(Value x, Value y) {
return new AMD64MathPowOp().emitLIRWrapper(getLIRGen(), x, y);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ private long getZGCAddressField(String name) {
public final long arithmeticLogAddress = getFieldValue("CompilerToVM::Data::dlog", Long.class, "address");
public final long arithmeticLog10Address = getFieldValue("CompilerToVM::Data::dlog10", Long.class, "address");
public final long arithmeticPowAddress = getFieldValue("CompilerToVM::Data::dpow", Long.class, "address");
public final long arithmeticCbrtAddress = getFieldValue("CompilerToVM::Data::dcbrt", Long.class, "address");

public final long fremAddress = getAddress("SharedRuntime::frem");
public final long dremAddress = getAddress("SharedRuntime::drem");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public final class JVMCIVersionCheck {
*/
private static final Map<String, Map<String, Version>> JVMCI_MIN_VERSIONS = Map.of(
"25", Map.of(
"Oracle Corporation", createLabsJDKVersion("25+25", 1),
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("25+25", 1)));
"Oracle Corporation", createLabsJDKVersion("25+26", 1),
DEFAULT_VENDOR_ENTRY, createLabsJDKVersion("25+26", 1)));
private static final int NA = 0;
/**
* Minimum Java release supported by Graal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ public boolean isDefault() {
throw new UnsupportedOperationException();
}

@Override
public boolean isDeclared() {
throw new UnsupportedOperationException();
}

@Override
public boolean isClassInitializer() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

import java.lang.annotation.Annotation;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;

import jdk.graal.compiler.core.common.LibGraalSupport;
Expand Down Expand Up @@ -318,6 +319,11 @@ public ResolvedJavaMethod[] getDeclaredMethods(boolean forceLink) {
return methods.clone();
}

@Override
public List<ResolvedJavaMethod> getAllMethods(boolean forceLink) {
throw new UnsupportedOperationException();
}

@Override
public ResolvedJavaMethod getClassInitializer() {
throw new UnsupportedOperationException();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -33,6 +33,7 @@
import static jdk.graal.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.DESTROYS_ALL_CALLER_SAVE_REGISTERS;
import static jdk.graal.compiler.hotspot.meta.HotSpotForeignCallDescriptor.Transition.LEAF;
import static jdk.graal.compiler.replacements.nodes.BinaryMathIntrinsicNode.BinaryOperation.POW;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.CBRT;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.COS;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.EXP;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.LOG;
Expand Down Expand Up @@ -110,6 +111,7 @@ protected void registerMathStubs(GraalHotSpotVMConfig hotSpotVMConfig, HotSpotPr
link(new AMD64MathStub(LOG, options, providers, registerStubCall(LOG.foreignCallSignature, LEAF, NO_SIDE_EFFECT, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
link(new AMD64MathStub(LOG10, options, providers, registerStubCall(LOG10.foreignCallSignature, LEAF, NO_SIDE_EFFECT, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
link(new AMD64MathStub(POW, options, providers, registerStubCall(POW.foreignCallSignature, LEAF, NO_SIDE_EFFECT, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
link(new AMD64MathStub(CBRT, options, providers, registerStubCall(CBRT.foreignCallSignature, LEAF, NO_SIDE_EFFECT, COMPUTES_REGISTERS_KILLED, NO_LOCATIONS)));
} else {
super.registerMathStubs(hotSpotVMConfig, providers, options);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -49,24 +49,16 @@ public AMD64MathStub(BinaryOperation operation, OptionValues options, HotSpotPro
}

private static String snippetName(UnaryOperation operation) {
switch (operation) {
case SIN:
return "sin";
case COS:
return "cos";
case TAN:
return "tan";
case TANH:
return "tanh";
case EXP:
return "exp";
case LOG:
return "log";
case LOG10:
return "log10";
default:
throw GraalError.shouldNotReachHere("Unknown operation " + operation); // ExcludeFromJacocoGeneratedReport
}
return switch (operation) {
case SIN -> "sin";
case COS -> "cos";
case TAN -> "tan";
case TANH -> "tanh";
case EXP -> "exp";
case LOG -> "log";
case LOG10 -> "log10";
case CBRT -> "cbrt";
};
}

private static String snippetName(BinaryOperation operation) {
Expand Down Expand Up @@ -115,4 +107,9 @@ private static double exp(double value) {
private static double pow(double value1, double value2) {
return BinaryMathIntrinsicNode.compute(value1, value2, BinaryOperation.POW);
}

@Snippet
private static double cbrt(double value) {
return UnaryMathIntrinsicNode.compute(value, UnaryOperation.CBRT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
import static jdk.graal.compiler.hotspot.stubs.UnwindExceptionToCallerStub.EXCEPTION_HANDLER_FOR_RETURN_ADDRESS;
import static jdk.graal.compiler.nodes.java.ForeignCallDescriptors.REGISTER_FINALIZER;
import static jdk.graal.compiler.replacements.nodes.BinaryMathIntrinsicNode.BinaryOperation.POW;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.CBRT;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.COS;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.EXP;
import static jdk.graal.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.LOG;
Expand Down Expand Up @@ -706,6 +707,9 @@ protected void registerMathStubs(GraalHotSpotVMConfig hotSpotVMConfig, HotSpotPr
if (hotSpotVMConfig.arithmeticTanhAddress != 0L) {
registerForeignCall(createDescriptor(TANH.foreignCallSignature, LEAF, NO_SIDE_EFFECT, NO_LOCATIONS), hotSpotVMConfig.arithmeticTanhAddress, NativeCall);
}
if (hotSpotVMConfig.arithmeticCbrtAddress != 0L) {
registerForeignCall(createDescriptor(CBRT.foreignCallSignature, LEAF, NO_SIDE_EFFECT, NO_LOCATIONS), hotSpotVMConfig.arithmeticCbrtAddress, NativeCall);
}
}

private void registerSnippetStubs(HotSpotProviders providers, OptionValues options) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ public UnimplementedGraalIntrinsics(Architecture arch) {
// HotSpot runtime does not implement C2Compiler::is_intrinsic_supported for the
// following intrinsics properly
add(ignore,
// JDK-8355644
"java/lang/Math.cbrt(D)D",
// JDK-8338694
"java/lang/Math.tanh(D)D",
// JDK-8309130
Expand Down
Loading