src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTreesTest.java
equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2017, 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 |
28 |
29 import org.graalvm.compiler.api.directives.GraalDirectives; |
29 import org.graalvm.compiler.api.directives.GraalDirectives; |
30 import org.graalvm.compiler.core.test.GraalCompilerTest; |
30 import org.graalvm.compiler.core.test.GraalCompilerTest; |
31 import org.graalvm.compiler.debug.DebugContext; |
31 import org.graalvm.compiler.debug.DebugContext; |
32 import org.graalvm.compiler.nodes.debug.BlackholeNode; |
32 import org.graalvm.compiler.nodes.debug.BlackholeNode; |
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.junit.Assert; |
34 import org.junit.Assert; |
36 import org.junit.Test; |
35 import org.junit.Test; |
37 |
36 |
38 import jdk.vm.ci.code.InstalledCode; |
37 import jdk.vm.ci.code.InstalledCode; |
116 try (DebugContext.Scope s = graph.getDebug().scope(getClass(), method, getCodeCache(), graph)) { |
115 try (DebugContext.Scope s = graph.getDebug().scope(getClass(), method, getCodeCache(), graph)) { |
117 for (BlackholeNode node : graph.getNodes().filter(BlackholeNode.class)) { |
116 for (BlackholeNode node : graph.getNodes().filter(BlackholeNode.class)) { |
118 graph.removeFixed(node); |
117 graph.removeFixed(node); |
119 } |
118 } |
120 new DeadCodeEliminationPhase().apply(graph); |
119 new DeadCodeEliminationPhase().apply(graph); |
121 new CanonicalizerPhase().apply(graph, context); |
120 createCanonicalizerPhase().apply(graph, context); |
122 |
121 |
123 InstalledCode code = getCode(method, graph, true); |
122 InstalledCode code = getCode(method, graph, true); |
124 |
123 |
125 GraalCompilerTest.Result r = executeExpected(method, null, true); |
124 GraalCompilerTest.Result r = executeExpected(method, null, true); |
126 int expectedInstances = ((TreeNode) r.returnValue).countInstances(); |
125 int expectedInstances = ((TreeNode) r.returnValue).countInstances(); |