From 2b9e5aa4ad55e7be7a812de83228c1fe853a114d Mon Sep 17 00:00:00 2001 From: Doug Simon Date: Mon, 19 Mar 2018 12:13:59 +0100 Subject: [PATCH] better identify community edition --- compiler/mx.compiler/mx_graal_benchmark.py | 2 +- ...java => CommunityCompilerConfiguration.java} | 5 ++++- .../phases/EconomyCompilerConfiguration.java | 4 ++++ .../aarch64/AArch64HotSpotBackendFactory.java | 2 +- .../amd64/AMD64HotSpotBackendFactory.java | 2 +- .../sparc/SPARCHotSpotBackendFactory.java | 2 +- ... CommunityCompilerConfigurationFactory.java} | 17 ++++++++++++----- .../EconomyCompilerConfigurationFactory.java | 7 +++++-- .../svm/core/graal/GraalConfiguration.java | 4 ++-- .../oracle/svm/hosted/NativeImageGenerator.java | 4 ++-- 10 files changed, 33 insertions(+), 16 deletions(-) rename compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/{CoreCompilerConfiguration.java => CommunityCompilerConfiguration.java} (95%) rename compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/{CoreCompilerConfigurationFactory.java => CommunityCompilerConfigurationFactory.java} (70%) diff --git a/compiler/mx.compiler/mx_graal_benchmark.py b/compiler/mx.compiler/mx_graal_benchmark.py index 4275b909c84f..3885c7e50649 100644 --- a/compiler/mx.compiler/mx_graal_benchmark.py +++ b/compiler/mx.compiler/mx_graal_benchmark.py @@ -167,7 +167,7 @@ def build_jvmci_vm_variants(raw_name, raw_config_name, extra_args, variants, inc ('limit-truffle-inlining', ['-Dgraal.TruffleMaximumRecursiveInlining=2'], 0), ('no-splitting-limit-truffle-inlining', ['-Dgraal.TruffleSplitting=false', '-Dgraal.TruffleMaximumRecursiveInlining=2'], 0), ] -build_jvmci_vm_variants('server', 'graal-core', ['-server', '-XX:+EnableJVMCI', '-Dgraal.CompilerConfiguration=core', '-Djvmci.Compiler=graal'], _graal_variants, suite=_suite, priority=15) +build_jvmci_vm_variants('server', 'graal-core', ['-server', '-XX:+EnableJVMCI', '-Dgraal.CompilerConfiguration=community', '-Djvmci.Compiler=graal'], _graal_variants, suite=_suite, priority=15) # On 64 bit systems -client is not supported. Nevertheless, when running with -server, we can # force the VM to just compile code with C1 but not with C2 by adding option -XX:TieredStopAtLevel=1. diff --git a/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java b/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CommunityCompilerConfiguration.java similarity index 95% rename from compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java rename to compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CommunityCompilerConfiguration.java index d714edea6a4b..03d690fa81ed 100644 --- a/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CoreCompilerConfiguration.java +++ b/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CommunityCompilerConfiguration.java @@ -36,7 +36,10 @@ import org.graalvm.compiler.phases.tiers.LowTierContext; import org.graalvm.compiler.phases.tiers.MidTierContext; -public class CoreCompilerConfiguration implements CompilerConfiguration { +/** + * The default configuration for the community edition of Graal. + */ +public class CommunityCompilerConfiguration implements CompilerConfiguration { @Override public PhaseSuite createHighTier(OptionValues options) { diff --git a/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java b/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java index 12fc5f99dae1..88219dba52ba 100644 --- a/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java +++ b/compiler/src/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java @@ -36,6 +36,10 @@ import org.graalvm.compiler.phases.tiers.LowTierContext; import org.graalvm.compiler.phases.tiers.MidTierContext; +/** + * A compiler configuration that performs fewer Graal IR optimizations while using the same backend + * as the {@link CommunityCompilerConfiguration}. + */ public class EconomyCompilerConfiguration implements CompilerConfiguration { @Override diff --git a/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java b/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java index f25ff3d71f88..ba711a3da33d 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java +++ b/compiler/src/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java @@ -77,7 +77,7 @@ public class AArch64HotSpotBackendFactory implements HotSpotBackendFactory { @Override public String getName() { - return "core"; + return "community"; } @Override diff --git a/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java b/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java index 4b570049facc..792c5f944f30 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java +++ b/compiler/src/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java @@ -77,7 +77,7 @@ public class AMD64HotSpotBackendFactory implements HotSpotBackendFactory { @Override public String getName() { - return "core"; + return "community"; } @Override diff --git a/compiler/src/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java b/compiler/src/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java index 4abd8e73857d..2b56c04b9a4d 100644 --- a/compiler/src/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java +++ b/compiler/src/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java @@ -72,7 +72,7 @@ public class SPARCHotSpotBackendFactory implements HotSpotBackendFactory { @Override public String getName() { - return "core"; + return "community"; } @Override diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CommunityCompilerConfigurationFactory.java similarity index 70% rename from compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java rename to compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CommunityCompilerConfigurationFactory.java index 2dec94537726..d085e7b63a8d 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CoreCompilerConfigurationFactory.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CommunityCompilerConfigurationFactory.java @@ -22,23 +22,30 @@ */ package org.graalvm.compiler.hotspot; -import org.graalvm.compiler.core.phases.CoreCompilerConfiguration; +import org.graalvm.compiler.core.phases.CommunityCompilerConfiguration; import org.graalvm.compiler.phases.tiers.CompilerConfiguration; import org.graalvm.compiler.serviceprovider.ServiceProvider; +/** + * Factory for creating the default configuration for the community edition of Graal. + */ @ServiceProvider(CompilerConfigurationFactory.class) -public class CoreCompilerConfigurationFactory extends CompilerConfigurationFactory { +public class CommunityCompilerConfigurationFactory extends CompilerConfigurationFactory { - public static final String NAME = "core"; + public static final String NAME = "community"; + /** + * Must be greater than {@link EconomyCompilerConfigurationFactory#AUTO_SELECTION_PRIORITY}. + */ public static final int AUTO_SELECTION_PRIORITY = 2; - public CoreCompilerConfigurationFactory() { + public CommunityCompilerConfigurationFactory() { super(NAME, AUTO_SELECTION_PRIORITY); + assert AUTO_SELECTION_PRIORITY > EconomyCompilerConfigurationFactory.AUTO_SELECTION_PRIORITY; } @Override public CompilerConfiguration createCompilerConfiguration() { - return new CoreCompilerConfiguration(); + return new CommunityCompilerConfiguration(); } } diff --git a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java index c9e4c087c90f..ac0b4524637f 100644 --- a/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java +++ b/compiler/src/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java @@ -26,6 +26,9 @@ import org.graalvm.compiler.phases.tiers.CompilerConfiguration; import org.graalvm.compiler.serviceprovider.ServiceProvider; +/** + * Factory that creates a {@link EconomyCompilerConfiguration}. + */ @ServiceProvider(CompilerConfigurationFactory.class) public class EconomyCompilerConfigurationFactory extends CompilerConfigurationFactory { @@ -44,7 +47,7 @@ public CompilerConfiguration createCompilerConfiguration() { @Override public BackendMap createBackendMap() { - // the economy configuration only differs in the frontend, it reuses the "core" backend - return new DefaultBackendMap(CoreCompilerConfigurationFactory.NAME); + // the economy configuration only differs in the frontend, it reuses the "community" backend + return new DefaultBackendMap(CommunityCompilerConfigurationFactory.NAME); } } diff --git a/substratevm/src/com.oracle.svm.core.graal/src/com/oracle/svm/core/graal/GraalConfiguration.java b/substratevm/src/com.oracle.svm.core.graal/src/com/oracle/svm/core/graal/GraalConfiguration.java index 51fb364839ff..6eabc9545cbc 100644 --- a/substratevm/src/com.oracle.svm.core.graal/src/com/oracle/svm/core/graal/GraalConfiguration.java +++ b/substratevm/src/com.oracle.svm.core.graal/src/com/oracle/svm/core/graal/GraalConfiguration.java @@ -32,7 +32,7 @@ import org.graalvm.compiler.core.gen.NodeMatchRules; import org.graalvm.compiler.core.match.MatchRuleRegistry; import org.graalvm.compiler.core.match.MatchStatement; -import org.graalvm.compiler.core.phases.CoreCompilerConfiguration; +import org.graalvm.compiler.core.phases.CommunityCompilerConfiguration; import org.graalvm.compiler.core.target.Backend; import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.nodes.StructuredGraph; @@ -69,7 +69,7 @@ public LoweringProvider createLoweringProvider(MetaAccessProvider metaAccess, Fo } public Suites createSuites(OptionValues options, @SuppressWarnings("unused") boolean hosted) { - return Suites.createSuites(new CoreCompilerConfiguration(), options); + return Suites.createSuites(new CommunityCompilerConfiguration(), options); } public void populateMatchRuleRegistry(HashMap, EconomicMap, List>> matchRuleRegistry) { diff --git a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGenerator.java b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGenerator.java index cec8d5e53cec..1efb13d89b67 100644 --- a/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGenerator.java +++ b/substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/NativeImageGenerator.java @@ -64,7 +64,7 @@ import org.graalvm.compiler.core.common.CompressEncoding; import org.graalvm.compiler.core.common.GraalOptions; import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; -import org.graalvm.compiler.core.phases.CoreCompilerConfiguration; +import org.graalvm.compiler.core.phases.CommunityCompilerConfiguration; import org.graalvm.compiler.core.target.Backend; import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.debug.DebugDumpScope; @@ -1158,7 +1158,7 @@ public static Suites createSuites(FeatureHandler featureHandler, RuntimeConfigur @SuppressWarnings("unused") public static LIRSuites createLIRSuites(FeatureHandler featureHandler, Providers providers, boolean hosted) { - LIRSuites lirSuites = Suites.createLIRSuites(new CoreCompilerConfiguration(), hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton()); + LIRSuites lirSuites = Suites.createLIRSuites(new CommunityCompilerConfiguration(), hosted ? HostedOptionValues.singleton() : RuntimeOptionValues.singleton()); /* Add phases that just perform assertion checking. */ assert addAssertionLIRPhases(lirSuites, hosted); return lirSuites;