# HG changeset patch # User Doug Simon # Date 1443541767 -7200 # Node ID 58066bba9a1c41746a8746772fae40aea2e66e18 # Parent c7569b8dc4825c9bd29434ce5befae81ece04247 added CodeCacheProvider.shouldDebugNonSafepoints and made CompilerToVM.shouldDebugNonSafepoints package-private diff -r c7569b8dc482 -r 58066bba9a1c graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompiler.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompiler.java Tue Sep 29 17:29:42 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompiler.java Tue Sep 29 17:49:27 2015 +0200 @@ -187,7 +187,10 @@ } protected PhaseSuite getGraphBuilderSuite(HotSpotProviders providers, boolean isOSR) { - PhaseSuite suite = HotSpotSuitesProvider.withSimpleDebugInfoIfRequested(providers.getSuites().getDefaultGraphBuilderSuite()); + PhaseSuite suite = providers.getSuites().getDefaultGraphBuilderSuite(); + if (providers.getCodeCache().shouldDebugNonSafepoints()) { + suite = HotSpotSuitesProvider.withSimpleDebugInfo(suite); + } if (isOSR) { suite = suite.copy(); suite.appendPhase(new OnStackReplacementPhase()); diff -r c7569b8dc482 -r 58066bba9a1c 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 Tue Sep 29 17:29:42 2015 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Tue Sep 29 17:49:27 2015 +0200 @@ -24,8 +24,6 @@ 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.HotSpotVMConfig; import jdk.internal.jvmci.options.DerivedOptionValue; import jdk.internal.jvmci.options.DerivedOptionValue.OptionSupplier; @@ -158,23 +156,18 @@ } /** - * Modifies the {@link GraphBuilderConfiguration} to build extra - * {@linkplain DebugInfoMode#Simple debug info} if the VM - * {@linkplain CompilerToVM#shouldDebugNonSafepoints() requests} it. + * Modifies a given {@link GraphBuilderConfiguration} to build extra + * {@linkplain DebugInfoMode#Simple debug info}. * - * @param gbs the current graph builder suite - * @return a possibly modified graph builder suite + * @param gbs the current graph builder suite to modify */ - public static PhaseSuite withSimpleDebugInfoIfRequested(PhaseSuite gbs) { - if (compilerToVM().shouldDebugNonSafepoints()) { - PhaseSuite newGbs = gbs.copy(); - GraphBuilderPhase graphBuilderPhase = (GraphBuilderPhase) newGbs.findPhase(GraphBuilderPhase.class).previous(); - GraphBuilderConfiguration graphBuilderConfig = graphBuilderPhase.getGraphBuilderConfig(); - GraphBuilderPhase newGraphBuilderPhase = new GraphBuilderPhase(graphBuilderConfig.withDebugInfoMode(DebugInfoMode.Simple)); - newGbs.findPhase(GraphBuilderPhase.class).set(newGraphBuilderPhase); - return newGbs; - } - return gbs; + public static PhaseSuite withSimpleDebugInfo(PhaseSuite gbs) { + PhaseSuite newGbs = gbs.copy(); + GraphBuilderPhase graphBuilderPhase = (GraphBuilderPhase) newGbs.findPhase(GraphBuilderPhase.class).previous(); + GraphBuilderConfiguration graphBuilderConfig = graphBuilderPhase.getGraphBuilderConfig(); + GraphBuilderPhase newGraphBuilderPhase = new GraphBuilderPhase(graphBuilderConfig.withDebugInfoMode(DebugInfoMode.Simple)); + newGbs.findPhase(GraphBuilderPhase.class).set(newGraphBuilderPhase); + return newGbs; } public LIRSuites getDefaultLIRSuites() { diff -r c7569b8dc482 -r 58066bba9a1c 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 Tue Sep 29 17:29:42 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Tue Sep 29 17:49:27 2015 +0200 @@ -25,13 +25,12 @@ import static com.oracle.graal.compiler.GraalCompiler.compileGraph; import static com.oracle.graal.compiler.GraalCompiler.getProfilingInfo; import static com.oracle.graal.graph.util.CollectionsAccess.newIdentityMap; -import static com.oracle.graal.hotspot.meta.HotSpotSuitesProvider.withSimpleDebugInfoIfRequested; +import static com.oracle.graal.hotspot.meta.HotSpotSuitesProvider.withSimpleDebugInfo; import static com.oracle.graal.truffle.TruffleCompilerOptions.TraceTruffleStackTraceLimit; import static com.oracle.graal.truffle.TruffleCompilerOptions.TraceTruffleTransferToInterpreter; 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; @@ -55,6 +54,7 @@ import jdk.internal.jvmci.code.CodeCacheProvider; import jdk.internal.jvmci.code.CompilationResult; import jdk.internal.jvmci.common.JVMCIError; +import jdk.internal.jvmci.hotspot.HotSpotCodeCacheProvider; import jdk.internal.jvmci.hotspot.HotSpotResolvedJavaMethod; import jdk.internal.jvmci.hotspot.HotSpotSpeculationLog; import jdk.internal.jvmci.hotspot.HotSpotVMConfig; @@ -241,12 +241,13 @@ MetaAccessProvider metaAccess = providers.getMetaAccess(); Plugins plugins = new Plugins(new InvocationPlugins(metaAccess)); - boolean infoPoints = compilerToVM().shouldDebugNonSafepoints(); + HotSpotCodeCacheProvider codeCache = providers.getCodeCache(); + boolean infoPoints = codeCache.shouldDebugNonSafepoints(); GraphBuilderConfiguration config = infoPoints ? GraphBuilderConfiguration.getInfopointEagerDefault(plugins) : GraphBuilderConfiguration.getEagerDefault(plugins); new GraphBuilderPhase.Instance(metaAccess, providers.getStampProvider(), providers.getConstantReflection(), config, OptimisticOptimizations.ALL, null).apply(graph); - PhaseSuite graphBuilderSuite = getGraphBuilderSuite(suitesProvider); - CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false); + PhaseSuite graphBuilderSuite = getGraphBuilderSuite(codeCache, suitesProvider); + CallingConvention cc = getCallingConvention(codeCache, Type.JavaCallee, graph.method(), false); Backend backend = getHotSpotBackend(); CompilationResultBuilderFactory factory = getOptimizedCallTargetInstrumentationFactory(backend.getTarget().arch.getName()); return compileGraph(graph, cc, javaMethod, providers, backend, graphBuilderSuite, OptimisticOptimizations.ALL, getProfilingInfo(graph), suites, lirSuites, new CompilationResult(), factory); @@ -261,9 +262,12 @@ return getHotSpotBackend().getProviders(); } - private static PhaseSuite getGraphBuilderSuite(SuitesProvider suitesProvider) { + private static PhaseSuite getGraphBuilderSuite(CodeCacheProvider codeCache, SuitesProvider suitesProvider) { PhaseSuite graphBuilderSuite = suitesProvider.getDefaultGraphBuilderSuite(); - return withSimpleDebugInfoIfRequested(graphBuilderSuite); + if (codeCache.shouldDebugNonSafepoints()) { + graphBuilderSuite = withSimpleDebugInfo(graphBuilderSuite); + } + return graphBuilderSuite; } private static void removeInliningPhase(Suites suites) { @@ -348,11 +352,14 @@ return false; } + private static CodeCacheProvider getCodeCache() { + Providers providers = getHotSpotProviders(); + return providers.getCodeCache(); + } + @Override public void invalidateInstalledCode(OptimizedCallTarget optimizedCallTarget, Object source, CharSequence reason) { - Providers providers = getHotSpotProviders(); - CodeCacheProvider codeCache = providers.getCodeCache(); - codeCache.invalidateInstalledCode(optimizedCallTarget); + getCodeCache().invalidateInstalledCode(optimizedCallTarget); getCompilationNotify().notifyCompilationInvalidated(optimizedCallTarget, source, reason); } @@ -363,7 +370,7 @@ @Override public boolean platformEnableInfopoints() { - return compilerToVM().shouldDebugNonSafepoints(); + return getCodeCache().shouldDebugNonSafepoints(); } @Override diff -r c7569b8dc482 -r 58066bba9a1c mx.graal/suite.py --- a/mx.graal/suite.py Tue Sep 29 17:29:42 2015 +0200 +++ b/mx.graal/suite.py Tue Sep 29 17:49:27 2015 +0200 @@ -6,7 +6,7 @@ "suites": [ { "name" : "jvmci", - "version" : "f53dfbf08c71ea1f202ef1f101a1d4ee374d9cab", + "version" : "19ce432d854d972ce44fee805ca7022927a67db2", "urls" : [ {"url" : "http://lafo.ssw.uni-linz.ac.at/hg/graal-jvmci-8", "kind" : "hg"}, {"url" : "https://curio.ssw.jku.at/nexus/content/repositories/snapshots", "kind" : "binary"},