Mercurial > hg > truffle
comparison graal/com.oracle.max.graal.compiler/src/com/oracle/max/graal/compiler/ir/BlockEnd.java @ 2967:60a58915c94d
Removed next pointer from EndNode to Merge. New scheduler.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 15 Jun 2011 16:53:30 +0200 |
parents | d90bf514d647 |
children | d1fd9d15eff3 |
comparison
equal
deleted
inserted
replaced
2966:0048537e3cd7 | 2967:60a58915c94d |
---|---|
49 } | 49 } |
50 | 50 |
51 /** | 51 /** |
52 * The list of instructions that produce input for this instruction. | 52 * The list of instructions that produce input for this instruction. |
53 */ | 53 */ |
54 public Instruction blockSuccessor(int index) { | 54 public FixedNode blockSuccessor(int index) { |
55 assert index >= 0 && index < blockSuccessorCount; | 55 assert index >= 0 && index < blockSuccessorCount; |
56 return (Instruction) successors().get(super.successorCount() + SUCCESSOR_COUNT + index); | 56 return (FixedNode) successors().get(super.successorCount() + SUCCESSOR_COUNT + index); |
57 } | 57 } |
58 | 58 |
59 public Instruction setBlockSuccessor(int index, Instruction n) { | 59 public FixedNode setBlockSuccessor(int index, FixedNode n) { |
60 assert index >= 0 && index < blockSuccessorCount; | 60 assert index >= 0 && index < blockSuccessorCount; |
61 return (Merge) successors().set(super.successorCount() + SUCCESSOR_COUNT + index, n); | 61 return (FixedNode) successors().set(super.successorCount() + SUCCESSOR_COUNT + index, n); |
62 } | 62 } |
63 | 63 |
64 public int blockSuccessorCount() { | 64 public int blockSuccessorCount() { |
65 return blockSuccessorCount; | 65 return blockSuccessorCount; |
66 } | 66 } |
85 public BlockEnd(CiKind kind, Graph graph) { | 85 public BlockEnd(CiKind kind, Graph graph) { |
86 this(kind, 2, 0, 0, graph); | 86 this(kind, 2, 0, 0, graph); |
87 } | 87 } |
88 | 88 |
89 /** | 89 /** |
90 * Gets the block begin associated with this block end. | |
91 * @return the beginning of this basic block | |
92 */ | |
93 public Merge begin() { | |
94 for (Node n : predecessors()) { | |
95 if (n instanceof Merge) { | |
96 return (Merge) n; | |
97 } | |
98 } | |
99 return null; | |
100 } | |
101 | |
102 /** | |
103 * Substitutes a successor block in this block end's successor list. Note that | 90 * Substitutes a successor block in this block end's successor list. Note that |
104 * this method updates all occurrences in the list. | 91 * this method updates all occurrences in the list. |
105 * @param oldSucc the old successor to replace | 92 * @param oldSucc the old successor to replace |
106 * @param newSucc the new successor | 93 * @param newSucc the new successor |
107 */ | 94 */ |
119 | 106 |
120 /** | 107 /** |
121 * Gets the successor corresponding to the default (fall through) case. | 108 * Gets the successor corresponding to the default (fall through) case. |
122 * @return the default successor | 109 * @return the default successor |
123 */ | 110 */ |
124 public Instruction defaultSuccessor() { | 111 public FixedNode defaultSuccessor() { |
125 return blockSuccessor(blockSuccessorCount - 1); | 112 return blockSuccessor(blockSuccessorCount - 1); |
126 } | 113 } |
127 | 114 |
128 /** | 115 /** |
129 * Searches for the specified successor and returns its index into the | 116 * Searches for the specified successor and returns its index into the |