# HG changeset patch # User Tom Rodriguez # Date 1430356181 25200 # Node ID 31a1589aecdff05002d52c195c708906b3e403c7 # Parent 060e6f7ac89e962e7474989f37edce6257b30738 Make Truffle respect -XX:+DebugNonSafepoints diff -r 060e6f7ac89e -r 31a1589aecdf graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderConfiguration.java --- a/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderConfiguration.java Wed Apr 29 17:31:05 2015 +0200 +++ b/graal/com.oracle.graal.graphbuilderconf/src/com/oracle/graal/graphbuilderconf/GraphBuilderConfiguration.java Wed Apr 29 18:09:41 2015 -0700 @@ -237,10 +237,18 @@ return new GraphBuilderConfiguration(false, false, DebugInfoMode.SafePointsOnly, EMPTY, GraalOptions.OptLivenessAnalysis.getValue(), plugins); } + public static GraphBuilderConfiguration getInfopointDefault(Plugins plugins) { + return new GraphBuilderConfiguration(true, false, DebugInfoMode.Simple, EMPTY, GraalOptions.OptLivenessAnalysis.getValue(), plugins); + } + public static GraphBuilderConfiguration getEagerDefault(Plugins plugins) { return new GraphBuilderConfiguration(true, false, DebugInfoMode.SafePointsOnly, EMPTY, GraalOptions.OptLivenessAnalysis.getValue(), plugins); } + public static GraphBuilderConfiguration getInfopointEagerDefault(Plugins plugins) { + return new GraphBuilderConfiguration(true, false, DebugInfoMode.Simple, EMPTY, GraalOptions.OptLivenessAnalysis.getValue(), plugins); + } + public static GraphBuilderConfiguration getSnippetDefault(Plugins plugins) { return new GraphBuilderConfiguration(true, true, DebugInfoMode.SafePointsOnly, EMPTY, GraalOptions.OptLivenessAnalysis.getValue(), plugins); } diff -r 060e6f7ac89e -r 31a1589aecdf 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 Wed Apr 29 17:31:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Wed Apr 29 18:09:41 2015 -0700 @@ -181,7 +181,8 @@ MetaAccessProvider metaAccess = providers.getMetaAccess(); Plugins plugins = new Plugins(new InvocationPlugins(metaAccess)); - GraphBuilderConfiguration config = GraphBuilderConfiguration.getEagerDefault(plugins); + boolean infoPoints = HotSpotGraalRuntime.runtime().getCompilerToVM().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); @@ -305,6 +306,11 @@ } @Override + public boolean enableInfopoints() { + return HotSpotGraalRuntime.runtime().getCompilerToVM().shouldDebugNonSafepoints(); + } + + @Override public Collection getCallTargets() { return Collections.unmodifiableSet(callTargets.keySet()); } diff -r 060e6f7ac89e -r 31a1589aecdf graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Wed Apr 29 17:31:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/GraalTruffleRuntime.java Wed Apr 29 18:09:41 2015 -0700 @@ -281,6 +281,8 @@ public abstract void reinstallStubs(); + public abstract boolean enableInfopoints(); + private final class DispatchTruffleCompilationListener implements GraalTruffleCompilationListener { public void notifyCompilationQueued(OptimizedCallTarget target) { diff -r 060e6f7ac89e -r 31a1589aecdf graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Wed Apr 29 17:31:05 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/TruffleCompilerImpl.java Wed Apr 29 18:09:41 2015 -0700 @@ -97,7 +97,8 @@ GraphBuilderPhase phase = (GraphBuilderPhase) backend.getSuites().getDefaultGraphBuilderSuite().findPhase(GraphBuilderPhase.class).previous(); // copy all plugins from the host Plugins plugins = new Plugins(phase.getGraphBuilderConfig().getPlugins()); - this.config = GraphBuilderConfiguration.getDefault(plugins).withSkippedExceptionTypes(skippedExceptionTypes); + GraphBuilderConfiguration baseConfig = graalTruffleRuntime.enableInfopoints() ? GraphBuilderConfiguration.getInfopointDefault(plugins) : GraphBuilderConfiguration.getDefault(plugins); + this.config = baseConfig.withSkippedExceptionTypes(skippedExceptionTypes); this.partialEvaluator = new PartialEvaluator(providers, config, Graal.getRequiredCapability(SnippetReflectionProvider.class), backend.getTarget().arch);