# HG changeset patch # User Stefan Anzinger # Date 1410967434 25200 # Node ID 4a1ee9bebd33111bf727af3f58a31791bde8bec0 # Parent 832c8c93c949b6986192d507c9b36c477d6b62cb# Parent 8ca5e41dde86eb7107c9820e1abc32f5c0995cbd Merge diff -r 832c8c93c949 -r 4a1ee9bebd33 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed Sep 17 08:22:46 2014 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/CompilationTask.java Wed Sep 17 08:23:54 2014 -0700 @@ -52,7 +52,6 @@ import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.phases.*; import com.oracle.graal.java.*; -import com.oracle.graal.java.GraphBuilderConfiguration.DebugInfoMode; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; @@ -131,16 +130,6 @@ protected PhaseSuite getGraphBuilderSuite(HotSpotProviders providers) { PhaseSuite suite = providers.getSuites().getDefaultGraphBuilderSuite(); - - if (HotSpotGraalRuntime.runtime().getCompilerToVM().shouldDebugNonSafepoints()) { - // need to tweak the graph builder config - suite = suite.copy(); - GraphBuilderPhase graphBuilderPhase = (GraphBuilderPhase) suite.findPhase(GraphBuilderPhase.class).previous(); - GraphBuilderConfiguration graphBuilderConfig = graphBuilderPhase.getGraphBuilderConfig(); - GraphBuilderPhase newGraphBuilderPhase = new GraphBuilderPhase(graphBuilderConfig.withDebugInfoMode(DebugInfoMode.Simple)); - suite.findPhase(GraphBuilderPhase.class).set(newGraphBuilderPhase); - } - boolean osrCompilation = entryBCI != StructuredGraph.INVOCATION_ENTRY_BCI; if (osrCompilation) { suite = suite.copy(); diff -r 832c8c93c949 -r 4a1ee9bebd33 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 Wed Sep 17 08:22:46 2014 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java Wed Sep 17 08:23:54 2014 -0700 @@ -27,6 +27,7 @@ import com.oracle.graal.hotspot.*; import com.oracle.graal.hotspot.phases.*; import com.oracle.graal.java.*; +import com.oracle.graal.java.GraphBuilderConfiguration.*; import com.oracle.graal.options.*; import com.oracle.graal.phases.*; import com.oracle.graal.phases.tiers.*; @@ -75,7 +76,11 @@ protected PhaseSuite createGraphBuilderSuite() { PhaseSuite suite = new PhaseSuite<>(); - suite.appendPhase(new GraphBuilderPhase(GraphBuilderConfiguration.getDefault())); + GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(); + if (runtime.getCompilerToVM().shouldDebugNonSafepoints()) { + config = config.withDebugInfoMode(DebugInfoMode.Simple); + } + suite.appendPhase(new GraphBuilderPhase(config)); return suite; } } diff -r 832c8c93c949 -r 4a1ee9bebd33 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Wed Sep 17 08:22:46 2014 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/phases/OnStackReplacementPhase.java Wed Sep 17 08:23:54 2014 -0700 @@ -111,6 +111,6 @@ GraphUtil.killCFG(start); Debug.dump(graph, "OnStackReplacement result"); - new DeadCodeEliminationPhase(Optional).apply(graph); + new DeadCodeEliminationPhase(Required).apply(graph); } } diff -r 832c8c93c949 -r 4a1ee9bebd33 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java Wed Sep 17 08:22:46 2014 -0700 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderConfiguration.java Wed Sep 17 08:23:54 2014 -0700 @@ -38,7 +38,7 @@ public static enum DebugInfoMode { SafePointsOnly, /** - * This mode inserts {@link FullInfopointNode}s in places where no safepoints would be + * This mode inserts {@link SimpleInfopointNode}s in places where no safepoints would be * inserted: inlining boundaries, and line number switches. *

* In this mode the infopoint only have a location (method and bytecode index) and no @@ -50,11 +50,11 @@ */ Simple, /** - * In this mode, infopoints are generated in the same locations as in {@link #Simple} mode - * but the infopoints have access to the runtime values. + * In this mode, {@link FullInfopointNode}s are generated in the same locations as in + * {@link #Simple} mode but the infopoints have access to the runtime values. *

* This is relevant when code is to be generated for native, machine-code level debugging - * but can have a limit the amount of optimisation applied to the code. + * but can have a limit the amount of optimization applied to the code. */ Full, } diff -r 832c8c93c949 -r 4a1ee9bebd33 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 Sep 17 08:22:46 2014 -0700 +++ b/graal/com.oracle.graal.truffle.hotspot/src/com/oracle/graal/truffle/hotspot/HotSpotTruffleRuntime.java Wed Sep 17 08:23:54 2014 -0700 @@ -44,6 +44,7 @@ import com.oracle.graal.hotspot.meta.*; import com.oracle.graal.hotspot.nodes.*; import com.oracle.graal.java.*; +import com.oracle.graal.java.GraphBuilderConfiguration.*; import com.oracle.graal.lir.asm.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.spi.*; @@ -246,7 +247,7 @@ removeInliningPhase(suites); StructuredGraph graph = new StructuredGraph(javaMethod); new GraphBuilderPhase.Instance(metaAccess, GraphBuilderConfiguration.getEagerDefault(), OptimisticOptimizations.ALL).apply(graph); - PhaseSuite graphBuilderSuite = suitesProvider.getDefaultGraphBuilderSuite(); + PhaseSuite graphBuilderSuite = getGraphBuilderSuite(suitesProvider); CallingConvention cc = getCallingConvention(providers.getCodeCache(), Type.JavaCallee, graph.method(), false); Backend backend = Graal.getRequiredCapability(RuntimeProvider.class).getHostBackend(); CompilationResultBuilderFactory factory = getOptimizedCallTargetInstrumentationFactory(backend.getTarget().arch.getName(), javaMethod); @@ -259,6 +260,19 @@ return runtimeProvider.getHostBackend().getProviders(); } + private static PhaseSuite getGraphBuilderSuite(SuitesProvider suitesProvider) { + PhaseSuite graphBuilderSuite = suitesProvider.getDefaultGraphBuilderSuite(); + if (HotSpotGraalRuntime.runtime().getCompilerToVM().shouldDebugNonSafepoints()) { + // need to tweak the graph builder config + graphBuilderSuite = graphBuilderSuite.copy(); + GraphBuilderPhase graphBuilderPhase = (GraphBuilderPhase) graphBuilderSuite.findPhase(GraphBuilderPhase.class).previous(); + GraphBuilderConfiguration graphBuilderConfig = graphBuilderPhase.getGraphBuilderConfig(); + GraphBuilderPhase newGraphBuilderPhase = new GraphBuilderPhase(graphBuilderConfig.withDebugInfoMode(DebugInfoMode.Simple)); + graphBuilderSuite.findPhase(GraphBuilderPhase.class).set(newGraphBuilderPhase); + } + return graphBuilderSuite; + } + private static void removeInliningPhase(Suites suites) { ListIterator> inliningPhase = suites.getHighTier().findPhase(InliningPhase.class); if (inliningPhase != null) {