hotspot/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java
changeset 46640 70bdce04c59b
parent 43972 1ade39b8381b
equal deleted inserted replaced
46638:3c5c50af29a7 46640:70bdce04c59b
    20  * or visit www.oracle.com if you need additional information or have any
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 package org.graalvm.compiler.core.test.ea;
    23 package org.graalvm.compiler.core.test.ea;
    24 
    24 
    25 import org.junit.Test;
       
    26 
       
    27 import org.graalvm.compiler.core.test.GraalCompilerTest;
    25 import org.graalvm.compiler.core.test.GraalCompilerTest;
    28 import org.graalvm.compiler.debug.Debug;
    26 import org.graalvm.compiler.debug.DebugContext;
    29 import org.graalvm.compiler.debug.Debug.Scope;
       
    30 import org.graalvm.compiler.debug.DebugDumpScope;
    27 import org.graalvm.compiler.debug.DebugDumpScope;
    31 import org.graalvm.compiler.graph.Node;
    28 import org.graalvm.compiler.graph.Node;
    32 import org.graalvm.compiler.nodes.FrameState;
    29 import org.graalvm.compiler.nodes.FrameState;
    33 import org.graalvm.compiler.nodes.StructuredGraph;
    30 import org.graalvm.compiler.nodes.StructuredGraph;
    34 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
    31 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions;
    38 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    35 import org.graalvm.compiler.phases.common.CanonicalizerPhase;
    39 import org.graalvm.compiler.phases.common.LoweringPhase;
    36 import org.graalvm.compiler.phases.common.LoweringPhase;
    40 import org.graalvm.compiler.phases.common.inlining.InliningPhase;
    37 import org.graalvm.compiler.phases.common.inlining.InliningPhase;
    41 import org.graalvm.compiler.phases.tiers.HighTierContext;
    38 import org.graalvm.compiler.phases.tiers.HighTierContext;
    42 import org.graalvm.compiler.phases.tiers.PhaseContext;
    39 import org.graalvm.compiler.phases.tiers.PhaseContext;
       
    40 import org.junit.Test;
    43 
    41 
    44 /**
    42 /**
    45  * Tests {@link AbstractNewObjectNode#simplify(org.graalvm.compiler.graph.spi.SimplifierTool)}.
    43  * Tests {@link AbstractNewObjectNode#simplify(org.graalvm.compiler.graph.spi.SimplifierTool)}.
    46  *
    44  *
    47  */
    45  */
    61         test("test1Snippet");
    59         test("test1Snippet");
    62     }
    60     }
    63 
    61 
    64     @SuppressWarnings("try")
    62     @SuppressWarnings("try")
    65     private void test(final String snippet) {
    63     private void test(final String snippet) {
    66         try (Scope s = Debug.scope("PoorMansEATest", new DebugDumpScope(snippet))) {
    64         DebugContext debug = getDebugContext();
       
    65         try (DebugContext.Scope s = debug.scope("PoorMansEATest", new DebugDumpScope(snippet))) {
    67             StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO);
    66             StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO);
    68             HighTierContext highTierContext = getDefaultHighTierContext();
    67             HighTierContext highTierContext = getDefaultHighTierContext();
    69             new InliningPhase(new CanonicalizerPhase()).apply(graph, highTierContext);
    68             new InliningPhase(new CanonicalizerPhase()).apply(graph, highTierContext);
    70             PhaseContext context = new PhaseContext(getProviders());
    69             PhaseContext context = new PhaseContext(getProviders());
    71             new LoweringPhase(new CanonicalizerPhase(), LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, context);
    70             new LoweringPhase(new CanonicalizerPhase(), LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, context);
    80                     }
    79                     }
    81                 }
    80                 }
    82             }
    81             }
    83             new CanonicalizerPhase().apply(graph, context);
    82             new CanonicalizerPhase().apply(graph, context);
    84         } catch (Throwable e) {
    83         } catch (Throwable e) {
    85             throw Debug.handle(e);
    84             throw debug.handle(e);
    86         }
    85         }
    87     }
    86     }
    88 }
    87 }