Skip to content

Commit

Permalink
Merge with master.
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhaeubl committed Nov 4, 2024
2 parents bfcae90 + 8dc6edf commit 25ae2cd
Show file tree
Hide file tree
Showing 753 changed files with 18,799 additions and 11,638 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ni-layers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ jobs:
runs-on: ubuntu-latest
env:
GRAALVM_HOME: ${{ github.workspace }}/graalvm
timeout-minutes: 20
timeout-minutes: 30
needs: build-graalvm-and-populate-matrix
strategy:
fail-fast: false
Expand All @@ -120,4 +120,4 @@ jobs:
python-version: '${{ env.PYTHON_VERSION }}'
- name: Build layer
run: |
python3 ${{ env.LIBRARY_METADATA_PATH }}/build_native_image_layer.py ${{ env.GRAALVM_HOME }}/bin/native-image "${{ matrix.coordinates }}"
python3 ${{ env.LIBRARY_METADATA_PATH }}/build_native_image_layer.py ${{ env.GRAALVM_HOME }}/bin/native-image "${{ matrix.coordinates }}"
2 changes: 1 addition & 1 deletion .github/workflows/quarkus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ env:
DB_NAME: hibernate_orm_test
DB_PASSWORD: hibernate_orm_test
DB_USER: hibernate_orm_test
NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=5g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs -Dquarkus.native.container-build=false"
NATIVE_TEST_MAVEN_ARGS: "-Dtest-containers -Dstart-containers -Dquarkus.native.native-image-xmx=6g -Dnative -Dnative.surefire.skip -Dformat.skip -Dno-descriptor-tests install -DskipDocs -Dquarkus.native.container-build=false"
QUARKUS_JAVA_VERSION: 17 # Use Java 17 to build Quarkus as that's the lowest supported JDK version currently
QUARKUS_PATH: ${{ github.workspace }}/quarkus

Expand Down
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": "24", "build_id": "jdk-24+19-2105", "platformspecific": true, "extrabundles": ["static-libs"]},
"galahad-jdk": {"name": "jpg-jdk", "version": "24", "build_id": "jdk-24+21-2436", "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 @@

"oraclejdk23": {"name": "jpg-jdk", "version": "23", "build_id": "jdk-23+37", "platformspecific": true, "extrabundles": ["static-libs"]},

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

"eclipse": {
Expand Down
1 change: 1 addition & 0 deletions compiler/ci/ci_common/benchmark-builders.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.dacapo + PR_bench_libgraal,
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.scala_dacapo + PR_bench_libgraal,
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.renaissance + PR_bench_libgraal,
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.barista,
c.daily + c.opt_post_merge + hw.e3 + jdk + cc.libgraal + bench.specjvm2008 + PR_bench_libgraal,
c.on_demand + hw.e3 + jdk + cc.libgraal + bench.dacapo_size_variants,
c.on_demand + hw.e3 + jdk + cc.libgraal + bench.scala_dacapo_size_variants,
Expand Down
43 changes: 42 additions & 1 deletion compiler/ci/ci_common/benchmark-suites.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

// convenient sets of benchmark suites for easy reuse
groups:: {
open_suites:: unique_suites([$.awfy, $.dacapo, $.scala_dacapo, $.renaissance]),
open_suites:: unique_suites([$.awfy, $.dacapo, $.scala_dacapo, $.renaissance, $.barista]),
spec_suites:: unique_suites([$.specjvm2008, $.specjbb2015]),
jmh_micros_suites:: unique_suites([$.micros_graal_dist]),
graal_internals_suites:: unique_suites([$.micros_graal_whitebox]),
Expand Down Expand Up @@ -115,6 +115,47 @@

renaissance: self.renaissance_template(),

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 + {
suite:: suite_name,
local barista_version = "v0.2.0",
local suite_version_args = if suite_version != null then ["--bench-suite-version=" + suite_version] else [],
local prefix_barista_arg = if std.length(cmd_app_prefix) > 0 then [std.format("--cmd-app-prefix=%s", std.join(" ", cmd_app_prefix))] else [],
local all_barista_args = prefix_barista_arg + non_prefix_barista_args,
local barista_args_with_separator = if std.length(all_barista_args) > 0 then ["--"] + all_barista_args else [],
downloads+: {
"WRK": { "name": "wrk", "version": "a211dd5", platformspecific: true},
"WRK2": { "name": "wrk2", "version": "2.1", platformspecific: true},
"BARISTA_BENCHMARKS": { "name": "barista", "version": "0.2.0"}
},
packages+: {
maven: "==3.8.6",
"pip:toml": "==0.10.2"
},
setup: [
["set-export", "PATH", "$WRK:$PATH"],
["set-export", "PATH", "$WRK2:$PATH"],
["git", "clone", "--depth", "1", "--branch", barista_version, ["mx", "urlrewrite", "https://github.com/graalvm/barista-suite.git"], "$BARISTA_HOME"],
["cp", "-r", "$BARISTA_BENCHMARKS/*", "$BARISTA_HOME"] // copy the prebuilt jar/nib files
] + super.setup,
run+: [
self.benchmark_cmd + ["barista:*"] + suite_version_args + ["--"] + self.extra_vm_args + barista_args_with_separator
],
notify_emails+: ["andrija.kolic@oracle.com"],
timelimit: "1:20:00",
should_use_hwloc: false, // hwloc-bind is passed to barista with '--cmd-app-prefix'
environment+: {
BARISTA_HOME: "$BUILD_DIR/barista-suite",
XMX: "500m"
},
min_jdk_version:: 8,
max_jdk_version:: max_jdk_version,
forks_batches:: 3,
bench_forks_per_batch:: 4,
forks_timelimit:: "3:30:00"
},

barista: self.barista_template(),

specjbb2015: cc.compiler_benchmark + c.heap.large_with_large_young_gen + bc.bench_no_thread_cap + {
suite:: "specjbb2015",
downloads+: {
Expand Down
2 changes: 2 additions & 0 deletions compiler/mx.compiler/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@
"dependencies" : [
"sdk:WORD",
"sdk:COLLECTIONS",
"sdk:NATIVEIMAGE",
"truffle:TRUFFLE_COMPILER",
],
"requires" : [
Expand Down Expand Up @@ -582,6 +583,7 @@
"distDependencies" : [
"sdk:COLLECTIONS",
"sdk:WORD",
"sdk:NATIVEIMAGE",
"truffle:TRUFFLE_COMPILER",
],
"allowsJavadocWarnings": True,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ protected void createExecute(AbstractProcessor processor, PrintWriter out, Injec
protected void createHelpers(AbstractProcessor processor, PrintWriter out, InjectedDependencies deps) {
out.printf("\n");
out.printf(" @Override\n");
out.printf(" public boolean replace(GraphBuilderContext b, GeneratedPluginInjectionProvider injection, Stamp stamp, NodeInputList<ValueNode> args) {\n");
out.printf(" public boolean replace(GraphBuilderContext b, Replacements injection, Stamp stamp, NodeInputList<ValueNode> args) {\n");

List<? extends VariableElement> params = intrinsicMethod.getParameters();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ protected void createHelpers(AbstractProcessor processor, PrintWriter out, Injec
}
out.printf("\n");
out.printf(" @Override\n");
out.printf(" public boolean replace(GraphBuilderContext b, GeneratedPluginInjectionProvider injection, Stamp stamp, NodeInputList<ValueNode> args) {\n");
out.printf(" public boolean replace(GraphBuilderContext b, Replacements injection, Stamp stamp, NodeInputList<ValueNode> args) {\n");

List<? extends VariableElement> params = getParameters();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ protected static void createImports(PrintWriter out, AbstractProcessor processor
if (plugin.needsReplacement(processor)) {
extra.add("jdk.graal.compiler.options.ExcludeFromJacocoGeneratedReport");
extra.add("jdk.graal.compiler.graph.NodeInputList");
extra.add("jdk.graal.compiler.nodes.spi.Replacements");
if (plugin.isWithExceptionReplacement(processor)) {
extra.add("jdk.graal.compiler.nodes.PluginReplacementWithExceptionNode");
} else {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* Copyright (c) 2024, 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.core.aarch64.test;

import jdk.graal.compiler.core.test.GraalCompilerTest;
import org.junit.Test;

/**
* Add/sub with an immediate MIN_VALUE may result in infinite recursion since MIN_VALUE < 0 and
* -MIN_VALUE < 0.
*/
public class AddSubInfiniteRecursionTest extends GraalCompilerTest {
public static int testAddIntMinValue(int arg) {
return arg + Integer.MIN_VALUE;
}

public static int testSubIntMinValue(int arg) {
return arg - Integer.MIN_VALUE;
}

@Test
public void runIntMinValue() {
test("testAddIntMinValue", 0);
test("testSubIntMinValue", 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;

import jdk.graal.compiler.test.SubprocessUtil;
import org.graalvm.word.LocationIdentity;
import org.junit.Assert;
import org.junit.Assume;
Expand Down Expand Up @@ -103,6 +102,7 @@
import jdk.graal.compiler.phases.util.Providers;
import jdk.graal.compiler.runtime.RuntimeProvider;
import jdk.graal.compiler.test.AddExports;
import jdk.graal.compiler.test.SubprocessUtil;
import jdk.internal.misc.Unsafe;
import jdk.vm.ci.code.BailoutException;
import jdk.vm.ci.code.Register;
Expand Down Expand Up @@ -325,6 +325,7 @@ public static void runTest(InvariantsTool tool) {
verifiers.add(new VerifyDebugUsage());
verifiers.add(new VerifyVirtualizableUsage());
verifiers.add(new VerifyUpdateUsages());
verifiers.add(new VerifyLibGraalContextChecks());
verifiers.add(new VerifyBailoutUsage());
verifiers.add(new VerifySystemPropertyUsage());
verifiers.add(new VerifyInstanceOfUsage());
Expand All @@ -344,6 +345,8 @@ public static void runTest(InvariantsTool tool) {
verifiers.add(new VerifyStringCaseUsage());
verifiers.add(new VerifyMathAbs());
verifiers.add(new VerifyLoopInfo());
verifiers.add(new VerifyRuntimeVersionFeature());
verifiers.add(new VerifyGuardsStageUsages());
VerifyAssertionUsage assertionUsages = null;
boolean checkAssertions = tool.checkAssertions();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@

import java.util.Optional;

import jdk.graal.compiler.debug.DebugOptions;
import org.junit.Assert;
import org.junit.Test;

import jdk.graal.compiler.api.directives.GraalDirectives;
import jdk.graal.compiler.core.common.GraalOptions;
import jdk.graal.compiler.debug.DebugOptions;
import jdk.graal.compiler.debug.TTY;
import jdk.graal.compiler.graph.Graph;
import jdk.graal.compiler.nodes.EndNode;
Expand All @@ -40,6 +40,7 @@
import jdk.graal.compiler.nodes.GraphState;
import jdk.graal.compiler.nodes.LoopBeginNode;
import jdk.graal.compiler.nodes.LoopEndNode;
import jdk.graal.compiler.nodes.LoopExitNode;
import jdk.graal.compiler.nodes.PhiNode;
import jdk.graal.compiler.nodes.StructuredGraph;
import jdk.graal.compiler.nodes.StructuredGraph.AllowAssumptions;
Expand Down Expand Up @@ -78,7 +79,7 @@ public void test01() {
test(opt, "snippet01");
Assert.fail("Should have detected that the phase in this class does not retain the mustNotSafepoint flag of a loop begin");
} catch (Throwable t) {
assert t.getMessage().contains("previously the loop had canHaveSafepoints=false but now it has canHaveSafepoints=true");
assert t.toString().contains("previously the loop had canHaveSafepoints=false but now it has canHaveSafepoints=true") : t;
}
}

Expand Down Expand Up @@ -144,6 +145,9 @@ protected void run(StructuredGraph graph, HighTierContext context) {

LoopBeginNode oldLoopBegin = lex.loopBegin();
EndNode fwd = oldLoopBegin.forwardEnd();
for (LoopExitNode exit : oldLoopBegin.loopExits().snapshot()) {
exit.setLoopBegin(lb);
}

FixedNode next = oldLoopBegin.next();
oldLoopBegin.setNext(null);
Expand All @@ -153,10 +157,8 @@ protected void run(StructuredGraph graph, HighTierContext context) {
lb.addForwardEnd(fwdEnd);

FixedWithNextNode fwn = (FixedWithNextNode) fwd.predecessor();
fwn.setNext(null);
GraphUtil.killCFG(fwd);
fwn.setNext(fwdEnd);

GraphUtil.killCFG(fwd);
}

});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@
*/
package jdk.graal.compiler.core.test;

import org.junit.Test;

import jdk.graal.compiler.nodes.StructuredGraph;
import jdk.graal.compiler.nodes.calc.NegateNode;
import jdk.graal.compiler.nodes.calc.RightShiftNode;
import jdk.graal.compiler.nodes.calc.UnsignedRightShiftNode;
import org.junit.Test;

public class NegateCanonicalizationTest extends GraalCompilerTest {

Expand All @@ -49,19 +50,37 @@ public static long signExtractLong(long x) {
return (x >> 63) >>> 63;
}

private void checkNodes(String methodName) {
public static int negateNegate(int x) {
int var0 = -x;
int var1 = -(0 ^ var0);
return var1;
}

public static int negateNotDecrement(int x) {
return -~(x - 1);
}

private void checkNodesOnlyUnsignedRightShift(String methodName) {
StructuredGraph graph = parseForCompile(getResolvedJavaMethod(methodName));
createCanonicalizerPhase().apply(graph, getProviders());
assertTrue(graph.getNodes().filter(NegateNode.class).count() == 0);
assertTrue(graph.getNodes().filter(RightShiftNode.class).count() == 0);
assertTrue(graph.getNodes().filter(UnsignedRightShiftNode.class).count() == 1);
}

private void checkNodesNoNegate(String methodName) {
StructuredGraph graph = parseForCompile(getResolvedJavaMethod(methodName));
createCanonicalizerPhase().apply(graph, getProviders());
assertTrue(graph.getNodes().filter(NegateNode.class).count() == 0);
}

@Test
public void testNegate() {
checkNodes("negateInt");
checkNodes("negateLong");
checkNodes("signExtractInt");
checkNodes("signExtractLong");
checkNodesOnlyUnsignedRightShift("negateInt");
checkNodesOnlyUnsignedRightShift("negateLong");
checkNodesOnlyUnsignedRightShift("signExtractInt");
checkNodesOnlyUnsignedRightShift("signExtractLong");
checkNodesNoNegate("negateNegate");
checkNodesNoNegate("negateNotDecrement");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@

import java.io.Serializable;

import jdk.graal.compiler.test.SubprocessUtil;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;

import jdk.graal.compiler.test.SubprocessUtil;
import jdk.vm.ci.meta.JavaTypeProfile;
import jdk.vm.ci.meta.ProfilingInfo;
import jdk.vm.ci.meta.ResolvedJavaMethod;
Expand Down Expand Up @@ -196,7 +196,6 @@ public ProfilingInfoTest() {

@Test
public void testExceptionSeen() {
Assume.assumeTrue("GR-45918", Runtime.version().feature() < 21);
// NullPointerException
ProfilingInfo info = profile("nullPointerExceptionSnippet", 5);
Assert.assertEquals(TriState.FALSE, info.getExceptionSeen(1));
Expand Down
Loading

0 comments on commit 25ae2cd

Please sign in to comment.