# HG changeset patch # User Gilles Duboscq # Date 1433945212 -7200 # Node ID 217b681df88f7183fd63abfcb18696e29cf67444 # Parent 763db13bd6f49af2b919792c0e0ff051caf4d8ab Make speculation log available in HighTierContext diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/CheckGraalInvariants.java Wed Jun 10 16:06:52 2015 +0200 @@ -90,7 +90,7 @@ PhaseSuite graphBuilderSuite = new PhaseSuite<>(); GraphBuilderConfiguration config = GraphBuilderConfiguration.getEagerDefault(new Plugins(new InvocationPlugins(metaAccess))); graphBuilderSuite.appendPhase(new GraphBuilderPhase(config)); - HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE); + HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE, null); Assume.assumeTrue(VerifyPhase.class.desiredAssertionStatus()); diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FinalizableSubclassTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FinalizableSubclassTest.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/FinalizableSubclassTest.java Wed Jun 10 16:06:52 2015 +0200 @@ -70,7 +70,7 @@ GraphBuilderConfiguration conf = GraphBuilderConfiguration.getSnippetDefault(getDefaultGraphBuilderPlugins()); new GraphBuilderPhase.Instance(getMetaAccess(), getProviders().getStampProvider(), getProviders().getConstantReflection(), conf, OptimisticOptimizations.ALL, null).apply(graph); - HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL); + HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, null); new InliningPhase(new CanonicalizerPhase()).apply(graph, context); new CanonicalizerPhase().apply(graph, context); return graph; diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/GraalCompilerTest.java Wed Jun 10 16:06:52 2015 +0200 @@ -369,7 +369,7 @@ } protected HighTierContext getDefaultHighTierContext() { - return new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL); + return new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, null); } protected SnippetReflectionProvider getSnippetReflection() { diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/StaticInterfaceFieldTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/StaticInterfaceFieldTest.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/StaticInterfaceFieldTest.java Wed Jun 10 16:06:52 2015 +0200 @@ -75,7 +75,7 @@ PhaseSuite graphBuilderSuite = new PhaseSuite<>(); GraphBuilderConfiguration config = GraphBuilderConfiguration.getEagerDefault(new Plugins(new InvocationPlugins(metaAccess))); graphBuilderSuite.appendPhase(new GraphBuilderPhase(config)); - HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE); + HighTierContext context = new HighTierContext(providers, graphBuilderSuite, OptimisticOptimizations.NONE, null); Assume.assumeTrue(VerifyPhase.class.desiredAssertionStatus()); diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/inlining/InliningTest.java Wed Jun 10 16:06:52 2015 +0200 @@ -233,7 +233,7 @@ StructuredGraph graph = eagerInfopointMode ? parseDebug(method, AllowAssumptions.YES) : parseEager(method, AllowAssumptions.YES); PhaseSuite graphBuilderSuite = eagerInfopointMode ? getCustomGraphBuilderSuite(GraphBuilderConfiguration.getFullDebugDefault(getDefaultGraphBuilderPlugins())) : getDefaultGraphBuilderSuite(); - HighTierContext context = new HighTierContext(getProviders(), graphBuilderSuite, OptimisticOptimizations.ALL); + HighTierContext context = new HighTierContext(getProviders(), graphBuilderSuite, OptimisticOptimizations.ALL, null); Debug.dump(graph, "Graph"); new CanonicalizerPhase().apply(graph, context); new InliningPhase(new CanonicalizerPhase()).apply(graph, context); diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java Wed Jun 10 16:06:52 2015 +0200 @@ -197,7 +197,7 @@ speculationLog.collectFailedSpeculations(); } - HighTierContext highTierContext = new HighTierContext(providers, graphBuilderSuite, optimisticOpts); + HighTierContext highTierContext = new HighTierContext(providers, graphBuilderSuite, optimisticOpts, speculationLog); if (graph.start().next() == null) { graphBuilderSuite.apply(graph, highTierContext); new DeadCodeEliminationPhase(Optional).apply(graph); diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/HighTierContext.java --- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/HighTierContext.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/tiers/HighTierContext.java Wed Jun 10 16:06:52 2015 +0200 @@ -24,6 +24,7 @@ import com.oracle.graal.phases.*; import com.oracle.graal.phases.util.*; +import com.oracle.jvmci.meta.*; public class HighTierContext extends PhaseContext { @@ -31,10 +32,13 @@ private final OptimisticOptimizations optimisticOpts; - public HighTierContext(Providers providers, PhaseSuite graphBuilderSuite, OptimisticOptimizations optimisticOpts) { + private SpeculationLog speculationLog; + + public HighTierContext(Providers providers, PhaseSuite graphBuilderSuite, OptimisticOptimizations optimisticOpts, SpeculationLog speculationLog) { super(providers); this.graphBuilderSuite = graphBuilderSuite; this.optimisticOpts = optimisticOpts; + this.speculationLog = speculationLog; } public PhaseSuite getGraphBuilderSuite() { @@ -44,4 +48,8 @@ public OptimisticOptimizations getOptimisticOptimizations() { return optimisticOpts; } + + public SpeculationLog getSpeculationLog() { + return speculationLog; + } } diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ArraysSubstitutionsTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ArraysSubstitutionsTest.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/ArraysSubstitutionsTest.java Wed Jun 10 16:06:52 2015 +0200 @@ -331,7 +331,7 @@ @Test public void testCanonicalLength() { StructuredGraph graph = parseEager("testCanonicalLengthSnippet", AllowAssumptions.NO); - HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL); + HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, null); new InliningPhase(new CanonicalizerPhase()).apply(graph, context); new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); @@ -347,7 +347,7 @@ @Test public void testCanonicalEqual() { StructuredGraph graph = parseEager("testCanonicalEqualSnippet", AllowAssumptions.NO); - HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL); + HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, null); new InliningPhase(new CanonicalizerPhase()).apply(graph, context); new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); @@ -361,7 +361,7 @@ @Test public void testVirtualEqual() { StructuredGraph graph = parseEager("testVirtualEqualSnippet", AllowAssumptions.NO); - HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL); + HighTierContext context = new HighTierContext(getProviders(), getDefaultGraphBuilderSuite(), OptimisticOptimizations.ALL, null); new InliningPhase(new CanonicalizerPhase()).apply(graph, context); new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); new PartialEscapePhase(false, new CanonicalizerPhase()).apply(graph, context); diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java --- a/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.replacements.test/src/com/oracle/graal/replacements/test/PointerTest.java Wed Jun 10 16:06:52 2015 +0200 @@ -395,7 +395,7 @@ } private void assertNumWordCasts(String snippetName, int expectedWordCasts) { - HighTierContext context = new HighTierContext(getProviders(), null, OptimisticOptimizations.ALL); + HighTierContext context = new HighTierContext(getProviders(), null, OptimisticOptimizations.ALL, null); StructuredGraph graph = parseEager(snippetName, AllowAssumptions.YES); new CanonicalizerPhase().apply(graph, context); diff -r 763db13bd6f4 -r 217b681df88f graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java --- a/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Wed Jun 10 16:28:01 2015 +0200 +++ b/graal/com.oracle.graal.truffle/src/com/oracle/graal/truffle/PartialEvaluator.java Wed Jun 10 16:06:52 2015 +0200 @@ -109,7 +109,7 @@ try (Scope s = Debug.scope("CreateGraph", graph); Indent indent = Debug.logAndIndent("createGraph %s", graph)) { PhaseContext baseContext = new PhaseContext(providers); - HighTierContext tierContext = new HighTierContext(providers, new PhaseSuite(), OptimisticOptimizations.NONE); + HighTierContext tierContext = new HighTierContext(providers, new PhaseSuite(), OptimisticOptimizations.NONE, null); fastPartialEvaluation(callTarget, graph, baseContext, tierContext);