changeset 22725:58066bba9a1c

added CodeCacheProvider.shouldDebugNonSafepoints and made CompilerToVM.shouldDebugNonSafepoints package-private
author Doug Simon <doug.simon@oracle.com>
date Tue, 29 Sep 2015 17:49:27 +0200
parents c7569b8dc482
children e29ef4820ddc
files graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotGraalCompiler.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java mx.graal/suite.py
diffstat 4 files changed, 33 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- 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<HighTierContext> getGraphBuilderSuite(HotSpotProviders providers, boolean isOSR) {
-        PhaseSuite<HighTierContext> suite = HotSpotSuitesProvider.withSimpleDebugInfoIfRequested(providers.getSuites().getDefaultGraphBuilderSuite());
+        PhaseSuite<HighTierContext> suite = providers.getSuites().getDefaultGraphBuilderSuite();
+        if (providers.getCodeCache().shouldDebugNonSafepoints()) {
+            suite = HotSpotSuitesProvider.withSimpleDebugInfo(suite);
+        }
         if (isOSR) {
             suite = suite.copy();
             suite.appendPhase(new OnStackReplacementPhase());
--- 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<HighTierContext> withSimpleDebugInfoIfRequested(PhaseSuite<HighTierContext> gbs) {
-        if (compilerToVM().shouldDebugNonSafepoints()) {
-            PhaseSuite<HighTierContext> 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<HighTierContext> withSimpleDebugInfo(PhaseSuite<HighTierContext> gbs) {
+        PhaseSuite<HighTierContext> 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() {
--- 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<HighTierContext> graphBuilderSuite = getGraphBuilderSuite(suitesProvider);
-        CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false);
+        PhaseSuite<HighTierContext> 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<HighTierContext> getGraphBuilderSuite(SuitesProvider suitesProvider) {
+    private static PhaseSuite<HighTierContext> getGraphBuilderSuite(CodeCacheProvider codeCache, SuitesProvider suitesProvider) {
         PhaseSuite<HighTierContext> 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
--- 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"},