src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 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. |
43 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
43 import org.graalvm.compiler.nodes.StructuredGraph.AllowAssumptions; |
44 import org.graalvm.compiler.nodes.ValueNode; |
44 import org.graalvm.compiler.nodes.ValueNode; |
45 import org.graalvm.compiler.nodes.calc.FloatingNode; |
45 import org.graalvm.compiler.nodes.calc.FloatingNode; |
46 import org.graalvm.compiler.nodes.java.InstanceOfNode; |
46 import org.graalvm.compiler.nodes.java.InstanceOfNode; |
47 import org.graalvm.compiler.options.OptionValues; |
47 import org.graalvm.compiler.options.OptionValues; |
48 import org.graalvm.compiler.phases.common.CanonicalizerPhase; |
|
49 import org.graalvm.compiler.phases.common.inlining.InliningPhase; |
48 import org.graalvm.compiler.phases.common.inlining.InliningPhase; |
50 import org.graalvm.compiler.phases.common.inlining.policy.InlineMethodSubstitutionsPolicy; |
49 import org.graalvm.compiler.phases.common.inlining.policy.InlineMethodSubstitutionsPolicy; |
51 import org.graalvm.compiler.phases.tiers.HighTierContext; |
50 import org.graalvm.compiler.phases.tiers.HighTierContext; |
52 |
51 |
53 import jdk.vm.ci.meta.ResolvedJavaMethod; |
52 import jdk.vm.ci.meta.ResolvedJavaMethod; |
131 } |
130 } |
132 |
131 |
133 ResolvedJavaMethod javaMethod = getMetaAccess().lookupJavaMethod(method); |
132 ResolvedJavaMethod javaMethod = getMetaAccess().lookupJavaMethod(method); |
134 StructuredGraph g = parseProfiled(javaMethod, AllowAssumptions.NO); |
133 StructuredGraph g = parseProfiled(javaMethod, AllowAssumptions.NO); |
135 HighTierContext context = getDefaultHighTierContext(); |
134 HighTierContext context = getDefaultHighTierContext(); |
136 new InliningPhase(new InlineMethodSubstitutionsPolicy(), new CanonicalizerPhase()).apply(g, context); |
135 new InliningPhase(new InlineMethodSubstitutionsPolicy(), createCanonicalizerPhase()).apply(g, context); |
137 new CanonicalizerPhase().apply(g, context); |
136 this.createCanonicalizerPhase().apply(g, context); |
138 Assert.assertTrue(g.getNodes().filter(InstanceOfNode.class).isEmpty()); |
137 Assert.assertTrue(g.getNodes().filter(InstanceOfNode.class).isEmpty()); |
139 } |
138 } |
140 |
139 |
141 private static Method getMethod(final String name, Class<?>... parameters) { |
140 private static Method getMethod(final String name, Class<?>... parameters) { |
142 try { |
141 try { |