Mercurial > hg > truffle
comparison graal/com.oracle.graal.phases/src/com/oracle/graal/phases/util/GraphOrder.java @ 21543:93c50cefb9e8
moved GraalInternalError to com.oracle.jvmci.common and renamed it to JVMCIError (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 25 May 2015 23:30:34 +0200 |
parents | 71f8edb4fc7d |
children |
comparison
equal
deleted
inserted
replaced
21542:543957c1c6a6 | 21543:93c50cefb9e8 |
---|---|
22 */ | 22 */ |
23 package com.oracle.graal.phases.util; | 23 package com.oracle.graal.phases.util; |
24 | 24 |
25 import java.util.*; | 25 import java.util.*; |
26 | 26 |
27 import com.oracle.graal.compiler.common.*; | |
28 import com.oracle.graal.compiler.common.cfg.*; | 27 import com.oracle.graal.compiler.common.cfg.*; |
29 import com.oracle.graal.graph.*; | 28 import com.oracle.graal.graph.*; |
30 import com.oracle.graal.nodes.*; | 29 import com.oracle.graal.nodes.*; |
31 import com.oracle.graal.nodes.VirtualState.NodeClosure; | 30 import com.oracle.graal.nodes.VirtualState.NodeClosure; |
32 import com.oracle.graal.nodes.cfg.*; | 31 import com.oracle.graal.nodes.cfg.*; |
33 import com.oracle.graal.nodes.virtual.*; | 32 import com.oracle.graal.nodes.virtual.*; |
34 import com.oracle.graal.phases.graph.*; | 33 import com.oracle.graal.phases.graph.*; |
35 import com.oracle.graal.phases.graph.ReentrantBlockIterator.BlockIteratorClosure; | 34 import com.oracle.graal.phases.graph.ReentrantBlockIterator.BlockIteratorClosure; |
36 import com.oracle.graal.phases.schedule.*; | 35 import com.oracle.graal.phases.schedule.*; |
37 import com.oracle.graal.phases.schedule.SchedulePhase.SchedulingStrategy; | 36 import com.oracle.graal.phases.schedule.SchedulePhase.SchedulingStrategy; |
37 import com.oracle.jvmci.common.*; | |
38 | 38 |
39 public final class GraphOrder { | 39 public final class GraphOrder { |
40 | 40 |
41 private GraphOrder() { | 41 private GraphOrder() { |
42 } | 42 } |
89 private static void visitForward(ArrayList<Node> nodes, NodeBitMap visited, Node node, boolean floatingOnly) { | 89 private static void visitForward(ArrayList<Node> nodes, NodeBitMap visited, Node node, boolean floatingOnly) { |
90 try { | 90 try { |
91 assert node == null || node.isAlive() : node + " not alive"; | 91 assert node == null || node.isAlive() : node + " not alive"; |
92 if (node != null && !visited.isMarked(node)) { | 92 if (node != null && !visited.isMarked(node)) { |
93 if (floatingOnly && node instanceof FixedNode) { | 93 if (floatingOnly && node instanceof FixedNode) { |
94 throw new GraalInternalError("unexpected reference to fixed node: %s (this indicates an unexpected cycle)", node); | 94 throw new JVMCIError("unexpected reference to fixed node: %s (this indicates an unexpected cycle)", node); |
95 } | 95 } |
96 visited.mark(node); | 96 visited.mark(node); |
97 FrameState stateAfter = null; | 97 FrameState stateAfter = null; |
98 if (node instanceof StateSplit) { | 98 if (node instanceof StateSplit) { |
99 stateAfter = ((StateSplit) node).stateAfter(); | 99 stateAfter = ((StateSplit) node).stateAfter(); |
118 } | 118 } |
119 if (stateAfter != null) { | 119 if (stateAfter != null) { |
120 visitForward(nodes, visited, stateAfter, true); | 120 visitForward(nodes, visited, stateAfter, true); |
121 } | 121 } |
122 } | 122 } |
123 } catch (GraalInternalError e) { | 123 } catch (JVMCIError e) { |
124 throw GraalGraphInternalError.transformAndAddContext(e, node); | 124 throw GraalGraphJVMCIError.transformAndAddContext(e, node); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 /** | 128 /** |
129 * This method schedules the graph and makes sure that, for every node, all inputs are available | 129 * This method schedules the graph and makes sure that, for every node, all inputs are available |