# HG changeset patch # User Roland Schatz # Date 1443097994 -7200 # Node ID 9409f7cec59a49d5e08a455a4437ca57f2d0b229 # Parent 976555bdc7c668e9be05af0ca69be62a84ab43b0 Remove dependency from HotSpotJVMCIRuntime to CompilerFactory. diff -r 976555bdc7c6 -r 9409f7cec59a jvmci/jdk.internal.jvmci.compiler/src/jdk/internal/jvmci/compiler/CompilerFactory.java --- a/jvmci/jdk.internal.jvmci.compiler/src/jdk/internal/jvmci/compiler/CompilerFactory.java Thu Sep 24 14:21:10 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.compiler/src/jdk/internal/jvmci/compiler/CompilerFactory.java Thu Sep 24 14:33:14 2015 +0200 @@ -22,7 +22,6 @@ */ package jdk.internal.jvmci.compiler; -import jdk.internal.jvmci.code.Architecture; import jdk.internal.jvmci.runtime.JVMCIRuntime; /** @@ -37,12 +36,6 @@ String getCompilerName(); /** - * Initialize an {@link Architecture}. The compiler has the opportunity to extend the - * {@link Architecture} description with a custom subclass. - */ - Architecture initializeArchitecture(Architecture arch); - - /** * Create a new instance of the {@link Compiler}. */ Compiler createCompiler(JVMCIRuntime runtime); diff -r 976555bdc7c6 -r 9409f7cec59a jvmci/jdk.internal.jvmci.hotspot.amd64/src/jdk/internal/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java --- a/jvmci/jdk.internal.jvmci.hotspot.amd64/src/jdk/internal/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java Thu Sep 24 14:21:10 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot.amd64/src/jdk/internal/jvmci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java Thu Sep 24 14:33:14 2015 +0200 @@ -30,7 +30,6 @@ import jdk.internal.jvmci.code.Architecture; import jdk.internal.jvmci.code.RegisterConfig; import jdk.internal.jvmci.code.TargetDescription; -import jdk.internal.jvmci.compiler.CompilerFactory; import jdk.internal.jvmci.hotspot.HotSpotCodeCacheProvider; import jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider; import jdk.internal.jvmci.hotspot.HotSpotJVMCIBackendFactory; @@ -104,12 +103,12 @@ return flags; } - protected TargetDescription createTarget(HotSpotVMConfig config, CompilerFactory compilerFactory) { + protected TargetDescription createTarget(HotSpotVMConfig config) { final int stackFrameAlignment = 16; final int implicitNullCheckLimit = 4096; final boolean inlineObjects = true; Architecture arch = new AMD64(computeFeatures(config), computeFlags(config)); - return new TargetDescription(compilerFactory.initializeArchitecture(arch), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); } protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { @@ -139,10 +138,10 @@ } @SuppressWarnings("try") - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, CompilerFactory compilerFactory, JVMCIBackend host) { + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { assert host == null; - TargetDescription target = createTarget(runtime.getConfig(), compilerFactory); + TargetDescription target = createTarget(runtime.getConfig()); RegisterConfig regConfig; HotSpotCodeCacheProvider codeCache; diff -r 976555bdc7c6 -r 9409f7cec59a jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java --- a/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java Thu Sep 24 14:21:10 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot.sparc/src/jdk/internal/jvmci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java Thu Sep 24 14:33:14 2015 +0200 @@ -29,7 +29,6 @@ import jdk.internal.jvmci.code.Architecture; import jdk.internal.jvmci.code.RegisterConfig; import jdk.internal.jvmci.code.TargetDescription; -import jdk.internal.jvmci.compiler.CompilerFactory; import jdk.internal.jvmci.hotspot.HotSpotCodeCacheProvider; import jdk.internal.jvmci.hotspot.HotSpotConstantReflectionProvider; import jdk.internal.jvmci.hotspot.HotSpotJVMCIBackendFactory; @@ -45,12 +44,12 @@ @ServiceProvider(HotSpotJVMCIBackendFactory.class) public class SPARCHotSpotJVMCIBackendFactory implements HotSpotJVMCIBackendFactory { - protected TargetDescription createTarget(HotSpotVMConfig config, CompilerFactory compilerFactory) { + protected TargetDescription createTarget(HotSpotVMConfig config) { final int stackFrameAlignment = 16; final int implicitNullCheckLimit = 4096; final boolean inlineObjects = false; Architecture arch = new SPARC(computeFeatures(config)); - return new TargetDescription(compilerFactory.initializeArchitecture(arch), true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); + return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); } protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { @@ -88,9 +87,9 @@ } @SuppressWarnings("try") - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, CompilerFactory compilerFactory, JVMCIBackend host) { + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { assert host == null; - TargetDescription target = createTarget(runtime.getConfig(), compilerFactory); + TargetDescription target = createTarget(runtime.getConfig()); HotSpotMetaAccessProvider metaAccess = new HotSpotMetaAccessProvider(runtime); RegisterConfig regConfig = new SPARCHotSpotRegisterConfig(target, runtime.getConfig()); diff -r 976555bdc7c6 -r 9409f7cec59a jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIBackendFactory.java --- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIBackendFactory.java Thu Sep 24 14:21:10 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIBackendFactory.java Thu Sep 24 14:33:14 2015 +0200 @@ -22,12 +22,11 @@ */ package jdk.internal.jvmci.hotspot; -import jdk.internal.jvmci.compiler.CompilerFactory; import jdk.internal.jvmci.runtime.JVMCIBackend; public interface HotSpotJVMCIBackendFactory { - JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, CompilerFactory compilerFactory, JVMCIBackend host); + JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host); /** * Gets the CPU architecture of this backend. diff -r 976555bdc7c6 -r 9409f7cec59a jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCICompilerConfig.java --- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCICompilerConfig.java Thu Sep 24 14:21:10 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCICompilerConfig.java Thu Sep 24 14:33:14 2015 +0200 @@ -22,7 +22,6 @@ */ package jdk.internal.jvmci.hotspot; -import jdk.internal.jvmci.code.Architecture; import jdk.internal.jvmci.common.JVMCIError; import jdk.internal.jvmci.compiler.Compiler; import jdk.internal.jvmci.compiler.CompilerFactory; @@ -42,10 +41,6 @@ return ""; } - public Architecture initializeArchitecture(Architecture arch) { - return arch; - } - public Compiler createCompiler(JVMCIRuntime runtime) { return this; } diff -r 976555bdc7c6 -r 9409f7cec59a jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java --- a/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java Thu Sep 24 14:21:10 2015 +0200 +++ b/jvmci/jdk.internal.jvmci.hotspot/src/jdk/internal/jvmci/hotspot/HotSpotJVMCIRuntime.java Thu Sep 24 14:33:14 2015 +0200 @@ -39,7 +39,6 @@ import jdk.internal.jvmci.code.InstalledCode; import jdk.internal.jvmci.common.JVMCIError; import jdk.internal.jvmci.compiler.Compiler; -import jdk.internal.jvmci.compiler.CompilerFactory; import jdk.internal.jvmci.compiler.StartupEventListener; import jdk.internal.jvmci.inittimer.InitTimer; import jdk.internal.jvmci.meta.JVMCIMetaAccessContext; @@ -158,10 +157,8 @@ factory = findFactory(hostArchitecture); } - CompilerFactory compilerFactory = HotSpotJVMCICompilerConfig.getCompilerFactory(); - try (InitTimer t = timer("create JVMCI backend:", hostArchitecture)) { - hostBackend = registerBackend(factory.createJVMCIBackend(this, compilerFactory, null)); + hostBackend = registerBackend(factory.createJVMCIBackend(this, null)); } vmEventListeners = Services.load(HotSpotVMEventListener.class);