src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java

Print this page

        

*** 20,40 **** * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.core.test; ! import org.junit.Test; ! ! import org.graalvm.compiler.debug.Debug; ! import org.graalvm.compiler.debug.Debug.Scope; import org.graalvm.compiler.debug.DebugDumpScope; import org.graalvm.compiler.loop.DefaultLoopPolicies; import org.graalvm.compiler.loop.phases.LoopUnswitchingPhase; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; import org.graalvm.compiler.phases.common.CanonicalizerPhase; import org.graalvm.compiler.phases.tiers.PhaseContext; public class LoopUnswitchTest extends GraalCompilerTest { public static int referenceSnippet1(int a) { int sum = 0; --- 20,38 ---- * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.compiler.core.test; ! import org.graalvm.compiler.debug.DebugContext; import org.graalvm.compiler.debug.DebugDumpScope; import org.graalvm.compiler.loop.DefaultLoopPolicies; import org.graalvm.compiler.loop.phases.LoopUnswitchingPhase; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; import org.graalvm.compiler.phases.common.CanonicalizerPhase; import org.graalvm.compiler.phases.tiers.PhaseContext; + import org.junit.Test; public class LoopUnswitchTest extends GraalCompilerTest { public static int referenceSnippet1(int a) { int sum = 0;
*** 122,131 **** --- 120,130 ---- test("test2Snippet", "referenceSnippet2"); } @SuppressWarnings("try") private void test(String snippet, String referenceSnippet) { + DebugContext debug = getDebugContext(); final StructuredGraph graph = parseEager(snippet, AllowAssumptions.NO); final StructuredGraph referenceGraph = parseEager(referenceSnippet, AllowAssumptions.NO); new LoopUnswitchingPhase(new DefaultLoopPolicies()).apply(graph);
*** 133,144 **** graph.clearAllStateAfter(); referenceGraph.clearAllStateAfter(); new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); new CanonicalizerPhase().apply(referenceGraph, new PhaseContext(getProviders())); ! try (Scope s = Debug.scope("Test", new DebugDumpScope("Test:" + snippet))) { assertEquals(referenceGraph, graph); } catch (Throwable e) { ! throw Debug.handle(e); } } } --- 132,143 ---- graph.clearAllStateAfter(); referenceGraph.clearAllStateAfter(); new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); new CanonicalizerPhase().apply(referenceGraph, new PhaseContext(getProviders())); ! try (DebugContext.Scope s = debug.scope("Test", new DebugDumpScope("Test:" + snippet))) { assertEquals(referenceGraph, graph); } catch (Throwable e) { ! throw debug.handle(e); } } }
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File