# HG changeset patch # User Doug Simon # Date 1442582201 -7200 # Node ID 784ba407d663dd1868fc046aafb9a80856de943c # Parent 6d7173d9e720163a0612c5e6fd1d310430ca1389 added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance diff -r 6d7173d9e720 -r 784ba407d663 graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java --- a/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Fri Sep 18 15:05:31 2015 +0200 +++ b/graal/com.oracle.graal.hotspot.test/src/com/oracle/graal/hotspot/test/HotSpotCryptoSubstitutionTest.java Fri Sep 18 15:16:41 2015 +0200 @@ -23,6 +23,7 @@ package com.oracle.graal.hotspot.test; import static com.oracle.graal.graphbuilderconf.IntrinsicContext.CompilationContext.ROOT_COMPILATION; +import static jdk.internal.jvmci.hotspot.CompilerToVM.compilerToVM; import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import java.io.ByteArrayOutputStream; @@ -40,7 +41,6 @@ import jdk.internal.jvmci.code.CompilationResult; import jdk.internal.jvmci.code.InstalledCode; import jdk.internal.jvmci.hotspot.HotSpotCompiledNmethod; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; import jdk.internal.jvmci.hotspot.HotSpotNmethod; import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethod; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; @@ -68,7 +68,7 @@ HotSpotResolvedJavaMethod hsMethod = (HotSpotResolvedJavaMethod) method; HotSpotNmethod installedCode = new HotSpotNmethod(hsMethod, compResult.getName(), true); HotSpotCompiledNmethod compiledNmethod = new HotSpotCompiledNmethod(hsMethod, compResult); - int result = HotSpotJVMCIRuntime.runtime().getCompilerToVM().installCode(getTarget(), compiledNmethod, installedCode, null); + int result = compilerToVM().installCode(getTarget(), compiledNmethod, installedCode, null); HotSpotVMConfig config = config(); Assert.assertEquals("Error installing method " + method + ": " + config.getCodeInstallResultDescription(result), result, config.codeInstallResultOk); diff -r 6d7173d9e720 -r 784ba407d663 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Fri Sep 18 15:05:31 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalRuntime.java Fri Sep 18 15:16:41 2015 +0200 @@ -29,6 +29,7 @@ import static com.oracle.graal.debug.GraalDebugConfig.MethodFilter; import static com.oracle.graal.debug.GraalDebugConfig.Verify; import static com.oracle.graal.debug.GraalDebugConfig.areScopedMetricsOrTimersEnabled; +import static jdk.internal.jvmci.hotspot.CompilerToVM.compilerToVM; import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime.runtime; import static jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import static jdk.internal.jvmci.inittimer.InitTimer.timer; @@ -170,7 +171,7 @@ } } - BenchmarkCounters.initialize(runtime().getCompilerToVM()); + BenchmarkCounters.initialize(jvmciRuntime.getCompilerToVM()); assert checkArrayIndexScaleInvariants(); @@ -272,6 +273,6 @@ phaseTransition("final"); SnippetCounter.printGroups(TTY.out().out()); - BenchmarkCounters.shutdown(runtime().getCompilerToVM(), runtimeStartTime); + BenchmarkCounters.shutdown(compilerToVM(), runtimeStartTime); } } diff -r 6d7173d9e720 -r 784ba407d663 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java Fri Sep 18 15:05:31 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/PrintStreamOption.java Fri Sep 18 15:16:41 2015 +0200 @@ -22,6 +22,8 @@ */ package com.oracle.graal.hotspot; +import static jdk.internal.jvmci.hotspot.CompilerToVM.compilerToVM; + import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; @@ -30,7 +32,6 @@ import java.lang.management.ManagementFactory; import jdk.internal.jvmci.hotspot.CompilerToVM; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; import jdk.internal.jvmci.options.OptionValue; /** @@ -104,7 +105,7 @@ private CompilerToVM vm() { if (vm == null) { - vm = HotSpotJVMCIRuntime.runtime().getCompilerToVM(); + vm = compilerToVM(); } return vm; } diff -r 6d7173d9e720 -r 784ba407d663 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Fri Sep 18 15:05:31 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Fri Sep 18 15:16:41 2015 +0200 @@ -24,8 +24,8 @@ import static com.oracle.graal.compiler.common.GraalOptions.ImmutableCode; import static com.oracle.graal.compiler.common.GraalOptions.VerifyPhases; +import static jdk.internal.jvmci.hotspot.CompilerToVM.compilerToVM; import jdk.internal.jvmci.hotspot.CompilerToVM; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; import jdk.internal.jvmci.options.DerivedOptionValue; import jdk.internal.jvmci.options.DerivedOptionValue.OptionSupplier; @@ -166,7 +166,7 @@ * @return a possibly modified graph builder suite */ public static PhaseSuite withSimpleDebugInfoIfRequested(PhaseSuite gbs) { - if (HotSpotJVMCIRuntime.runtime().getCompilerToVM().shouldDebugNonSafepoints()) { + if (compilerToVM().shouldDebugNonSafepoints()) { PhaseSuite newGbs = gbs.copy(); GraphBuilderPhase graphBuilderPhase = (GraphBuilderPhase) newGbs.findPhase(GraphBuilderPhase.class).previous(); GraphBuilderConfiguration graphBuilderConfig = graphBuilderPhase.getGraphBuilderConfig(); diff -r 6d7173d9e720 -r 784ba407d663 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Fri Sep 18 15:05:31 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/stubs/Stub.java Fri Sep 18 15:16:41 2015 +0200 @@ -25,6 +25,7 @@ import static com.oracle.graal.compiler.GraalCompiler.emitBackEnd; import static com.oracle.graal.compiler.GraalCompiler.emitFrontEnd; import static com.oracle.graal.compiler.GraalCompiler.getProfilingInfo; +import static jdk.internal.jvmci.hotspot.CompilerToVM.compilerToVM; import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import java.util.ArrayList; @@ -43,7 +44,6 @@ import jdk.internal.jvmci.common.JVMCIError; import jdk.internal.jvmci.hotspot.HotSpotCodeCacheProvider; import jdk.internal.jvmci.hotspot.HotSpotCompiledCode; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; import jdk.internal.jvmci.meta.ResolvedJavaMethod; @@ -213,7 +213,7 @@ HotSpotRuntimeStub installedCode = new HotSpotRuntimeStub(stub); HotSpotCompiledCode hsCompResult = new HotSpotCompiledRuntimeStub(compResult); - int result = HotSpotJVMCIRuntime.runtime().getCompilerToVM().installCode(backend.getTarget(), hsCompResult, installedCode, null); + int result = compilerToVM().installCode(backend.getTarget(), hsCompResult, installedCode, null); HotSpotVMConfig config = config(); if (result != config.codeInstallResultOk) { throw new JVMCIError("Error installing stub %s: %s", Stub.this, config.getCodeInstallResultDescription(result)); diff -r 6d7173d9e720 -r 784ba407d663 graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java --- a/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Fri Sep 18 15:05:31 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Fri Sep 18 15:16:41 2015 +0200 @@ -31,6 +31,7 @@ import static com.oracle.graal.truffle.TruffleCompilerOptions.TruffleCompilationExceptionsAreThrown; import static com.oracle.graal.truffle.hotspot.UnsafeAccess.UNSAFE; import static jdk.internal.jvmci.code.CodeUtil.getCallingConvention; +import static jdk.internal.jvmci.hotspot.CompilerToVM.compilerToVM; import static jdk.internal.jvmci.hotspot.HotSpotVMConfig.config; import java.util.Arrays; @@ -54,8 +55,6 @@ import jdk.internal.jvmci.code.CodeCacheProvider; import jdk.internal.jvmci.code.CompilationResult; import jdk.internal.jvmci.common.JVMCIError; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntime; -import jdk.internal.jvmci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethod; import jdk.internal.jvmci.hotspot.HotSpotSpeculationLog; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; @@ -242,7 +241,7 @@ MetaAccessProvider metaAccess = providers.getMetaAccess(); Plugins plugins = new Plugins(new InvocationPlugins(metaAccess)); - boolean infoPoints = getJVMCIRuntime().getCompilerToVM().shouldDebugNonSafepoints(); + boolean infoPoints = compilerToVM().shouldDebugNonSafepoints(); GraphBuilderConfiguration config = infoPoints ? GraphBuilderConfiguration.getInfopointEagerDefault(plugins) : GraphBuilderConfiguration.getEagerDefault(plugins); new GraphBuilderPhase.Instance(metaAccess, providers.getStampProvider(), providers.getConstantReflection(), config, OptimisticOptimizations.ALL, null).apply(graph); @@ -351,7 +350,7 @@ @Override public void invalidateInstalledCode(OptimizedCallTarget optimizedCallTarget, Object source, CharSequence reason) { - getJVMCIRuntime().getCompilerToVM().invalidateInstalledCode(optimizedCallTarget); + compilerToVM().invalidateInstalledCode(optimizedCallTarget); getCompilationNotify().notifyCompilationInvalidated(optimizedCallTarget, source, reason); } @@ -362,7 +361,7 @@ @Override public boolean platformEnableInfopoints() { - return getJVMCIRuntime().getCompilerToVM().shouldDebugNonSafepoints(); + return compilerToVM().shouldDebugNonSafepoints(); } @Override