Mercurial > hg > graal-jvmci-8
diff graal/GraalCompiler/src/com/sun/c1x/ir/Constant.java @ 2594:092e628ddd5d
changed Constant and Convert, more StoreIndexed changes
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Thu, 05 May 2011 15:43:23 +0200 |
parents | 16b9a8b5ad39 |
children | 3558ca7088c0 |
line wrap: on
line diff
--- a/graal/GraalCompiler/src/com/sun/c1x/ir/Constant.java Thu May 05 15:23:27 2011 +0200 +++ b/graal/GraalCompiler/src/com/sun/c1x/ir/Constant.java Thu May 05 15:43:23 2011 +0200 @@ -24,6 +24,7 @@ import static com.sun.c1x.C1XCompilation.*; +import com.oracle.graal.graph.*; import com.sun.c1x.debug.*; import com.sun.cri.ci.*; import com.sun.cri.ri.*; @@ -36,14 +37,18 @@ */ public final class Constant extends Instruction { + private static final int INPUT_COUNT = 0; + private static final int SUCCESSOR_COUNT = 0; + public final CiConstant value; /** * Constructs a new instruction representing the specified constant. * @param value the constant + * @param graph */ - public Constant(CiConstant value) { - super(value.kind.stackKind()); + public Constant(CiConstant value, Graph graph) { + super(value.kind.stackKind(), INPUT_COUNT, SUCCESSOR_COUNT, graph); this.value = value; initFlag(Value.Flag.NonNull, value.isNonNull()); } @@ -56,10 +61,11 @@ /** * Creates an instruction for a double constant. * @param d the double value for which to create the instruction + * @param graph * @return an instruction representing the double */ - public static Constant forDouble(double d) { - return new Constant(CiConstant.forDouble(d)); + public static Constant forDouble(double d, Graph graph) { + return new Constant(CiConstant.forDouble(d), graph); } /** @@ -67,8 +73,8 @@ * @param f the float value for which to create the instruction * @return an instruction representing the float */ - public static Constant forFloat(float f) { - return new Constant(CiConstant.forFloat(f)); + public static Constant forFloat(float f, Graph graph) { + return new Constant(CiConstant.forFloat(f), graph); } /** @@ -76,8 +82,8 @@ * @param i the long value for which to create the instruction * @return an instruction representing the long */ - public static Constant forLong(long i) { - return new Constant(CiConstant.forLong(i)); + public static Constant forLong(long i, Graph graph) { + return new Constant(CiConstant.forLong(i), graph); } /** @@ -85,8 +91,8 @@ * @param i the integer value for which to create the instruction * @return an instruction representing the integer */ - public static Constant forInt(int i) { - return new Constant(CiConstant.forInt(i)); + public static Constant forInt(int i, Graph graph) { + return new Constant(CiConstant.forInt(i), graph); } /** @@ -94,8 +100,8 @@ * @param i the boolean value for which to create the instruction * @return an instruction representing the boolean */ - public static Constant forBoolean(boolean i) { - return new Constant(CiConstant.forBoolean(i)); + public static Constant forBoolean(boolean i, Graph graph) { + return new Constant(CiConstant.forBoolean(i), graph); } /** @@ -103,8 +109,8 @@ * @param i the address value for which to create the instruction * @return an instruction representing the address */ - public static Constant forJsr(int i) { - return new Constant(CiConstant.forJsr(i)); + public static Constant forJsr(int i, Graph graph) { + return new Constant(CiConstant.forJsr(i), graph); } /** @@ -112,8 +118,8 @@ * @param o the object value for which to create the instruction * @return an instruction representing the object */ - public static Constant forObject(Object o) { - return new Constant(CiConstant.forObject(o)); + public static Constant forObject(Object o, Graph graph) { + return new Constant(CiConstant.forObject(o), graph); } /** @@ -121,8 +127,8 @@ * @param val the word value for which to create the instruction * @return an instruction representing the word */ - public static Constant forWord(long val) { - return new Constant(CiConstant.forWord(val)); + public static Constant forWord(long val, Graph graph) { + return new Constant(CiConstant.forWord(val), graph); } @Override