Mercurial > hg > truffle
comparison graal/GraalCompiler/src/com/sun/c1x/ir/ArrayLength.java @ 2592:fec99fc30af1
checkstyle fixes, updated AccessArray + subclasses
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 05 May 2011 15:23:07 +0200 |
parents | c58a301eb2d7 |
children | 91d3952f7eb7 |
comparison
equal
deleted
inserted
replaced
2587:51ebe5f0516f | 2592:fec99fc30af1 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.sun.c1x.ir; | 23 package com.sun.c1x.ir; |
24 | 24 |
25 import com.oracle.graal.graph.*; | |
25 import com.sun.c1x.debug.*; | 26 import com.sun.c1x.debug.*; |
26 import com.sun.c1x.util.*; | 27 import com.sun.c1x.util.*; |
27 import com.sun.c1x.value.*; | 28 import com.sun.c1x.value.*; |
28 import com.sun.cri.bytecode.*; | 29 import com.sun.cri.bytecode.*; |
29 import com.sun.cri.ci.*; | 30 import com.sun.cri.ci.*; |
33 * | 34 * |
34 * @author Ben L. Titzer | 35 * @author Ben L. Titzer |
35 */ | 36 */ |
36 public final class ArrayLength extends AccessArray { | 37 public final class ArrayLength extends AccessArray { |
37 | 38 |
39 private static final int INPUT_COUNT = 0; | |
40 private static final int SUCCESSOR_COUNT = 0; | |
41 | |
38 /** | 42 /** |
39 * Constructs a new ArrayLength instruction. | 43 * Constructs a new ArrayLength instruction. |
40 * @param array the instruction producing the array | 44 * @param array the instruction producing the array |
41 * @param newFrameState the state before executing this instruction | 45 * @param newFrameState the state before executing this instruction |
42 */ | 46 */ |
43 public ArrayLength(Value array, FrameState newFrameState) { | 47 public ArrayLength(Value array, FrameState newFrameState, Graph graph) { |
44 super(CiKind.Int, array, newFrameState); | 48 super(CiKind.Int, array, newFrameState, INPUT_COUNT, SUCCESSOR_COUNT, graph); |
45 } | 49 } |
46 | 50 |
47 @Override | 51 @Override |
48 public void accept(ValueVisitor v) { | 52 public void accept(ValueVisitor v) { |
49 v.visitArrayLength(this); | 53 v.visitArrayLength(this); |
50 } | 54 } |
51 | 55 |
52 @Override | 56 @Override |
53 public int valueNumber() { | 57 public int valueNumber() { |
54 return Util.hash1(Bytecodes.ARRAYLENGTH, array); | 58 return Util.hash1(Bytecodes.ARRAYLENGTH, array()); |
55 } | 59 } |
56 | 60 |
57 @Override | 61 @Override |
58 public boolean valueEqual(Instruction i) { | 62 public boolean valueEqual(Instruction i) { |
59 if (i instanceof ArrayLength) { | 63 if (i instanceof ArrayLength) { |
60 ArrayLength o = (ArrayLength) i; | 64 ArrayLength o = (ArrayLength) i; |
61 return array == o.array; | 65 return array() == o.array(); |
62 } | 66 } |
63 return false; | 67 return false; |
64 } | 68 } |
65 | 69 |
66 @Override | 70 @Override |
67 public void print(LogStream out) { | 71 public void print(LogStream out) { |
68 out.print(array).print(".length"); | 72 out.print(array()).print(".length"); |
69 } | 73 } |
70 } | 74 } |