Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/ir/Instruction.java @ 2805:c3f64b66fc78
Towards removing the next pointer from Constant and ArithmeticOp
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Fri, 27 May 2011 19:57:56 +0200 |
parents | e1dad0edd57a |
children | 2b8ef0a06391 ac4b086cbd72 |
comparison
equal
deleted
inserted
replaced
2804:095162a84dcc | 2805:c3f64b66fc78 |
---|---|
143 | 143 |
144 public Instruction predAt(int j) { | 144 public Instruction predAt(int j) { |
145 return (Instruction) predecessors().get(j); | 145 return (Instruction) predecessors().get(j); |
146 } | 146 } |
147 | 147 |
148 @Override | |
149 public Merge block() { | |
150 Instruction cur = this; | |
151 while (!(cur instanceof Merge)) { | |
152 List<Node> preds = cur.predecessors(); | |
153 cur = (Instruction) preds.get(0); | |
154 } | |
155 return (Merge) cur; | |
156 } | |
157 | |
158 /** | |
159 * Compute the value number of this Instruction. Local and global value numbering | |
160 * optimizations use a hash map, and the value number provides a hash code. | |
161 * If the instruction cannot be value numbered, then this method should return | |
162 * {@code 0}. | |
163 * @return the hashcode of this instruction | |
164 */ | |
165 public int valueNumber() { | |
166 return 0; | |
167 } | |
168 | |
169 /** | |
170 * Checks that this instruction is equal to another instruction for the purposes | |
171 * of value numbering. | |
172 * @param i the other instruction | |
173 * @return {@code true} if this instruction is equivalent to the specified | |
174 * instruction w.r.t. value numbering | |
175 */ | |
176 public boolean valueEqual(Instruction i) { | |
177 return false; | |
178 } | |
179 | |
180 /** | 148 /** |
181 * Gets the state after the instruction, if it is recorded. Typically only | 149 * Gets the state after the instruction, if it is recorded. Typically only |
182 * instances of {@link BlockEnd} have a non-null state after. | 150 * instances of {@link BlockEnd} have a non-null state after. |
183 * @return the state after the instruction | 151 * @return the state after the instruction |
184 */ | 152 */ |