src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
28 import java.util.Map; |
28 import java.util.Map; |
29 |
29 |
30 import org.graalvm.compiler.nodes.Invoke; |
30 import org.graalvm.compiler.nodes.Invoke; |
31 import org.graalvm.compiler.nodes.StructuredGraph; |
31 import org.graalvm.compiler.nodes.StructuredGraph; |
32 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
32 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
33 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
|
34 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; |
33 import org.graalvm.compiler.phases.common.DeadCodeEliminationPhase; |
35 import org.graalvm.compiler.phases.tiers.HighTierContext; |
34 import org.graalvm.compiler.phases.tiers.HighTierContext; |
36 import org.junit.Test; |
35 import org.junit.Test; |
37 |
36 |
38 public class InvokeHintsTest extends GraalCompilerTest { |
37 public class InvokeHintsTest extends GraalCompilerTest { |
78 for (Invoke invoke : graph.getInvokes()) { |
77 for (Invoke invoke : graph.getInvokes()) { |
79 hints.put(invoke, 1000d); |
78 hints.put(invoke, 1000d); |
80 } |
79 } |
81 |
80 |
82 HighTierContext context = getDefaultHighTierContext(); |
81 HighTierContext context = getDefaultHighTierContext(); |
83 createInliningPhase(hints, new CanonicalizerPhase()).apply(graph, context); |
82 createInliningPhase(hints, createCanonicalizerPhase()).apply(graph, context); |
84 new CanonicalizerPhase().apply(graph, context); |
83 createCanonicalizerPhase().apply(graph, context); |
85 new DeadCodeEliminationPhase().apply(graph); |
84 new DeadCodeEliminationPhase().apply(graph); |
86 StructuredGraph referenceGraph = parseEager(REFERENCE_SNIPPET, AllowAssumptions.NO); |
85 StructuredGraph referenceGraph = parseEager(REFERENCE_SNIPPET, AllowAssumptions.NO); |
87 assertEquals(referenceGraph, graph); |
86 assertEquals(referenceGraph, graph); |
88 } |
87 } |
89 } |
88 } |