Skip to content

[GR-65266] Add support for Shenandoah #11941

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 8 additions & 1 deletion compiler/ci/ci_common/benchmark-builders.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@
for suite in bench.groups.main_suites
],

local shenandoah_builds = [
c.weekly + hw.x52 + jdk + cc.libgraal + cc.shenandoah_mode + suite,
for jdk in cc.product_jdks
for suite in bench.groups.main_suites + [bench.specjbb2015]
],

local metrics_suites = [bench.dacapo, bench.scala_dacapo, bench.renaissance, bench.specjvm2008],

local metrics_builds = std.flattenArrays([
Expand All @@ -92,7 +98,8 @@
for suite in metrics_suites
]),

local all_builds = main_builds + weekly_amd64_forks_builds + weekly_aarch64_forks_builds + profiling_builds + avx_builds + zgc_builds + zgc_avx_builds + aarch64_builds + metrics_builds,
local all_builds = main_builds + weekly_amd64_forks_builds + weekly_aarch64_forks_builds + profiling_builds + avx_builds + zgc_builds + zgc_avx_builds +
shenandoah_builds + aarch64_builds + metrics_builds,
local filtered_builds = [b for b in all_builds if b.is_jdk_supported(b.jdk_version) && b.is_arch_supported(b.arch)],
// adds a "defined_in" field to all builds mentioning the location of this current file
builds:: utils.add_defined_in(filtered_builds, std.thisFile),
Expand Down
7 changes: 7 additions & 0 deletions compiler/ci/ci_common/compiler-common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@
}
},

shenandoah_mode:: {
platform+:: "-shenandoah",
environment+: {
"JVM_CONFIG"+: "-shenandoah",
}
},

serialgc_mode:: {
platform+:: "-serialgc",
environment+: {
Expand Down
102 changes: 55 additions & 47 deletions compiler/ci/ci_common/gate.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,15 @@
test:: s.base(no_warning_as_error=true, extra_vm_args="-Djdk.graal.DetailedAsserts=true"),
unittest_compiler:: s.base(tags="build,unittest-compiler", no_warning_as_error=true, extra_vm_args="-Djdk.graal.DetailedAsserts=true"),
unittest_truffle:: s.base(tags="build,unittest-truffle", no_warning_as_error=true, extra_vm_args="-Djdk.graal.DetailedAsserts=true"),

test_zgc:: s.base(no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
unittest_compiler_zgc:: s.base(tags="build,unittest-compiler", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
unittest_truffle_zgc:: s.base(tags="build,unittest-truffle", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),

test_shenandoah:: s.base(no_warning_as_error=true, extra_vm_args="-XX:+UseShenandoahGC"),
unittest_compiler_shenandoah:: s.base(tags="build,unittest-compiler", no_warning_as_error=true, extra_vm_args="-XX:+UseShenandoahGC"),
unittest_truffle_shenandoah:: s.base(tags="build,unittest-truffle", no_warning_as_error=true, extra_vm_args="-XX:+UseShenandoahGC"),

test_serialgc:: s.base(no_warning_as_error=true, extra_vm_args="-XX:+UseSerialGC"),

jacoco_gate_args:: ["--jacoco-omit-excluded", "--jacoco-relativize-paths", "--jacoco-omit-src-gen", "--jacocout", "coverage", "--jacoco-format", "lcov"],
Expand Down Expand Up @@ -131,55 +137,39 @@

# Runs truffle tests in a mode similar to HotSpot's -Xcomp option
# (i.e. compile immediately without background compilation).
truffle_xcomp:: s.base("build,unittest",
truffle_xcomp_base(extra_vm_args=""):: s.base("build,unittest",
extra_vm_args="-Dpolyglot.engine.AllowExperimentalOptions=true " +
"-Dpolyglot.engine.CompileImmediately=true " +
"-Dpolyglot.engine.BackgroundCompilation=false " +
"-Dtck.inlineVerifierInstrument=false",
"-Dtck.inlineVerifierInstrument=false" + extra_vm_args,
extra_unittest_args="--verbose truffle") + {
environment+: {"TRACE_COMPILATION": "true"},
logs+: ["*/*_compilation.log"],
components+: ["truffle"],
},

truffle_xcomp_zgc:: s.base("build,unittest",
extra_vm_args="-Dpolyglot.engine.AllowExperimentalOptions=true " +
"-Dpolyglot.engine.CompileImmediately=true " +
"-Dpolyglot.engine.BackgroundCompilation=false " +
"-Dtck.inlineVerifierInstrument=false " +
"-XX:+UseZGC",
extra_unittest_args="--verbose truffle") + {
environment+: {"TRACE_COMPILATION": "true"},
logs+: ["*/*_compilation.log"],
components+: ["truffle"],
},

truffle_xcomp_serialgc:: s.base("build,unittest",
extra_vm_args="-Dpolyglot.engine.AllowExperimentalOptions=true " +
"-Dpolyglot.engine.CompileImmediately=true " +
"-Dpolyglot.engine.BackgroundCompilation=false " +
"-Dtck.inlineVerifierInstrument=false " +
"-XX:+UseSerialGC",
extra_unittest_args="--verbose truffle") + {
environment+: {"TRACE_COMPILATION": "true"},
logs+: ["*/*_compilation.log"],
components+: ["truffle"],
},
truffle_xcomp:: s.truffle_xcomp_base(),
truffle_xcomp_zgc:: s.truffle_xcomp_base(" -XX:+UseZGC"),
truffle_xcomp_shenandoah:: s.truffle_xcomp_base(" -XX:+UseShenandoahGC"),
truffle_xcomp_serialgc:: s.truffle_xcomp_base(" -XX:+UseSerialGC"),

ctw:: s.base("build,ctw", no_warning_as_error=true),
ctw_zgc:: s.base("build,ctw", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
ctw_shenandoah:: s.base("build,ctw", no_warning_as_error=true, extra_vm_args="-XX:+UseShenandoahGC"),

ctw_economy:: s.base("build,ctweconomy", extra_vm_args="-Djdk.graal.CompilerConfiguration=economy"),
ctw_phaseplan_fuzzing:: s.base("build,ctwphaseplanfuzzing"),

# Runs some benchmarks as tests
benchmarktest:: s.base("build,benchmarktest") + jmh_benchmark_test,
benchmarktest_zgc:: s.base("build,benchmarktest", extra_vm_args="-XX:+UseZGC") + jmh_benchmark_test,
benchmarktest_shenandoah:: s.base("build,benchmarktest", extra_vm_args="-XX:+UseShenandoahGC") + jmh_benchmark_test,

bootstrap:: s.base("build,bootstrap", no_warning_as_error=true),
bootstrap_lite:: s.base("build,bootstraplite", no_warning_as_error=true),
bootstrap_full:: s.base("build,bootstrapfullverify", no_warning_as_error=true),
bootstrap_full_zgc:: s.base("build,bootstrapfullverify", no_warning_as_error=true, extra_vm_args="-XX:+UseZGC"),
bootstrap_full_shenandoah:: s.base("build,bootstrapfullverify", no_warning_as_error=true, extra_vm_args="-XX:+UseShenandoahGC"),
bootstrap_economy:: s.base("build,bootstrapeconomy", no_warning_as_error=true, extra_vm_args="-Djdk.graal.CompilerConfiguration=economy"),

style:: c.deps.eclipse + c.deps.jdt + c.deps.spotbugs + s.base("style,fullbuild,javadoc") + galahad.exclude,
Expand Down Expand Up @@ -491,28 +481,45 @@
self.make_build(self.jdk_latest, "linux-amd64", "coverage_avx3").build
],

# Test ZGC on supported platforms. Windows requires version 1083 or later which will
# probably require adding some capabilities.
local all_zgc_builds = [self.make_build(jdk, os_arch, task).build + galahad.exclude
for jdk in [
self.jdk_latest
]
for os_arch in [
"linux-amd64",
"linux-aarch64",
"darwin-amd64",
"darwin-aarch64"
]
for task in [
"test_zgc",
"unittest_compiler_zgc",
"unittest_truffle_zgc",
"truffle_xcomp_zgc",
"ctw_zgc",
"benchmarktest_zgc",
"bootstrap_full_zgc",
]
],
# Test ZGC on supported platforms. Windows requires version 1083 or later which will
# probably require adding some capabilities.
local all_zgc_builds = [self.make_build(jdk, os_arch, task).build + galahad.exclude
for jdk in [
self.jdk_latest
]
for os_arch in [
"linux-amd64",
"linux-aarch64",
"darwin-amd64",
"darwin-aarch64"
]
for task in [
"test_zgc",
"unittest_compiler_zgc",
"unittest_truffle_zgc",
"truffle_xcomp_zgc",
"ctw_zgc",
"benchmarktest_zgc",
"bootstrap_full_zgc",
]
],

# Test Shenandoah on supported platforms.
local all_shenandoah_builds = [self.make_build(jdk, os_arch, task).build + galahad.exclude
for jdk in [
self.jdk_latest
]
for os_arch in all_os_arches
for task in [
"test_shenandoah",
"unittest_compiler_shenandoah",
"unittest_truffle_shenandoah",
"truffle_xcomp_shenandoah",
"ctw_shenandoah",
"benchmarktest_shenandoah",
"bootstrap_full_shenandoah",
]
],

# Run unittests with SerialGC.
local all_serialgc_builds = [self.make_build(self.jdk_latest, os_arch, task).build + galahad.exclude
Expand Down Expand Up @@ -563,6 +570,7 @@
all_platforms_builds +
all_coverage_builds +
all_zgc_builds +
all_shenandoah_builds +
all_serialgc_builds +
style_builds +
linux_amd64_jdk_latest_builds +
Expand Down
2 changes: 2 additions & 0 deletions compiler/ci/ci_includes/baseline-benchmarks.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
local gc_variants_builds = std.flattenArrays([
[
c.monthly + hw.x52 + jdk + cc.c2 + cc.zgc_mode + suite,
c.monthly + hw.x52 + jdk + cc.c2 + cc.shenandoah_mode + suite,
]
for jdk in cc.product_jdks
for suite in bench.groups.main_suites
Expand All @@ -68,6 +69,7 @@
c.monthly + hw.x52 + jdk + cc.c2 + cc.serialgc_mode + bench.microservice_benchmarks,
c.monthly + hw.x52 + jdk + cc.c2 + cc.pargc_mode + bench.microservice_benchmarks,
c.monthly + hw.x52 + jdk + cc.c2 + cc.zgc_mode + bench.microservice_benchmarks,
c.monthly + hw.x52 + jdk + cc.c2 + cc.shenandoah_mode + bench.microservice_benchmarks,
]
for jdk in cc.product_jdks
]),
Expand Down
1 change: 1 addition & 0 deletions compiler/mx.compiler/mx_graal_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
('zgc', ['-XX:+UseZGC'], 12),
('zgc-avx2', ['-XX:+UseZGC', '-XX:UseAVX=2'], 12),
('zgc-avx3', ['-XX:+UseZGC', '-XX:UseAVX=3'], 12),
('shenandoah', ['-XX:+UseShenandoahGC'], 12),
('no-comp-oops', ['-XX:-UseCompressedOops'], 0),
('no-profile-info', ['-Djvmci.UseProfilingInformation=false'], 0),
('no-splitting', ['-Dpolyglot.engine.Splitting=false'], 0),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
lateMacroInvoke.setTemplateProducer(new Supplier<SnippetTemplate>() {
@Override
public SnippetTemplate get() {
Arguments args = new Arguments(transplantTestSnippets.producer, GuardsStage.AFTER_FSA, LoweringTool.StandardLoweringStage.LOW_TIER);
Arguments args = new Arguments(transplantTestSnippets.producer, GuardsStage.AFTER_FSA, true, LoweringTool.StandardLoweringStage.LOW_TIER);
// no args
SnippetTemplate template = transplantTestSnippets.template(getProviders(), lateMacroInvoke, args);
return template;
Expand All @@ -118,7 +118,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
lateMacroInvoke.setTemplateProducer(new Supplier<SnippetTemplate>() {
@Override
public SnippetTemplate get() {
Arguments args = new Arguments(transplantTestSnippets.producerWithArgs, GuardsStage.AFTER_FSA, LoweringTool.StandardLoweringStage.LOW_TIER);
Arguments args = new Arguments(transplantTestSnippets.producerWithArgs, GuardsStage.AFTER_FSA, true, LoweringTool.StandardLoweringStage.LOW_TIER);
args.add("a", arg0);
args.add("b", arg1);
SnippetTemplate template = transplantTestSnippets.template(getProviders(), lateMacroInvoke, args);
Expand All @@ -142,7 +142,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Rec
lateMacroInvoke.setTemplateProducer(new Supplier<SnippetTemplate>() {
@Override
public SnippetTemplate get() {
Arguments args = new Arguments(transplantTestSnippets.producerWithDeopt, GuardsStage.AFTER_FSA, LoweringTool.StandardLoweringStage.LOW_TIER);
Arguments args = new Arguments(transplantTestSnippets.producerWithDeopt, GuardsStage.AFTER_FSA, true, LoweringTool.StandardLoweringStage.LOW_TIER);
args.add("a", arg0);
args.add("b", arg1);
SnippetTemplate template = transplantTestSnippets.template(getProviders(), lateMacroInvoke, args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,33 @@
*/
package jdk.graal.compiler.replacements.test;

import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;

import jdk.graal.compiler.api.directives.GraalDirectives;
import jdk.graal.compiler.api.test.Graal;
import jdk.graal.compiler.debug.DebugCloseable;
import jdk.graal.compiler.debug.DebugContext;
import jdk.graal.compiler.debug.GraalError;
import jdk.graal.compiler.hotspot.HotSpotGraalRuntime;
import jdk.graal.compiler.nodes.ValueNode;
import jdk.graal.compiler.nodes.graphbuilderconf.GraphBuilderContext;
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugin;
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins;
import jdk.graal.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration;
import jdk.graal.compiler.replacements.Snippets;
import jdk.graal.compiler.runtime.RuntimeProvider;
import jdk.graal.compiler.word.WordCastNode;
import org.junit.Test;

import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.ResolvedJavaMethod;

public class PointerTrackingTest extends ReplacementsTest implements Snippets {
@Before
public void before() {
HotSpotGraalRuntime runtime = (HotSpotGraalRuntime) Graal.getRequiredCapability(RuntimeProvider.class);
Assume.assumeTrue("doesn't aggressively move objects", runtime.getGarbageCollector() != HotSpotGraalRuntime.HotSpotGC.Shenandoah);
}

@Test
public void testTracking() {
Expand Down
Loading
Loading