Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java @ 11837:bd3441f941f9
Use ControlSplitNode and ControlSinkNode in GraphBuilderPhase.isBlockEnd
Remove Util.isFixed/isFloating
author | Gilles Duboscq <duboscq@ssw.jku.at> |
---|---|
date | Thu, 26 Sep 2013 17:33:04 +0200 |
parents | 88d8b348914b |
children | 0e2cceed1caf |
comparison
equal
deleted
inserted
replaced
11836:d72c314260dc | 11837:bd3441f941f9 |
---|---|
48 import com.oracle.graal.nodes.java.*; | 48 import com.oracle.graal.nodes.java.*; |
49 import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; | 49 import com.oracle.graal.nodes.java.MethodCallTargetNode.InvokeKind; |
50 import com.oracle.graal.nodes.type.*; | 50 import com.oracle.graal.nodes.type.*; |
51 import com.oracle.graal.nodes.util.*; | 51 import com.oracle.graal.nodes.util.*; |
52 import com.oracle.graal.phases.*; | 52 import com.oracle.graal.phases.*; |
53 import com.oracle.graal.phases.util.*; | |
54 | 53 |
55 /** | 54 /** |
56 * The {@code GraphBuilder} class parses the bytecode of a method and builds the IR graph. | 55 * The {@code GraphBuilder} class parses the bytecode of a method and builds the IR graph. |
57 */ | 56 */ |
58 public class GraphBuilderPhase extends Phase { | 57 public class GraphBuilderPhase extends Phase { |
1691 lastInstr.setNext(target); | 1690 lastInstr.setNext(target); |
1692 } | 1691 } |
1693 } | 1692 } |
1694 | 1693 |
1695 private static boolean isBlockEnd(Node n) { | 1694 private static boolean isBlockEnd(Node n) { |
1696 return trueSuccessorCount(n) > 1 || n instanceof ReturnNode || n instanceof UnwindNode || n instanceof DeoptimizeNode; | 1695 return n instanceof ControlSplitNode || n instanceof ControlSinkNode; |
1697 } | |
1698 | |
1699 private static int trueSuccessorCount(Node n) { | |
1700 if (n == null) { | |
1701 return 0; | |
1702 } | |
1703 int i = 0; | |
1704 for (Node s : n.successors()) { | |
1705 if (Util.isFixed(s)) { | |
1706 i++; | |
1707 } | |
1708 } | |
1709 return i; | |
1710 } | 1696 } |
1711 | 1697 |
1712 private void iterateBytecodesForBlock(Block block) { | 1698 private void iterateBytecodesForBlock(Block block) { |
1713 if (block.isLoopHeader) { | 1699 if (block.isLoopHeader) { |
1714 // Create the loop header block, which later will merge the backward branches of the | 1700 // Create the loop header block, which later will merge the backward branches of the |