comparison graal/GraalCompiler/src/com/sun/c1x/value/FrameState.java @ 2739:bdaf31906620

Clean up.
author Thomas Wuerthinger <thomas@wuerthinger.net>
date Fri, 20 May 2011 10:49:40 +0200
parents 99c84a06bb64
children 5e8a69041cd7
comparison
equal deleted inserted replaced
2738:88123130ede6 2739:bdaf31906620
223 * Gets the value in the local variables at the specified index. 223 * Gets the value in the local variables at the specified index.
224 * 224 *
225 * @param i the index into the locals 225 * @param i the index into the locals
226 * @return the instruction that produced the value for the specified local 226 * @return the instruction that produced the value for the specified local
227 */ 227 */
228 public final Value localAt(int i) { 228 public Value localAt(int i) {
229 assert i < localsSize : "local variable index out of range: " + i; 229 assert i < localsSize : "local variable index out of range: " + i;
230 return (Value) inputs().get(i); 230 return (Value) inputs().get(i);
231 } 231 }
232 232
233 /** 233 /**
234 * Get the value on the stack at the specified stack index. 234 * Get the value on the stack at the specified stack index.
235 * 235 *
236 * @param i the index into the stack, with {@code 0} being the bottom of the stack 236 * @param i the index into the stack, with {@code 0} being the bottom of the stack
237 * @return the instruction at the specified position in the stack 237 * @return the instruction at the specified position in the stack
238 */ 238 */
239 public final Value stackAt(int i) { 239 public Value stackAt(int i) {
240 assert i >= 0 && i < (localsSize + stackSize); 240 assert i >= 0 && i < (localsSize + stackSize);
241 return (Value) inputs().get(localsSize + i); 241 return (Value) inputs().get(localsSize + i);
242 } 242 }
243 243
244 /** 244 /**
245 * Retrieves the lock at the specified index in the lock stack. 245 * Retrieves the lock at the specified index in the lock stack.
246 * @param i the index into the lock stack 246 * @param i the index into the lock stack
247 * @return the instruction which produced the object at the specified location in the lock stack 247 * @return the instruction which produced the object at the specified location in the lock stack
248 */ 248 */
249 public final Value lockAt(int i) { 249 public Value lockAt(int i) {
250 assert i >= 0; 250 assert i >= 0;
251 return (Value) inputs().get(localsSize + stackSize + i); 251 return (Value) inputs().get(localsSize + stackSize + i);
252 } 252 }
253 253
254 /** 254 /**
293 * To iterate the local variables, the {@link #localAt(int)} and {@link #localsSize()} methods should be used. 293 * To iterate the local variables, the {@link #localAt(int)} and {@link #localsSize()} methods should be used.
294 * 294 *
295 * @param i a value in the range {@code [0 .. valuesSize()]} 295 * @param i a value in the range {@code [0 .. valuesSize()]}
296 * @return the value at index {@code i} which may be {@code null} 296 * @return the value at index {@code i} which may be {@code null}
297 */ 297 */
298 public final Value valueAt(int i) { 298 public Value valueAt(int i) {
299 assert i < (localsSize + stackSize); 299 assert i < (localsSize + stackSize);
300 return (Value) inputs().get(i); 300 return (Value) inputs().get(i);
301 } 301 }
302 302
303 /** 303 /**
306 * To iterate the stack slots, the {@link #stackAt(int)} and {@link #stackSize()} methods should be used. 306 * To iterate the stack slots, the {@link #stackAt(int)} and {@link #stackSize()} methods should be used.
307 * To iterate the local variables, the {@link #localAt(int)} and {@link #localsSize()} methods should be used. 307 * To iterate the local variables, the {@link #localAt(int)} and {@link #localsSize()} methods should be used.
308 * 308 *
309 * @return the number of local variables in this frame 309 * @return the number of local variables in this frame
310 */ 310 */
311 public final int valuesSize() { 311 public int valuesSize() {
312 return localsSize + stackSize; 312 return localsSize + stackSize;
313 } 313 }
314 314
315 public void checkPhis(BlockBegin block, FrameState other) { 315 public void checkPhis(BlockBegin block, FrameState other) {
316 checkSize(other); 316 checkSize(other);
403 /** 403 /**
404 * Traverses all {@linkplain Value#isLive() live values} of this frame state. 404 * Traverses all {@linkplain Value#isLive() live values} of this frame state.
405 * 405 *
406 * @param proc the call back called to process each live value traversed 406 * @param proc the call back called to process each live value traversed
407 */ 407 */
408 public final void forEachLiveStateValue(ValueProcedure proc) { 408 public void forEachLiveStateValue(ValueProcedure proc) {
409 for (int i = 0; i < valuesSize(); i++) { 409 for (int i = 0; i < valuesSize(); i++) {
410 Value value = valueAt(i); 410 Value value = valueAt(i);
411 if (value != null) { 411 if (value != null) {
412 proc.doValue(value); 412 proc.doValue(value);
413 } 413 }