changeset 5538:e18ba36bfebc

Renamed RiConstant => Constant.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 08 Jun 2012 23:41:02 +0200
parents 80371cc2256d
children bc647d8b0080
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTargetMethod.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiValueUtil.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/InstalledCode.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiCompiledMethod.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiConstant.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiKind.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedField.java graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedType.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateObjectTypeFeedback.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateScalarTypeFeedback.java graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeOp.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackStore.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeQuery.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeFeedbackStore.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeFeedbackTool.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeQuery.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippet.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/ConditionTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/EscapeAnalysisTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeCheckTest.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirArgument.java src/share/vm/classfile/vmSymbols.hpp src/share/vm/graal/graalCompilerToVM.cpp src/share/vm/graal/graalJavaAccess.hpp
diffstat 88 files changed, 848 insertions(+), 848 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTargetMethod.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiTargetMethod.java	Fri Jun 08 23:41:02 2012 +0200
@@ -134,10 +134,10 @@
      */
     public static final class DataPatch extends Site {
         private static final long serialVersionUID = 5771730331604867476L;
-        public final RiConstant constant;
+        public final Constant constant;
         public final int alignment;
 
-        DataPatch(int pcOffset, RiConstant data, int alignment) {
+        DataPatch(int pcOffset, Constant data, int alignment) {
             super(pcOffset);
             this.constant = data;
             this.alignment = alignment;
@@ -394,7 +394,7 @@
      * @param data the data that is referenced
      * @param alignment the alignment requirement of the data or 0 if there is no alignment requirement
      */
-    public void recordDataReference(int codePos, RiConstant data, int alignment) {
+    public void recordDataReference(int codePos, Constant data, int alignment) {
         assert codePos >= 0 && data != null;
         dataReferences.add(new DataPatch(codePos, data, alignment));
     }
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiValueUtil.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiValueUtil.java	Fri Jun 08 23:41:02 2012 +0200
@@ -46,12 +46,12 @@
 
     public static boolean isConstant(RiValue value) {
         assert value != null;
-        return value instanceof RiConstant;
+        return value instanceof Constant;
     }
 
-    public static RiConstant asConstant(RiValue value) {
+    public static Constant asConstant(RiValue value) {
         assert value != null;
-        return (RiConstant) value;
+        return (Constant) value;
     }
 
 
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/CiVirtualObject.java	Fri Jun 08 23:41:02 2012 +0200
@@ -125,9 +125,9 @@
         }
 
         public CiVirtualObject constantProxy(RiKind kind, RiValue objectValue, RiValue primitiveValue) {
-            RiConstant cKind = RiConstant.forObject(kind);
+            Constant cKind = Constant.forObject(kind);
             // TODO: here the ordering is hard coded... we should query RiType.fields() and act accordingly
-            return new CiVirtualObject(runtime.getType(RiConstant.class), new RiValue[] {cKind, primitiveValue, RiValue.IllegalValue, objectValue}, nextId++);
+            return new CiVirtualObject(runtime.getType(Constant.class), new RiValue[] {cKind, primitiveValue, RiValue.IllegalValue, objectValue}, nextId++);
         }
 
         public RiValue proxy(RiValue ciValue) {
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/RiRuntime.java	Fri Jun 08 23:41:02 2012 +0200
@@ -92,7 +92,7 @@
      *        Ignored if null, otherwise the info is written to index 0 of this array.
      * @return a reference to the compiled and ready-to-run code
      */
-    RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info);
+    InstalledCode addMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info);
 
     /**
      * Encodes a deoptimization action and a deoptimization reason in an integer value.
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/package-info.java	Fri Jun 08 23:41:02 2012 +0200
@@ -36,7 +36,7 @@
  * The compiler manipulates {@link com.oracle.graal.api.meta.RiValue} instances that have a {@link com.oracle.graal.api.meta.RiKind}, and are
  * immutable. A concrete {@link com.oracle.graal.api.meta.RiValue value} is one of the following subclasses:
  * <ul>
- * <li>{@link com.oracle.graal.api.meta.RiConstant}: a constant value.
+ * <li>{@link com.oracle.graal.api.meta.Constant}: a constant value.
  * <li>{@link com.oracle.graal.api.code.CiRegisterValue}: a value stored in a {@linkplain com.oracle.graal.api.code.CiRegister target machine register}.
  * <li>{@link com.oracle.graal.api.code.CiStackSlot}: a spill slot or an outgoing stack-based argument in a method's frame.
  * <li>{@link com.oracle.graal.api.code.CiAddress}: an address in target machine memory.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java	Fri Jun 08 23:41:02 2012 +0200
@@ -0,0 +1,498 @@
+/*
+ * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.api.meta;
+
+/**
+ * Represents a constant (boxed) value, such as an integer, floating point number, or object reference,
+ * within the compiler and across the compiler/runtime interface. Exports a set of {@code CiConstant}
+ * instances that represent frequently used constant values, such as {@link #ZERO}.
+ */
+public final class Constant extends RiValue {
+    private static final long serialVersionUID = -6355452536852663986L;
+
+    private static final Constant[] INT_CONSTANT_CACHE = new Constant[100];
+    static {
+        for (int i = 0; i < INT_CONSTANT_CACHE.length; ++i) {
+            INT_CONSTANT_CACHE[i] = new Constant(RiKind.Int, i);
+        }
+    }
+
+    public static final Constant NULL_OBJECT = new Constant(RiKind.Object, null);
+    public static final Constant INT_MINUS_1 = new Constant(RiKind.Int, -1);
+    public static final Constant INT_0 = forInt(0);
+    public static final Constant INT_1 = forInt(1);
+    public static final Constant INT_2 = forInt(2);
+    public static final Constant INT_3 = forInt(3);
+    public static final Constant INT_4 = forInt(4);
+    public static final Constant INT_5 = forInt(5);
+    public static final Constant LONG_0 = new Constant(RiKind.Long, 0L);
+    public static final Constant LONG_1 = new Constant(RiKind.Long, 1L);
+    public static final Constant FLOAT_0 = new Constant(RiKind.Float, Float.floatToRawIntBits(0.0F));
+    public static final Constant FLOAT_1 = new Constant(RiKind.Float, Float.floatToRawIntBits(1.0F));
+    public static final Constant FLOAT_2 = new Constant(RiKind.Float, Float.floatToRawIntBits(2.0F));
+    public static final Constant DOUBLE_0 = new Constant(RiKind.Double, Double.doubleToRawLongBits(0.0D));
+    public static final Constant DOUBLE_1 = new Constant(RiKind.Double, Double.doubleToRawLongBits(1.0D));
+    public static final Constant TRUE = new Constant(RiKind.Boolean, 1L);
+    public static final Constant FALSE = new Constant(RiKind.Boolean, 0L);
+
+    static {
+        assert NULL_OBJECT.isDefaultValue();
+        assert INT_0.isDefaultValue();
+        assert FLOAT_0.isDefaultValue();
+        assert DOUBLE_0.isDefaultValue();
+        assert FALSE.isDefaultValue();
+
+        // Ensure difference between 0.0f and -0.0f is preserved
+        assert FLOAT_0 != forFloat(-0.0F);
+        assert !forFloat(-0.0F).isDefaultValue();
+
+        // Ensure difference between 0.0d and -0.0d is preserved
+        assert DOUBLE_0 != forDouble(-0.0d);
+        assert !forDouble(-0.0D).isDefaultValue();
+
+        assert NULL_OBJECT.isNull();
+    }
+
+    /**
+     * The boxed object value. This is ignored iff {@code !kind.isObject()}.
+     */
+    private final Object object;
+
+    /**
+     * The boxed primitive value as a {@code long}. This is ignored iff {@code kind.isObject()}.
+     * For {@code float} and {@code double} values, this value is the result of
+     * {@link Float#floatToRawIntBits(float)} and {@link Double#doubleToRawLongBits(double)} respectively.
+     */
+    private final long primitive;
+
+    /**
+     * Create a new constant represented by the specified object reference.
+     *
+     * @param kind the type of this constant
+     * @param object the value of this constant
+     */
+    private Constant(RiKind kind, Object object) {
+        super(kind);
+        this.object = object;
+        this.primitive = 0L;
+    }
+
+    /**
+     * Create a new constant represented by the specified primitive.
+     *
+     * @param kind the type of this constant
+     * @param primitive the value of this constant
+     */
+    public Constant(RiKind kind, long primitive) {
+        super(kind);
+        this.object = null;
+        this.primitive = primitive;
+    }
+
+    /**
+     * Checks whether this constant is non-null.
+     * @return {@code true} if this constant is a primitive, or an object constant that is not null
+     */
+    public boolean isNonNull() {
+        return !kind.isObject() || object != null;
+    }
+
+    /**
+     * Checks whether this constant is null.
+     * @return {@code true} if this constant is the null constant
+     */
+    public boolean isNull() {
+        return kind.isObject() && object == null;
+    }
+
+    @Override
+    public String toString() {
+        return kind.javaName + "[" + kind.format(boxedValue()) + (kind != RiKind.Object ? "|0x" + Long.toHexString(primitive) : "") + "]";
+    }
+
+    /**
+     * Gets this constant's value as a string.
+     *
+     * @return this constant's value as a string
+     */
+    public String valueString() {
+        if (kind.isPrimitive()) {
+            return boxedValue().toString();
+        } else if (kind.isObject()) {
+            if (object == null) {
+                return "null";
+            } else if (object instanceof String) {
+                return "\"" + object + "\"";
+            } else {
+                return "<object: " + kind.format(object) + ">";
+            }
+        } else if (kind.isJsr()) {
+            return "bci:" + boxedValue().toString();
+        } else {
+            return "???";
+        }
+    }
+
+    /**
+     * Returns the value of this constant as a boxed Java value.
+     * @return the value of this constant
+     */
+    public Object boxedValue() {
+        // Checkstyle: stop
+        switch (kind) {
+            case Byte: return (byte) asInt();
+            case Boolean: return asInt() == 0 ? Boolean.FALSE : Boolean.TRUE;
+            case Short: return (short) asInt();
+            case Char: return (char) asInt();
+            case Jsr: return (int) primitive;
+            case Int: return asInt();
+            case Long: return asLong();
+            case Float: return asFloat();
+            case Double: return asDouble();
+            case Object: return object;
+        }
+        // Checkstyle: resume
+        throw new IllegalArgumentException();
+    }
+
+    private boolean valueEqual(Constant other, boolean ignoreKind) {
+        // must have equivalent kinds to be equal
+        if (!ignoreKind && kind != other.kind) {
+            return false;
+        }
+        if (kind.isObject()) {
+            return object == other.object;
+        }
+        return primitive == other.primitive;
+    }
+
+    /**
+     * Converts this constant to a primitive int.
+     * @return the int value of this constant
+     */
+    public int asInt() {
+        if (kind.stackKind().isInt() || kind.isJsr()) {
+            return (int) primitive;
+        }
+        throw new Error("Constant is not int: " + this);
+    }
+
+    /**
+     * Converts this constant to a primitive boolean.
+     * @return the boolean value of this constant
+     */
+    public boolean asBoolean() {
+        if (kind == RiKind.Boolean) {
+            return primitive != 0L;
+        }
+        throw new Error("Constant is not boolean: " + this);
+    }
+
+    /**
+     * Converts this constant to a primitive long.
+     * @return the long value of this constant
+     */
+    public long asLong() {
+        // Checkstyle: stop
+        switch (kind.stackKind()) {
+            case Jsr:
+            case Int:
+            case Long: return primitive;
+            case Float: return (long) asFloat();
+            case Double: return (long) asDouble();
+            default: throw new Error("Constant is not long: " + this);
+        }
+        // Checkstyle: resume
+    }
+
+    /**
+     * Converts this constant to a primitive float.
+     * @return the float value of this constant
+     */
+    public float asFloat() {
+        if (kind.isFloat()) {
+            return Float.intBitsToFloat((int) primitive);
+        }
+        throw new Error("Constant is not float: " + this);
+    }
+
+    /**
+     * Converts this constant to a primitive double.
+     * @return the double value of this constant
+     */
+    public double asDouble() {
+        if (kind.isFloat()) {
+            return Float.intBitsToFloat((int) primitive);
+        }
+        if (kind.isDouble()) {
+            return Double.longBitsToDouble(primitive);
+        }
+        throw new Error("Constant is not double: " + this);
+    }
+
+    /**
+     * Converts this constant to the object reference it represents.
+     * @return the object which this constant represents
+     */
+    public Object asObject() {
+        if (kind.isObject()) {
+            return object;
+        }
+        throw new Error("Constant is not object: " + this);
+    }
+
+    /**
+     * Converts this constant to the jsr reference it represents.
+     * @return the object which this constant represents
+     */
+    public int asJsr() {
+        if (kind.isJsr()) {
+            return (int) primitive;
+        }
+        throw new Error("Constant is not jsr: " + this);
+    }
+
+    /**
+     * Unchecked access to a primitive value.
+     * @return
+     */
+    public long asPrimitive() {
+        if (kind.isObject()) {
+            throw new Error("Constant is not primitive: " + this);
+        }
+        return primitive;
+    }
+
+    /**
+     * Computes the hashcode of this constant.
+     * @return a suitable hashcode for this constant
+     */
+    @Override
+    public int hashCode() {
+        if (kind.isObject()) {
+            return System.identityHashCode(object);
+        }
+        return (int) primitive;
+    }
+
+    /**
+     * Checks whether this constant equals another object. This is only
+     * true if the other object is a constant and has the same value.
+     * @param o the object to compare equality
+     * @return {@code true} if this constant is equivalent to the specified object
+     */
+    @Override
+    public boolean equals(Object o) {
+        return o == this || o instanceof Constant && valueEqual((Constant) o, false);
+    }
+
+    /**
+     * Checks whether this constant is identical to another constant or has the same value as it.
+     * @param other the constant to compare for equality against this constant
+     * @return {@code true} if this constant is equivalent to {@code other}
+     */
+    public boolean equivalent(Constant other) {
+        return other == this || valueEqual(other, false);
+    }
+
+    /**
+     * Checks whether this constant is the default value for its type.
+     * @return {@code true} if the value is the default value for its type; {@code false} otherwise
+     */
+    public boolean isDefaultValue() {
+        // Checkstyle: stop
+        switch (kind.stackKind()) {
+            case Int: return asInt() == 0;
+            case Long: return asLong() == 0;
+            case Float: return this == FLOAT_0;
+            case Double: return this == DOUBLE_0;
+            case Object: return object == null;
+        }
+        // Checkstyle: resume
+        throw new IllegalArgumentException("Cannot det default CiConstant for kind " + kind);
+    }
+
+    /**
+     * Gets the default value for a given kind.
+     *
+     * @return the default value for {@code kind}'s {@linkplain RiKind#stackKind() stack kind}
+     */
+    public static Constant defaultValue(RiKind kind) {
+        // Checkstyle: stop
+        switch (kind.stackKind()) {
+            case Int: return INT_0;
+            case Long: return LONG_0;
+            case Float: return FLOAT_0;
+            case Double: return DOUBLE_0;
+            case Object: return NULL_OBJECT;
+        }
+        // Checkstyle: resume
+        throw new IllegalArgumentException("Cannot get default CiConstant for kind " + kind);
+    }
+
+    /**
+     * Creates a boxed double constant.
+     * @param d the double value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forDouble(double d) {
+        if (Double.compare(0.0D, d) == 0) {
+            return DOUBLE_0;
+        }
+        if (Double.compare(d, 1.0D) == 0) {
+            return DOUBLE_1;
+        }
+        return new Constant(RiKind.Double, Double.doubleToRawLongBits(d));
+    }
+
+    /**
+     * Creates a boxed float constant.
+     * @param f the float value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forFloat(float f) {
+        if (Float.compare(f, 0.0F) == 0) {
+            return FLOAT_0;
+        }
+        if (Float.compare(f, 1.0F) == 0) {
+            return FLOAT_1;
+        }
+        if (Float.compare(f, 2.0F) == 0) {
+            return FLOAT_2;
+        }
+        return new Constant(RiKind.Float, Float.floatToRawIntBits(f));
+    }
+
+    /**
+     * Creates a boxed long constant.
+     * @param i the long value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forLong(long i) {
+        return i == 0 ? LONG_0 : i == 1 ? LONG_1 : new Constant(RiKind.Long, i);
+    }
+
+    /**
+     * Creates a boxed integer constant.
+     * @param i the integer value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forInt(int i) {
+        if (i == -1) {
+            return INT_MINUS_1;
+        }
+        if (i >= 0 && i < INT_CONSTANT_CACHE.length) {
+            return INT_CONSTANT_CACHE[i];
+        }
+        return new Constant(RiKind.Int, i);
+    }
+
+    /**
+     * Creates a boxed byte constant.
+     * @param i the byte value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forByte(byte i) {
+        return new Constant(RiKind.Byte, i);
+    }
+
+    /**
+     * Creates a boxed boolean constant.
+     * @param i the boolean value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forBoolean(boolean i) {
+        return i ? TRUE : FALSE;
+    }
+
+    /**
+     * Creates a boxed char constant.
+     * @param i the char value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forChar(char i) {
+        return new Constant(RiKind.Char, i);
+    }
+
+    /**
+     * Creates a boxed short constant.
+     * @param i the short value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forShort(short i) {
+        return new Constant(RiKind.Short, i);
+    }
+
+    /**
+     * Creates a boxed address (jsr/ret address) constant.
+     * @param i the address value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forJsr(int i) {
+        return new Constant(RiKind.Jsr, i);
+    }
+
+    /**
+     * Creates a boxed object constant.
+     * @param o the object value to box
+     * @return a boxed copy of {@code value}
+     */
+    public static Constant forObject(Object o) {
+        if (o == null) {
+            return NULL_OBJECT;
+        }
+        return new Constant(RiKind.Object, o);
+    }
+
+    /**
+     * Creates a boxed constant for the given kind from an Object.
+     * The object needs to be of the Java boxed type corresponding to the kind.
+     * @param kind the kind of the constant to create
+     * @param value the Java boxed value: a Byte instance for CiKind Byte, etc.
+     * @return the boxed copy of {@code value}
+     */
+    public static Constant forBoxed(RiKind kind, Object value) {
+        switch (kind) {
+            case Boolean:
+                return forBoolean((Boolean) value);
+            case Byte:
+                return forByte((Byte) value);
+            case Char:
+                return forChar((Character) value);
+            case Short:
+                return forShort((Short) value);
+            case Int:
+                return forInt((Integer) value);
+            case Long:
+                return forLong((Long) value);
+            case Float:
+                return forFloat((Float) value);
+            case Double:
+                return forDouble((Double) value);
+            case Object:
+                return forObject(value);
+            default:
+                throw new RuntimeException("cannot create CiConstant for boxed " + kind + " value");
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/InstalledCode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.api.meta;
+
+/**
+ * Represents a compiled instance of a method. It may have been invalidated or removed in the meantime.
+ */
+public interface InstalledCode {
+
+    public abstract class MethodInvalidatedException extends RuntimeException {
+
+        private static final long serialVersionUID = -3540232440794244844L;
+    }
+
+    /**
+     * Returns the method to which the compiled code belongs.
+     * @return the method to which the compiled code belongs.
+     */
+    RiResolvedMethod method();
+
+    /**
+     * @return true if the code represented by this object is still valid, false otherwise (may happen due to deopt, etc.)
+     */
+    boolean isValid();
+
+    Object execute(Object arg1, Object arg2, Object arg3);
+
+    Object executeVarargs(Object... args);
+}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/MetaAccessProvider.java	Fri Jun 08 23:41:02 2012 +0200
@@ -38,7 +38,7 @@
      *
      * @return {@code null} if {@code constant.isNull() || !constant.kind.isObject()}
      */
-    RiResolvedType getTypeOf(RiConstant constant);
+    RiResolvedType getTypeOf(Constant constant);
 
 
     RiResolvedType getType(Class<?> clazz);
@@ -48,7 +48,7 @@
      *
      * @return true if the two parameters represent the same runtime object, false otherwise
      */
-    boolean areConstantObjectsEqual(RiConstant x, RiConstant y);
+    boolean areConstantObjectsEqual(Constant x, Constant y);
 
     /**
      * Provides the {@link RiMethod} for a {@link Method} obtained via reflection.
@@ -58,5 +58,5 @@
     /**
      * Gets the length of the array that is wrapped in a CiConstant object.
      */
-    int getArrayLength(RiConstant array);
+    int getArrayLength(Constant array);
 }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiCompiledMethod.java	Fri Jun 08 23:35:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,49 +0,0 @@
-/*
- * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.meta;
-
-/**
- * Represents a compiled instance of a method. It may have been invalidated or removed in the meantime.
- */
-public interface RiCompiledMethod {
-
-    public abstract class MethodInvalidatedException extends RuntimeException {
-
-        private static final long serialVersionUID = -3540232440794244844L;
-    }
-
-    /**
-     * Returns the method to which the compiled code belongs.
-     * @return the method to which the compiled code belongs.
-     */
-    RiResolvedMethod method();
-
-    /**
-     * @return true if the code represented by this object is still valid, false otherwise (may happen due to deopt, etc.)
-     */
-    boolean isValid();
-
-    Object execute(Object arg1, Object arg2, Object arg3);
-
-    Object executeVarargs(Object... args);
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiConstant.java	Fri Jun 08 23:35:16 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,498 +0,0 @@
-/*
- * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.meta;
-
-/**
- * Represents a constant (boxed) value, such as an integer, floating point number, or object reference,
- * within the compiler and across the compiler/runtime interface. Exports a set of {@code CiConstant}
- * instances that represent frequently used constant values, such as {@link #ZERO}.
- */
-public final class RiConstant extends RiValue {
-    private static final long serialVersionUID = -6355452536852663986L;
-
-    private static final RiConstant[] INT_CONSTANT_CACHE = new RiConstant[100];
-    static {
-        for (int i = 0; i < INT_CONSTANT_CACHE.length; ++i) {
-            INT_CONSTANT_CACHE[i] = new RiConstant(RiKind.Int, i);
-        }
-    }
-
-    public static final RiConstant NULL_OBJECT = new RiConstant(RiKind.Object, null);
-    public static final RiConstant INT_MINUS_1 = new RiConstant(RiKind.Int, -1);
-    public static final RiConstant INT_0 = forInt(0);
-    public static final RiConstant INT_1 = forInt(1);
-    public static final RiConstant INT_2 = forInt(2);
-    public static final RiConstant INT_3 = forInt(3);
-    public static final RiConstant INT_4 = forInt(4);
-    public static final RiConstant INT_5 = forInt(5);
-    public static final RiConstant LONG_0 = new RiConstant(RiKind.Long, 0L);
-    public static final RiConstant LONG_1 = new RiConstant(RiKind.Long, 1L);
-    public static final RiConstant FLOAT_0 = new RiConstant(RiKind.Float, Float.floatToRawIntBits(0.0F));
-    public static final RiConstant FLOAT_1 = new RiConstant(RiKind.Float, Float.floatToRawIntBits(1.0F));
-    public static final RiConstant FLOAT_2 = new RiConstant(RiKind.Float, Float.floatToRawIntBits(2.0F));
-    public static final RiConstant DOUBLE_0 = new RiConstant(RiKind.Double, Double.doubleToRawLongBits(0.0D));
-    public static final RiConstant DOUBLE_1 = new RiConstant(RiKind.Double, Double.doubleToRawLongBits(1.0D));
-    public static final RiConstant TRUE = new RiConstant(RiKind.Boolean, 1L);
-    public static final RiConstant FALSE = new RiConstant(RiKind.Boolean, 0L);
-
-    static {
-        assert NULL_OBJECT.isDefaultValue();
-        assert INT_0.isDefaultValue();
-        assert FLOAT_0.isDefaultValue();
-        assert DOUBLE_0.isDefaultValue();
-        assert FALSE.isDefaultValue();
-
-        // Ensure difference between 0.0f and -0.0f is preserved
-        assert FLOAT_0 != forFloat(-0.0F);
-        assert !forFloat(-0.0F).isDefaultValue();
-
-        // Ensure difference between 0.0d and -0.0d is preserved
-        assert DOUBLE_0 != forDouble(-0.0d);
-        assert !forDouble(-0.0D).isDefaultValue();
-
-        assert NULL_OBJECT.isNull();
-    }
-
-    /**
-     * The boxed object value. This is ignored iff {@code !kind.isObject()}.
-     */
-    private final Object object;
-
-    /**
-     * The boxed primitive value as a {@code long}. This is ignored iff {@code kind.isObject()}.
-     * For {@code float} and {@code double} values, this value is the result of
-     * {@link Float#floatToRawIntBits(float)} and {@link Double#doubleToRawLongBits(double)} respectively.
-     */
-    private final long primitive;
-
-    /**
-     * Create a new constant represented by the specified object reference.
-     *
-     * @param kind the type of this constant
-     * @param object the value of this constant
-     */
-    private RiConstant(RiKind kind, Object object) {
-        super(kind);
-        this.object = object;
-        this.primitive = 0L;
-    }
-
-    /**
-     * Create a new constant represented by the specified primitive.
-     *
-     * @param kind the type of this constant
-     * @param primitive the value of this constant
-     */
-    public RiConstant(RiKind kind, long primitive) {
-        super(kind);
-        this.object = null;
-        this.primitive = primitive;
-    }
-
-    /**
-     * Checks whether this constant is non-null.
-     * @return {@code true} if this constant is a primitive, or an object constant that is not null
-     */
-    public boolean isNonNull() {
-        return !kind.isObject() || object != null;
-    }
-
-    /**
-     * Checks whether this constant is null.
-     * @return {@code true} if this constant is the null constant
-     */
-    public boolean isNull() {
-        return kind.isObject() && object == null;
-    }
-
-    @Override
-    public String toString() {
-        return kind.javaName + "[" + kind.format(boxedValue()) + (kind != RiKind.Object ? "|0x" + Long.toHexString(primitive) : "") + "]";
-    }
-
-    /**
-     * Gets this constant's value as a string.
-     *
-     * @return this constant's value as a string
-     */
-    public String valueString() {
-        if (kind.isPrimitive()) {
-            return boxedValue().toString();
-        } else if (kind.isObject()) {
-            if (object == null) {
-                return "null";
-            } else if (object instanceof String) {
-                return "\"" + object + "\"";
-            } else {
-                return "<object: " + kind.format(object) + ">";
-            }
-        } else if (kind.isJsr()) {
-            return "bci:" + boxedValue().toString();
-        } else {
-            return "???";
-        }
-    }
-
-    /**
-     * Returns the value of this constant as a boxed Java value.
-     * @return the value of this constant
-     */
-    public Object boxedValue() {
-        // Checkstyle: stop
-        switch (kind) {
-            case Byte: return (byte) asInt();
-            case Boolean: return asInt() == 0 ? Boolean.FALSE : Boolean.TRUE;
-            case Short: return (short) asInt();
-            case Char: return (char) asInt();
-            case Jsr: return (int) primitive;
-            case Int: return asInt();
-            case Long: return asLong();
-            case Float: return asFloat();
-            case Double: return asDouble();
-            case Object: return object;
-        }
-        // Checkstyle: resume
-        throw new IllegalArgumentException();
-    }
-
-    private boolean valueEqual(RiConstant other, boolean ignoreKind) {
-        // must have equivalent kinds to be equal
-        if (!ignoreKind && kind != other.kind) {
-            return false;
-        }
-        if (kind.isObject()) {
-            return object == other.object;
-        }
-        return primitive == other.primitive;
-    }
-
-    /**
-     * Converts this constant to a primitive int.
-     * @return the int value of this constant
-     */
-    public int asInt() {
-        if (kind.stackKind().isInt() || kind.isJsr()) {
-            return (int) primitive;
-        }
-        throw new Error("Constant is not int: " + this);
-    }
-
-    /**
-     * Converts this constant to a primitive boolean.
-     * @return the boolean value of this constant
-     */
-    public boolean asBoolean() {
-        if (kind == RiKind.Boolean) {
-            return primitive != 0L;
-        }
-        throw new Error("Constant is not boolean: " + this);
-    }
-
-    /**
-     * Converts this constant to a primitive long.
-     * @return the long value of this constant
-     */
-    public long asLong() {
-        // Checkstyle: stop
-        switch (kind.stackKind()) {
-            case Jsr:
-            case Int:
-            case Long: return primitive;
-            case Float: return (long) asFloat();
-            case Double: return (long) asDouble();
-            default: throw new Error("Constant is not long: " + this);
-        }
-        // Checkstyle: resume
-    }
-
-    /**
-     * Converts this constant to a primitive float.
-     * @return the float value of this constant
-     */
-    public float asFloat() {
-        if (kind.isFloat()) {
-            return Float.intBitsToFloat((int) primitive);
-        }
-        throw new Error("Constant is not float: " + this);
-    }
-
-    /**
-     * Converts this constant to a primitive double.
-     * @return the double value of this constant
-     */
-    public double asDouble() {
-        if (kind.isFloat()) {
-            return Float.intBitsToFloat((int) primitive);
-        }
-        if (kind.isDouble()) {
-            return Double.longBitsToDouble(primitive);
-        }
-        throw new Error("Constant is not double: " + this);
-    }
-
-    /**
-     * Converts this constant to the object reference it represents.
-     * @return the object which this constant represents
-     */
-    public Object asObject() {
-        if (kind.isObject()) {
-            return object;
-        }
-        throw new Error("Constant is not object: " + this);
-    }
-
-    /**
-     * Converts this constant to the jsr reference it represents.
-     * @return the object which this constant represents
-     */
-    public int asJsr() {
-        if (kind.isJsr()) {
-            return (int) primitive;
-        }
-        throw new Error("Constant is not jsr: " + this);
-    }
-
-    /**
-     * Unchecked access to a primitive value.
-     * @return
-     */
-    public long asPrimitive() {
-        if (kind.isObject()) {
-            throw new Error("Constant is not primitive: " + this);
-        }
-        return primitive;
-    }
-
-    /**
-     * Computes the hashcode of this constant.
-     * @return a suitable hashcode for this constant
-     */
-    @Override
-    public int hashCode() {
-        if (kind.isObject()) {
-            return System.identityHashCode(object);
-        }
-        return (int) primitive;
-    }
-
-    /**
-     * Checks whether this constant equals another object. This is only
-     * true if the other object is a constant and has the same value.
-     * @param o the object to compare equality
-     * @return {@code true} if this constant is equivalent to the specified object
-     */
-    @Override
-    public boolean equals(Object o) {
-        return o == this || o instanceof RiConstant && valueEqual((RiConstant) o, false);
-    }
-
-    /**
-     * Checks whether this constant is identical to another constant or has the same value as it.
-     * @param other the constant to compare for equality against this constant
-     * @return {@code true} if this constant is equivalent to {@code other}
-     */
-    public boolean equivalent(RiConstant other) {
-        return other == this || valueEqual(other, false);
-    }
-
-    /**
-     * Checks whether this constant is the default value for its type.
-     * @return {@code true} if the value is the default value for its type; {@code false} otherwise
-     */
-    public boolean isDefaultValue() {
-        // Checkstyle: stop
-        switch (kind.stackKind()) {
-            case Int: return asInt() == 0;
-            case Long: return asLong() == 0;
-            case Float: return this == FLOAT_0;
-            case Double: return this == DOUBLE_0;
-            case Object: return object == null;
-        }
-        // Checkstyle: resume
-        throw new IllegalArgumentException("Cannot det default CiConstant for kind " + kind);
-    }
-
-    /**
-     * Gets the default value for a given kind.
-     *
-     * @return the default value for {@code kind}'s {@linkplain RiKind#stackKind() stack kind}
-     */
-    public static RiConstant defaultValue(RiKind kind) {
-        // Checkstyle: stop
-        switch (kind.stackKind()) {
-            case Int: return INT_0;
-            case Long: return LONG_0;
-            case Float: return FLOAT_0;
-            case Double: return DOUBLE_0;
-            case Object: return NULL_OBJECT;
-        }
-        // Checkstyle: resume
-        throw new IllegalArgumentException("Cannot get default CiConstant for kind " + kind);
-    }
-
-    /**
-     * Creates a boxed double constant.
-     * @param d the double value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forDouble(double d) {
-        if (Double.compare(0.0D, d) == 0) {
-            return DOUBLE_0;
-        }
-        if (Double.compare(d, 1.0D) == 0) {
-            return DOUBLE_1;
-        }
-        return new RiConstant(RiKind.Double, Double.doubleToRawLongBits(d));
-    }
-
-    /**
-     * Creates a boxed float constant.
-     * @param f the float value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forFloat(float f) {
-        if (Float.compare(f, 0.0F) == 0) {
-            return FLOAT_0;
-        }
-        if (Float.compare(f, 1.0F) == 0) {
-            return FLOAT_1;
-        }
-        if (Float.compare(f, 2.0F) == 0) {
-            return FLOAT_2;
-        }
-        return new RiConstant(RiKind.Float, Float.floatToRawIntBits(f));
-    }
-
-    /**
-     * Creates a boxed long constant.
-     * @param i the long value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forLong(long i) {
-        return i == 0 ? LONG_0 : i == 1 ? LONG_1 : new RiConstant(RiKind.Long, i);
-    }
-
-    /**
-     * Creates a boxed integer constant.
-     * @param i the integer value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forInt(int i) {
-        if (i == -1) {
-            return INT_MINUS_1;
-        }
-        if (i >= 0 && i < INT_CONSTANT_CACHE.length) {
-            return INT_CONSTANT_CACHE[i];
-        }
-        return new RiConstant(RiKind.Int, i);
-    }
-
-    /**
-     * Creates a boxed byte constant.
-     * @param i the byte value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forByte(byte i) {
-        return new RiConstant(RiKind.Byte, i);
-    }
-
-    /**
-     * Creates a boxed boolean constant.
-     * @param i the boolean value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forBoolean(boolean i) {
-        return i ? TRUE : FALSE;
-    }
-
-    /**
-     * Creates a boxed char constant.
-     * @param i the char value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forChar(char i) {
-        return new RiConstant(RiKind.Char, i);
-    }
-
-    /**
-     * Creates a boxed short constant.
-     * @param i the short value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forShort(short i) {
-        return new RiConstant(RiKind.Short, i);
-    }
-
-    /**
-     * Creates a boxed address (jsr/ret address) constant.
-     * @param i the address value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forJsr(int i) {
-        return new RiConstant(RiKind.Jsr, i);
-    }
-
-    /**
-     * Creates a boxed object constant.
-     * @param o the object value to box
-     * @return a boxed copy of {@code value}
-     */
-    public static RiConstant forObject(Object o) {
-        if (o == null) {
-            return NULL_OBJECT;
-        }
-        return new RiConstant(RiKind.Object, o);
-    }
-
-    /**
-     * Creates a boxed constant for the given kind from an Object.
-     * The object needs to be of the Java boxed type corresponding to the kind.
-     * @param kind the kind of the constant to create
-     * @param value the Java boxed value: a Byte instance for CiKind Byte, etc.
-     * @return the boxed copy of {@code value}
-     */
-    public static RiConstant forBoxed(RiKind kind, Object value) {
-        switch (kind) {
-            case Boolean:
-                return forBoolean((Boolean) value);
-            case Byte:
-                return forByte((Byte) value);
-            case Char:
-                return forChar((Character) value);
-            case Short:
-                return forShort((Short) value);
-            case Int:
-                return forInt((Integer) value);
-            case Long:
-                return forLong((Long) value);
-            case Float:
-                return forFloat((Float) value);
-            case Double:
-                return forDouble((Double) value);
-            case Object:
-                return forObject(value);
-            default:
-                throw new RuntimeException("cannot create CiConstant for boxed " + kind + " value");
-        }
-    }
-}
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiKind.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiKind.java	Fri Jun 08 23:41:02 2012 +0200
@@ -394,28 +394,28 @@
         }
     }
 
-    public RiConstant readUnsafeConstant(Object value, long displacement) {
+    public Constant readUnsafeConstant(Object value, long displacement) {
         assert value != null;
         Unsafe u = Unsafe.getUnsafe();
         switch(this) {
             case Boolean:
-                return RiConstant.forBoolean(u.getBoolean(value, displacement));
+                return Constant.forBoolean(u.getBoolean(value, displacement));
             case Byte:
-                return RiConstant.forByte(u.getByte(value, displacement));
+                return Constant.forByte(u.getByte(value, displacement));
             case Char:
-                return RiConstant.forChar(u.getChar(value, displacement));
+                return Constant.forChar(u.getChar(value, displacement));
             case Short:
-                return RiConstant.forShort(u.getShort(value, displacement));
+                return Constant.forShort(u.getShort(value, displacement));
             case Int:
-                return RiConstant.forInt(u.getInt(value, displacement));
+                return Constant.forInt(u.getInt(value, displacement));
             case Long:
-                return RiConstant.forLong(u.getLong(value, displacement));
+                return Constant.forLong(u.getLong(value, displacement));
             case Float:
-                return RiConstant.forFloat(u.getFloat(value, displacement));
+                return Constant.forFloat(u.getFloat(value, displacement));
             case Double:
-                return RiConstant.forDouble(u.getDouble(value, displacement));
+                return Constant.forDouble(u.getDouble(value, displacement));
             case Object:
-                return RiConstant.forObject(u.getObject(value, displacement));
+                return Constant.forObject(u.getObject(value, displacement));
             default:
                 assert false : "unexpected kind: " + this;
                 return null;
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedField.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedField.java	Fri Jun 08 23:41:02 2012 +0200
@@ -45,7 +45,7 @@
      * @param receiver object from which this field's value is to be read. This value is ignored if this field is static.
      * @return the constant value of this field or {@code null} if the constant value is not available
      */
-    RiConstant constantValue(RiConstant receiver);
+    Constant constantValue(Constant receiver);
 
     /**
      * Gets the holder of this field as a compiler-runtime interface type.
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedType.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/RiResolvedType.java	Fri Jun 08 23:41:02 2012 +0200
@@ -37,7 +37,7 @@
      * @param r the part of the this type
      * @return a constant representing a reference to the specified part of this type
      */
-    RiConstant getEncoding(Representation r);
+    Constant getEncoding(Representation r);
 
     /**
      * Checks whether this type has any subclasses so far. Any decisions
@@ -105,7 +105,7 @@
      * @param obj the object to test
      * @return {@code true} if the object is an instance of this type
      */
-    boolean isInstance(RiConstant obj);
+    boolean isInstance(Constant obj);
 
     /**
      * Attempts to get an exact type for this type. Final classes,
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/DebugInfoBuilder.java	Fri Jun 08 23:41:02 2012 +0200
@@ -170,7 +170,7 @@
         } else if (value != null) {
             Debug.metric("StateVariables").increment();
             RiValue operand = nodeOperands.get(value);
-            assert operand != null && (operand instanceof Variable || operand instanceof RiConstant);
+            assert operand != null && (operand instanceof Variable || operand instanceof Constant);
             return operand;
 
         } else {
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/LIRGenerator.java	Fri Jun 08 23:41:02 2012 +0200
@@ -229,14 +229,14 @@
     }
 
     public RiValue loadNonConst(RiValue value) {
-        if (isConstant(value) && !canInlineConstant((RiConstant) value)) {
+        if (isConstant(value) && !canInlineConstant((Constant) value)) {
             return emitMove(value);
         }
         return value;
     }
 
     public RiValue loadForStore(RiValue value, RiKind storeKind) {
-        if (isConstant(value) && canStoreConstant((RiConstant) value)) {
+        if (isConstant(value) && canStoreConstant((Constant) value)) {
             return value;
         }
         if (storeKind == RiKind.Byte || storeKind == RiKind.Boolean) {
@@ -723,12 +723,12 @@
 
     private void emitNullCheckBranch(IsNullNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, LIRDebugInfo info) {
         if (falseSuccessor != null) {
-            emitBranch(operand(node.object()), RiConstant.NULL_OBJECT, Condition.NE, false, falseSuccessor, info);
+            emitBranch(operand(node.object()), Constant.NULL_OBJECT, Condition.NE, false, falseSuccessor, info);
             if (trueSuccessor != null) {
                 emitJump(trueSuccessor, null);
             }
         } else {
-            emitBranch(operand(node.object()), RiConstant.NULL_OBJECT, Condition.EQ, false, trueSuccessor, info);
+            emitBranch(operand(node.object()), Constant.NULL_OBJECT, Condition.EQ, false, trueSuccessor, info);
         }
     }
 
@@ -788,7 +788,7 @@
     }
 
     private Variable emitNullCheckConditional(IsNullNode node, RiValue trueValue, RiValue falseValue) {
-        return emitCMove(operand(node.object()), RiConstant.NULL_OBJECT, Condition.EQ, false, trueValue, falseValue);
+        return emitCMove(operand(node.object()), Constant.NULL_OBJECT, Condition.EQ, false, trueValue, falseValue);
     }
 
     private Variable emitInstanceOfConditional(InstanceOfNode x, RiValue trueValue, RiValue falseValue) {
@@ -963,7 +963,7 @@
             argumentList = Collections.emptyList();
         }
 
-        emitCall(target, physReg, argumentList, RiConstant.forLong(0), info, null);
+        emitCall(target, physReg, argumentList, Constant.forLong(0), info, null);
 
         if (isLegal(physReg)) {
             return emitMove(physReg);
@@ -998,7 +998,7 @@
             info = stateFor(stateBeforeReturn, -1);
         }
 
-        emitCall(x.call(), resultOperand, argList, RiConstant.forLong(0), info, null);
+        emitCall(x.call(), resultOperand, argList, Constant.forLong(0), info, null);
 
         if (isLegal(resultOperand)) {
             setResult(x, emitMove(resultOperand));
@@ -1011,7 +1011,7 @@
         if (x.numberOfCases() == 0 || x.numberOfCases() < GraalOptions.SequentialSwitchLimit) {
             int len = x.numberOfCases();
             for (int i = 0; i < len; i++) {
-                emitBranch(tag, RiConstant.forInt(x.keyAt(i)), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
+                emitBranch(tag, Constant.forInt(x.keyAt(i)), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
             }
             emitJump(getLIRBlock(x.defaultSuccessor()), null);
         } else {
@@ -1027,7 +1027,7 @@
             int loKey = x.lowKey();
             int len = x.numberOfCases();
             for (int i = 0; i < len; i++) {
-                emitBranch(value, RiConstant.forInt(i + loKey), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
+                emitBranch(value, Constant.forInt(i + loKey), Condition.EQ, false, getLIRBlock(x.blockSuccessor(i)), null);
             }
             emitJump(getLIRBlock(x.defaultSuccessor()), null);
         } else {
@@ -1101,14 +1101,14 @@
             int highKey = oneRange.highKey;
             LabelRef dest = oneRange.sux;
             if (lowKey == highKey) {
-                emitBranch(value, RiConstant.forInt(lowKey), Condition.EQ, false, dest, null);
+                emitBranch(value, Constant.forInt(lowKey), Condition.EQ, false, dest, null);
             } else if (highKey - lowKey == 1) {
-                emitBranch(value, RiConstant.forInt(lowKey), Condition.EQ, false, dest, null);
-                emitBranch(value, RiConstant.forInt(highKey), Condition.EQ, false, dest, null);
+                emitBranch(value, Constant.forInt(lowKey), Condition.EQ, false, dest, null);
+                emitBranch(value, Constant.forInt(highKey), Condition.EQ, false, dest, null);
             } else {
                 Label l = new Label();
-                emitBranch(value, RiConstant.forInt(lowKey), Condition.LT, false, LabelRef.forLabel(l), null);
-                emitBranch(value, RiConstant.forInt(highKey), Condition.LE, false, dest, null);
+                emitBranch(value, Constant.forInt(lowKey), Condition.LT, false, LabelRef.forLabel(l), null);
+                emitBranch(value, Constant.forInt(highKey), Condition.LE, false, dest, null);
                 emitLabel(l, false);
             }
         }
@@ -1302,7 +1302,7 @@
             argumentList = Util.uncheckedCast(Collections.emptyList());
         }
 
-        emitCall(runtimeCall, physReg, argumentList, RiConstant.forLong(0), info, null);
+        emitCall(runtimeCall, physReg, argumentList, Constant.forLong(0), info, null);
 
         return physReg;
     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/CanonicalizerPhase.java	Fri Jun 08 23:41:02 2012 +0200
@@ -109,7 +109,7 @@
          * Determines if a given constant is an object/array whose current
          * fields/elements will never change.
          */
-        boolean apply(RiConstant constant);
+        boolean apply(Constant constant);
     }
 
     private void processWorkSet(StructuredGraph graph) {
@@ -269,7 +269,7 @@
         }
 
         @Override
-        public boolean isImmutable(RiConstant objectConstant) {
+        public boolean isImmutable(Constant objectConstant) {
             return immutabilityPredicate != null && immutabilityPredicate.apply(objectConstant);
         }
     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java	Fri Jun 08 23:41:02 2012 +0200
@@ -86,7 +86,7 @@
             }
 
             // Call the method
-            RiConstant constant = callMethod(target.signature().returnKind(), target.holder().toJava(), target.name(), parameterTypes, receiver, arguments);
+            Constant constant = callMethod(target.signature().returnKind(), target.holder().toJava(), target.name(), parameterTypes, receiver, arguments);
 
             if (constant != null) {
                 // Replace the invoke with the result of the call
@@ -120,7 +120,7 @@
             if (folding || CiUtil.getParameterAnnotation(ConstantNodeParameter.class, parameterIndex, target) != null) {
                 assert argument instanceof ConstantNode : "parameter " + parameterIndex + " must be a compile time constant for calling " + invoke.callTarget().targetMethod() + ": " + argument;
                 ConstantNode constantNode = (ConstantNode) argument;
-                RiConstant constant = constantNode.asConstant();
+                Constant constant = constantNode.asConstant();
                 Object o = constant.boxedValue();
                 if (o instanceof Class< ? >) {
                     reflectionCallArguments[i] = runtime.getType((Class< ? >) o);
@@ -214,7 +214,7 @@
     /**
      * Calls a Java method via reflection.
      */
-    private static RiConstant callMethod(RiKind returnKind, Class< ? > holder, String name, Class< ? >[] parameterTypes, Object receiver, Object[] arguments) {
+    private static Constant callMethod(RiKind returnKind, Class< ? > holder, String name, Class< ? >[] parameterTypes, Object receiver, Object[] arguments) {
         Method method;
         try {
             method = holder.getDeclaredMethod(name, parameterTypes);
@@ -227,7 +227,7 @@
             if (result == null) {
                 return null;
             }
-            return RiConstant.forBoxed(returnKind, result);
+            return Constant.forBoxed(returnKind, result);
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64DeoptimizationStub.java	Fri Jun 08 23:41:02 2012 +0200
@@ -58,7 +58,7 @@
         if (GraalOptions.CreateDeoptInfo && deoptInfo != null) {
             masm.nop();
             keepAlive.add(deoptInfo.toString());
-            AMD64Move.move(tasm, masm, scratch.asValue(), RiConstant.forObject(deoptInfo));
+            AMD64Move.move(tasm, masm, scratch.asValue(), Constant.forObject(deoptInfo));
             // TODO Make this an explicit calling convention instead of using a scratch register
             AMD64Call.directCall(tasm, masm, CiRuntimeCall.SetDeoptInfo, info);
         }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64LIRGenerator.java	Fri Jun 08 23:41:02 2012 +0200
@@ -113,7 +113,7 @@
     }
 
     @Override
-    public boolean canStoreConstant(RiConstant c) {
+    public boolean canStoreConstant(Constant c) {
         // there is no immediate move of 64-bit constants on Intel
         switch (c.kind) {
             case Long:   return Util.isInt(c.asLong());
@@ -124,7 +124,7 @@
     }
 
     @Override
-    public boolean canInlineConstant(RiConstant c) {
+    public boolean canInlineConstant(Constant c) {
         switch (c.kind) {
             case Long:   return NumUtil.isInt(c.asLong());
             case Object: return c.isNull();
@@ -286,8 +286,8 @@
         switch (input.kind) {
             case Int:    append(new Op1Stack(INEG, result, input)); break;
             case Long:   append(new Op1Stack(LNEG, result, input)); break;
-            case Float:  append(new Op2Reg(FXOR, result, input, RiConstant.forFloat(Float.intBitsToFloat(0x80000000)))); break;
-            case Double: append(new Op2Reg(DXOR, result, input, RiConstant.forDouble(Double.longBitsToDouble(0x8000000000000000L)))); break;
+            case Float:  append(new Op2Reg(FXOR, result, input, Constant.forFloat(Float.intBitsToFloat(0x80000000)))); break;
+            case Double: append(new Op2Reg(DXOR, result, input, Constant.forDouble(Double.longBitsToDouble(0x8000000000000000L)))); break;
             default: throw GraalInternalError.shouldNotReachHere();
         }
         return result;
@@ -607,7 +607,7 @@
         append(new CompareAndSwapOp(rax, address, rax, newValue));
 
         Variable result = newVariable(node.kind());
-        append(new CondMoveOp(result, Condition.EQ, load(RiConstant.TRUE), RiConstant.FALSE));
+        append(new CondMoveOp(result, Condition.EQ, load(Constant.TRUE), Constant.FALSE));
         setResult(node, result);
     }
 }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/target/amd64/AMD64XirOp.java	Fri Jun 08 23:41:02 2012 +0200
@@ -195,7 +195,7 @@
                     CiAddress src;
                     if (isConstant(index)) {
                         assert index.kind == RiKind.Int;
-                        RiConstant constantIndex = (RiConstant) index;
+                        Constant constantIndex = (Constant) index;
                         src = new CiAddress(inst.kind, pointer, constantIndex.asInt() * scale.value + displacement);
                     } else {
                         src = new CiAddress(inst.kind, pointer, index, scale, displacement);
@@ -239,7 +239,7 @@
                     CiAddress dst;
                     if (isConstant(index)) {
                         assert index.kind == RiKind.Int;
-                        RiConstant constantIndex = (RiConstant) index;
+                        Constant constantIndex = (Constant) index;
                         dst = new CiAddress(inst.kind, pointer, IllegalValue, scale, constantIndex.asInt() * scale.value + displacement);
                     } else {
                         dst = new CiAddress(inst.kind, pointer, index, scale, displacement);
@@ -371,8 +371,8 @@
                     RiValue offset = operands[inst.y().index];
                     RiValue bit = operands[inst.z().index];
                     assert isConstant(offset) && isConstant(bit);
-                    RiConstant constantOffset = (RiConstant) offset;
-                    RiConstant constantBit = (RiConstant) bit;
+                    Constant constantOffset = (Constant) offset;
+                    Constant constantBit = (Constant) bit;
                     CiAddress src = new CiAddress(inst.kind, pointer, constantOffset.asInt());
                     masm.btli(src, constantBit.asInt());
                     masm.jcc(ConditionFlag.aboveEqual, label);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateObjectTypeFeedback.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateObjectTypeFeedback.java	Fri Jun 08 23:41:02 2012 +0200
@@ -37,7 +37,7 @@
     }
 
     @Override
-    public void constantBound(Condition condition, RiConstant constant) {
+    public void constantBound(Condition condition, Constant constant) {
         delegate.constantBound(condition.negate(), constant);
     }
 
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateScalarTypeFeedback.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/types/NegateScalarTypeFeedback.java	Fri Jun 08 23:41:02 2012 +0200
@@ -37,7 +37,7 @@
     }
 
     @Override
-    public void constantBound(Condition condition, RiConstant constant) {
+    public void constantBound(Condition condition, Constant constant) {
         delegate.constantBound(condition.negate(), constant);
     }
 
@@ -47,7 +47,7 @@
     }
 
     @Override
-    public void setTranslated(RiConstant delta, ScalarTypeQuery old) {
+    public void setTranslated(Constant delta, ScalarTypeQuery old) {
         throw new UnsupportedOperationException();
     }
 }
--- a/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot.server/src/com/oracle/graal/hotspot/server/ReplacingStreams.java	Fri Jun 08 23:41:02 2012 +0200
@@ -166,8 +166,8 @@
             }
 
             // is the object a constant of object type?
-            if (obj.getClass() == RiConstant.class) {
-                RiConstant constant = (RiConstant) obj;
+            if (obj.getClass() == Constant.class) {
+                Constant constant = (Constant) obj;
                 if (constant.kind != RiKind.Object) {
                     return obj;
                 }
@@ -181,12 +181,12 @@
                 }
                 placeholder = objectMap.get(contents);
                 if (placeholder != null) {
-                    return RiConstant.forObject(placeholder);
+                    return Constant.forObject(placeholder);
                 }
                 if (contents instanceof Remote) {
-                    return RiConstant.forObject(createRemoteCallPlaceholder(contents));
+                    return Constant.forObject(createRemoteCallPlaceholder(contents));
                 }
-                return RiConstant.forObject(createDummyPlaceholder(contents));
+                return Constant.forObject(createDummyPlaceholder(contents));
             }
             return obj;
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVM.java	Fri Jun 08 23:41:02 2012 +0200
@@ -87,11 +87,11 @@
 
     RiType RiType_superType(HotSpotTypeResolved klass);
 
-    int getArrayLength(RiConstant array);
+    int getArrayLength(Constant array);
 
-    boolean compareConstantObjects(RiConstant x, RiConstant y);
+    boolean compareConstantObjects(Constant x, Constant y);
 
-    RiType getRiType(RiConstant constant);
+    RiType getRiType(Constant constant);
 
     RiResolvedField[] RiType_fields(HotSpotTypeResolved klass);
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/CompilerToVMImpl.java	Fri Jun 08 23:41:02 2012 +0200
@@ -116,17 +116,17 @@
     public native RiType getType(Class<?> javaClass);
 
     @Override
-    public int getArrayLength(RiConstant array) {
+    public int getArrayLength(Constant array) {
         return Array.getLength(array.asObject());
     }
 
     @Override
-    public boolean compareConstantObjects(RiConstant x, RiConstant y) {
+    public boolean compareConstantObjects(Constant x, Constant y) {
         return x.asObject() == y.asObject();
     }
 
     @Override
-    public RiType getRiType(RiConstant constant) {
+    public RiType getRiType(Constant constant) {
         Object o = constant.asObject();
         if (o == null) {
             return null;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompiler.java	Fri Jun 08 23:41:02 2012 +0200
@@ -57,13 +57,13 @@
 
     RiType createRiTypeUnresolved(String name);
 
-    RiConstant createCiConstant(RiKind kind, long value);
+    Constant createCiConstant(RiKind kind, long value);
 
-    RiConstant createCiConstantFloat(float value);
+    Constant createCiConstantFloat(float value);
 
-    RiConstant createCiConstantDouble(double value);
+    Constant createCiConstantDouble(double value);
 
-    RiConstant createCiConstantObject(Object object);
+    Constant createCiConstantObject(Object object);
 
     PhasePlan createPhasePlan(OptimisticOptimizations optimisticOpts);
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/bridge/VMToCompilerImpl.java	Fri Jun 08 23:41:02 2012 +0200
@@ -452,37 +452,37 @@
     }
 
     @Override
-    public RiConstant createCiConstant(RiKind kind, long value) {
+    public Constant createCiConstant(RiKind kind, long value) {
         if (kind == RiKind.Long) {
-            return RiConstant.forLong(value);
+            return Constant.forLong(value);
         } else if (kind == RiKind.Int) {
-            return RiConstant.forInt((int) value);
+            return Constant.forInt((int) value);
         } else if (kind == RiKind.Short) {
-            return RiConstant.forShort((short) value);
+            return Constant.forShort((short) value);
         } else if (kind == RiKind.Char) {
-            return RiConstant.forChar((char) value);
+            return Constant.forChar((char) value);
         } else if (kind == RiKind.Byte) {
-            return RiConstant.forByte((byte) value);
+            return Constant.forByte((byte) value);
         } else if (kind == RiKind.Boolean) {
-            return (value == 0) ? RiConstant.FALSE : RiConstant.TRUE;
+            return (value == 0) ? Constant.FALSE : Constant.TRUE;
         } else {
             throw new IllegalArgumentException();
         }
     }
 
     @Override
-    public RiConstant createCiConstantFloat(float value) {
-        return RiConstant.forFloat(value);
+    public Constant createCiConstantFloat(float value) {
+        return Constant.forFloat(value);
     }
 
     @Override
-    public RiConstant createCiConstantDouble(double value) {
-        return RiConstant.forDouble(value);
+    public Constant createCiConstantDouble(double value) {
+        return Constant.forDouble(value);
     }
 
     @Override
-    public RiConstant createCiConstantObject(Object object) {
-        return RiConstant.forObject(object);
+    public Constant createCiConstantObject(Object object) {
+        return Constant.forObject(object);
     }
 
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/counters/MethodEntryCounters.java	Fri Jun 08 23:41:02 2012 +0200
@@ -84,7 +84,7 @@
             int off = Unsafe.getUnsafe().arrayBaseOffset(long[].class);
             int scale = Unsafe.getUnsafe().arrayIndexScale(long[].class);
 
-            AMD64Move.move(tasm, masm, counterArr, RiConstant.forObject(counter.counts));
+            AMD64Move.move(tasm, masm, counterArr, Constant.forObject(counter.counts));
             AMD64Move.load(tasm, masm, callerPc, new CiAddress(RiKind.Long, AMD64.rbp.asValue(RiKind.Long), 8), null);
 
             Label done = new Label();
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/WriteBarrier.java	Fri Jun 08 23:41:02 2012 +0200
@@ -37,15 +37,15 @@
 
     protected void generateBarrier(RiValue adr, LIRGeneratorTool gen) {
         HotSpotVMConfig config = HotSpotGraalRuntime.getInstance().getConfig();
-        RiValue base = gen.emitUShr(adr, RiConstant.forInt(config.cardtableShift));
+        RiValue base = gen.emitUShr(adr, Constant.forInt(config.cardtableShift));
 
         long startAddress = config.cardtableStartAddress;
         int displacement = 0;
         if (((int) startAddress) == startAddress) {
             displacement = (int) startAddress;
         } else {
-            base = gen.emitAdd(base, RiConstant.forLong(config.cardtableStartAddress));
+            base = gen.emitAdd(base, Constant.forLong(config.cardtableStartAddress));
         }
-        gen.emitStore(new CiAddress(RiKind.Boolean, base, displacement), RiConstant.FALSE, false);
+        gen.emitStore(new CiAddress(RiKind.Boolean, base, displacement), Constant.FALSE, false);
     }
 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotCompiledMethod.java	Fri Jun 08 23:41:02 2012 +0200
@@ -34,7 +34,7 @@
  * The nmethod also stores a weak reference to the HotSpotCompiledMethod
  * instance which is necessary to keep the nmethod from being unloaded.
  */
-public class HotSpotCompiledMethod extends CompilerObject implements RiCompiledMethod {
+public class HotSpotCompiledMethod extends CompilerObject implements InstalledCode {
 
     private static final long serialVersionUID = 156632908220561612L;
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotField.java	Fri Jun 08 23:41:02 2012 +0200
@@ -43,7 +43,7 @@
     private final RiType type;
     private final int offset;
     private final int accessFlags;
-    private RiConstant constant;                // Constant part only valid for static fields.
+    private Constant constant;                // Constant part only valid for static fields.
 
     public HotSpotField(RiResolvedType holder, String name, RiType type, int offset, int accessFlags) {
         this.holder = holder;
@@ -60,13 +60,13 @@
     }
 
     @Override
-    public RiConstant constantValue(RiConstant receiver) {
+    public Constant constantValue(Constant receiver) {
         if (receiver == null) {
             assert Modifier.isStatic(accessFlags);
             if (constant == null) {
                 if (holder.isInitialized() && holder.toJava() != System.class) {
                     if (Modifier.isFinal(accessFlags()) || assumeStaticFieldsFinal(holder.toJava())) {
-                        RiConstant encoding = holder.getEncoding(Representation.StaticFields);
+                        Constant encoding = holder.getEncoding(Representation.StaticFields);
                         constant = this.kind().readUnsafeConstant(encoding.asObject(), offset);
                     }
                 }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotRuntime.java	Fri Jun 08 23:41:02 2012 +0200
@@ -184,7 +184,7 @@
     }
 
     @Override
-    public RiResolvedType getTypeOf(RiConstant constant) {
+    public RiResolvedType getTypeOf(Constant constant) {
         return (RiResolvedType) compiler.getCompilerToVM().getRiType(constant);
     }
 
@@ -195,7 +195,7 @@
     }
 
     @Override
-    public boolean areConstantObjectsEqual(RiConstant x, RiConstant y) {
+    public boolean areConstantObjectsEqual(Constant x, Constant y) {
         return compiler.getCompilerToVM().compareConstantObjects(x, y);
     }
 
@@ -219,7 +219,7 @@
     }
 
     @Override
-    public int getArrayLength(RiConstant array) {
+    public int getArrayLength(Constant array) {
         return compiler.getCompilerToVM().getArrayLength(array);
     }
 
@@ -480,7 +480,7 @@
     }
 
     @Override
-    public RiCompiledMethod addMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) {
+    public InstalledCode addMethod(RiResolvedMethod method, CiTargetMethod code, CodeInfo[] info) {
         HotSpotCodeInfo hsInfo = makeInfo(method, code, info);
         return compiler.getCompilerToVM().installMethod(new HotSpotTargetMethod((HotSpotMethodResolved) method, code), false, hsInfo);
     }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypePrimitive.java	Fri Jun 08 23:41:02 2012 +0200
@@ -76,7 +76,7 @@
     }
 
     @Override
-    public RiConstant getEncoding(Representation r) {
+    public Constant getEncoding(Representation r) {
         throw GraalInternalError.unimplemented("HotSpotTypePrimitive.getEncoding");
     }
 
@@ -111,7 +111,7 @@
     }
 
     @Override
-    public boolean isInstance(RiConstant obj) {
+    public boolean isInstance(Constant obj) {
         return false;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotTypeResolvedImpl.java	Fri Jun 08 23:41:02 2012 +0200
@@ -113,14 +113,14 @@
     }
 
     @Override
-    public RiConstant getEncoding(Representation r) {
+    public Constant getEncoding(Representation r) {
         switch (r) {
             case JavaClass:
-                return RiConstant.forObject(javaMirror);
+                return Constant.forObject(javaMirror);
             case ObjectHub:
-                return RiConstant.forObject(klassOop());
+                return Constant.forObject(klassOop());
             case StaticFields:
-                return RiConstant.forObject(javaMirror);
+                return Constant.forObject(javaMirror);
             default:
                 return null;
         }
@@ -160,7 +160,7 @@
     }
 
     @Override
-    public boolean isInstance(RiConstant obj) {
+    public boolean isInstance(Constant obj) {
         return javaMirror.isInstance(obj);
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/ri/HotSpotXirGenerator.java	Fri Jun 08 23:41:02 2012 +0200
@@ -89,10 +89,10 @@
 
     private XirConstant wordConst(CiXirAssembler asm, long value) {
         if (target.wordKind == RiKind.Long) {
-            return asm.createConstant(RiConstant.forLong(value));
+            return asm.createConstant(Constant.forLong(value));
         } else {
             assert target.wordKind == RiKind.Int;
-            return asm.createConstant(RiConstant.forInt((int) value));
+            return asm.createConstant(Constant.forInt((int) value));
         }
     }
 
@@ -120,7 +120,7 @@
                 asm.pload(target.wordKind, temp, receiver, true);
             }
             asm.mark(MARK_INVOKEINTERFACE);
-            asm.mov(tempO, asm.createConstant(RiConstant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
+            asm.mov(tempO, asm.createConstant(Constant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
 
             return asm.finishTemplate(addr, "invokeinterface");
         }
@@ -141,7 +141,7 @@
                 asm.pload(target.wordKind, temp, receiver, true);
             }
             asm.mark(MARK_INVOKEVIRTUAL);
-            asm.mov(tempO, asm.createConstant(RiConstant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
+            asm.mov(tempO, asm.createConstant(Constant.forObject(HotSpotProxy.DUMMY_CONSTANT_OBJ)));
 
             return asm.finishTemplate(addr, "invokevirtual");
         }
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/CheckCastSnippets.java	Fri Jun 08 23:41:02 2012 +0200
@@ -45,7 +45,7 @@
 import com.oracle.graal.nodes.extended.*;
 import com.oracle.graal.nodes.java.*;
 import com.oracle.graal.snippets.*;
-import com.oracle.graal.snippets.Snippet.Constant;
+import com.oracle.graal.snippets.Snippet.ConstantParameter;
 import com.oracle.graal.snippets.Snippet.Parameter;
 import com.oracle.graal.snippets.SnippetTemplate.Arguments;
 import com.oracle.graal.snippets.SnippetTemplate.Cache;
@@ -66,7 +66,7 @@
      * Type test used when the type being tested against is a final type.
      */
     @Snippet
-    public static Object checkcastExact(@Parameter("object") Object object, @Parameter("exactHub") Object exactHub, @Constant("checkNull") boolean checkNull) {
+    public static Object checkcastExact(@Parameter("object") Object object, @Parameter("exactHub") Object exactHub, @ConstantParameter("checkNull") boolean checkNull) {
         if (checkNull && object == null) {
             isNull.inc();
             return object;
@@ -88,7 +88,7 @@
      * first.
      */
     @Snippet
-    public static Object checkcastPrimary(@Parameter("hub") Object hub, @Parameter("object") Object object, @Constant("checkNull") boolean checkNull, @Constant("superCheckOffset") int superCheckOffset) {
+    public static Object checkcastPrimary(@Parameter("hub") Object hub, @Parameter("object") Object object, @ConstantParameter("checkNull") boolean checkNull, @ConstantParameter("superCheckOffset") int superCheckOffset) {
         if (checkNull && object == null) {
             isNull.inc();
             return object;
@@ -106,7 +106,7 @@
      * Type test used when the type being tested against is a restricted secondary type.
      */
     @Snippet
-    public static Object checkcastSecondary(@Parameter("hub") Object hub, @Parameter("object") Object object, @Parameter(value = "hints", multiple = true) Object[] hints, @Constant("checkNull") boolean checkNull) {
+    public static Object checkcastSecondary(@Parameter("hub") Object hub, @Parameter("object") Object object, @Parameter(value = "hints", multiple = true) Object[] hints, @ConstantParameter("checkNull") boolean checkNull) {
         if (checkNull && object == null) {
             isNull.inc();
             return object;
@@ -132,7 +132,7 @@
      * in an object array store check).
      */
     @Snippet
-    public static Object checkcastUnknown(@Parameter("hub") Object hub, @Parameter("object") Object object, @Parameter(value = "hints", multiple = true) Object[] hints, @Constant("checkNull") boolean checkNull) {
+    public static Object checkcastUnknown(@Parameter("hub") Object hub, @Parameter("object") Object object, @Parameter(value = "hints", multiple = true) Object[] hints, @ConstantParameter("checkNull") boolean checkNull) {
         if (checkNull && object == null) {
             isNull.inc();
             return object;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/target/amd64/HotSpotAMD64Backend.java	Fri Jun 08 23:41:02 2012 +0200
@@ -72,8 +72,8 @@
                 CiAddress exceptionAddress = new CiAddress(RiKind.Object, thread, config.threadExceptionOopOffset);
                 CiAddress pcAddress = new CiAddress(RiKind.Long, thread, config.threadExceptionPcOffset);
                 RiValue exception = emitLoad(exceptionAddress, false);
-                emitStore(exceptionAddress, RiConstant.NULL_OBJECT, false);
-                emitStore(pcAddress, RiConstant.LONG_0, false);
+                emitStore(exceptionAddress, Constant.NULL_OBJECT, false);
+                emitStore(pcAddress, Constant.LONG_0, false);
                 setResult(x, exception);
             }
 
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Fri Jun 08 23:41:02 2012 +0200
@@ -289,8 +289,8 @@
                 append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
                 frameState.push(RiKind.Object, append(ConstantNode.forObject(null, runtime, currentGraph)));
             }
-        } else if (con instanceof RiConstant) {
-            RiConstant constant = (RiConstant) con;
+        } else if (con instanceof Constant) {
+            Constant constant = (Constant) con;
             frameState.push(constant.kind.stackKind(), appendConstant(constant));
         } else {
             throw new Error("lookupConstant returned an object of incorrect type");
@@ -545,13 +545,13 @@
     }
 
     private void genIfZero(Condition cond) {
-        ValueNode y = appendConstant(RiConstant.INT_0);
+        ValueNode y = appendConstant(Constant.INT_0);
         ValueNode x = frameState.ipop();
         ifNode(x, cond, y);
     }
 
     private void genIfNull(Condition cond) {
-        ValueNode y = appendConstant(RiConstant.NULL_OBJECT);
+        ValueNode y = appendConstant(Constant.NULL_OBJECT);
         ValueNode x = frameState.apop();
         ifNode(x, cond, y);
     }
@@ -636,7 +636,7 @@
         } else {
             ValueNode object = frameState.apop();
             append(currentGraph.add(new FixedGuardNode(currentGraph.unique(new IsNullNode(object)), RiDeoptReason.Unresolved, CiDeoptAction.InvalidateRecompile, graphId)));
-            frameState.apush(appendConstant(RiConstant.NULL_OBJECT));
+            frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
 
@@ -655,7 +655,7 @@
             IfNode ifNode = currentGraph.add(new IfNode(currentGraph.unique(new IsNullNode(object)), successor, deopt, 0));
             append(ifNode);
             lastInstr = successor;
-            frameState.ipush(appendConstant(RiConstant.INT_0));
+            frameState.ipush(appendConstant(Constant.INT_0));
         }
     }
 
@@ -666,7 +666,7 @@
             frameState.apush(append(n));
         } else {
             append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
-            frameState.apush(appendConstant(RiConstant.NULL_OBJECT));
+            frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
 
@@ -707,7 +707,7 @@
             frameState.apush(append(n));
         } else {
             append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
-            frameState.apush(appendConstant(RiConstant.NULL_OBJECT));
+            frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
 
     }
@@ -724,7 +724,7 @@
             frameState.apush(append(n));
         } else {
             append(currentGraph.add(new DeoptimizeNode(CiDeoptAction.InvalidateRecompile, RiDeoptReason.Unresolved, graphId)));
-            frameState.apush(appendConstant(RiConstant.NULL_OBJECT));
+            frameState.apush(appendConstant(Constant.NULL_OBJECT));
         }
     }
 
@@ -821,7 +821,7 @@
     private void genGetStatic(RiField field) {
         RiType holder = field.holder();
         boolean isInitialized = (field instanceof RiResolvedField) && ((RiResolvedType) holder).isInitialized();
-        RiConstant constantValue = null;
+        Constant constantValue = null;
         if (isInitialized) {
             constantValue = ((RiResolvedField) field).constantValue(null);
         }
@@ -1096,7 +1096,7 @@
         append(lookupSwitch);
     }
 
-    private ConstantNode appendConstant(RiConstant constant) {
+    private ConstantNode appendConstant(Constant constant) {
         return ConstantNode.forCiConstant(constant, runtime, currentGraph);
     }
 
@@ -1514,23 +1514,23 @@
         // Checkstyle: stop
         switch (opcode) {
             case NOP            : /* nothing to do */ break;
-            case ACONST_NULL    : frameState.apush(appendConstant(RiConstant.NULL_OBJECT)); break;
-            case ICONST_M1      : frameState.ipush(appendConstant(RiConstant.INT_MINUS_1)); break;
-            case ICONST_0       : frameState.ipush(appendConstant(RiConstant.INT_0)); break;
-            case ICONST_1       : frameState.ipush(appendConstant(RiConstant.INT_1)); break;
-            case ICONST_2       : frameState.ipush(appendConstant(RiConstant.INT_2)); break;
-            case ICONST_3       : frameState.ipush(appendConstant(RiConstant.INT_3)); break;
-            case ICONST_4       : frameState.ipush(appendConstant(RiConstant.INT_4)); break;
-            case ICONST_5       : frameState.ipush(appendConstant(RiConstant.INT_5)); break;
-            case LCONST_0       : frameState.lpush(appendConstant(RiConstant.LONG_0)); break;
-            case LCONST_1       : frameState.lpush(appendConstant(RiConstant.LONG_1)); break;
-            case FCONST_0       : frameState.fpush(appendConstant(RiConstant.FLOAT_0)); break;
-            case FCONST_1       : frameState.fpush(appendConstant(RiConstant.FLOAT_1)); break;
-            case FCONST_2       : frameState.fpush(appendConstant(RiConstant.FLOAT_2)); break;
-            case DCONST_0       : frameState.dpush(appendConstant(RiConstant.DOUBLE_0)); break;
-            case DCONST_1       : frameState.dpush(appendConstant(RiConstant.DOUBLE_1)); break;
-            case BIPUSH         : frameState.ipush(appendConstant(RiConstant.forInt(stream.readByte()))); break;
-            case SIPUSH         : frameState.ipush(appendConstant(RiConstant.forInt(stream.readShort()))); break;
+            case ACONST_NULL    : frameState.apush(appendConstant(Constant.NULL_OBJECT)); break;
+            case ICONST_M1      : frameState.ipush(appendConstant(Constant.INT_MINUS_1)); break;
+            case ICONST_0       : frameState.ipush(appendConstant(Constant.INT_0)); break;
+            case ICONST_1       : frameState.ipush(appendConstant(Constant.INT_1)); break;
+            case ICONST_2       : frameState.ipush(appendConstant(Constant.INT_2)); break;
+            case ICONST_3       : frameState.ipush(appendConstant(Constant.INT_3)); break;
+            case ICONST_4       : frameState.ipush(appendConstant(Constant.INT_4)); break;
+            case ICONST_5       : frameState.ipush(appendConstant(Constant.INT_5)); break;
+            case LCONST_0       : frameState.lpush(appendConstant(Constant.LONG_0)); break;
+            case LCONST_1       : frameState.lpush(appendConstant(Constant.LONG_1)); break;
+            case FCONST_0       : frameState.fpush(appendConstant(Constant.FLOAT_0)); break;
+            case FCONST_1       : frameState.fpush(appendConstant(Constant.FLOAT_1)); break;
+            case FCONST_2       : frameState.fpush(appendConstant(Constant.FLOAT_2)); break;
+            case DCONST_0       : frameState.dpush(appendConstant(Constant.DOUBLE_0)); break;
+            case DCONST_1       : frameState.dpush(appendConstant(Constant.DOUBLE_1)); break;
+            case BIPUSH         : frameState.ipush(appendConstant(Constant.forInt(stream.readByte()))); break;
+            case SIPUSH         : frameState.ipush(appendConstant(Constant.forInt(stream.readShort()))); break;
             case LDC            : // fall through
             case LDC_W          : // fall through
             case LDC2_W         : genLoadConstant(stream.readCPI(), opcode); break;
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Arithmetic.java	Fri Jun 08 23:41:02 2012 +0200
@@ -503,7 +503,7 @@
         tasm.stubs.add(slowPath);
         switch (result.kind) {
             case Int:  masm.cmpl(asIntReg(result),  Integer.MIN_VALUE); break;
-            case Long: masm.cmpq(asLongReg(result), tasm.asLongConstRef(RiConstant.forLong(java.lang.Long.MIN_VALUE))); break;
+            case Long: masm.cmpq(asLongReg(result), tasm.asLongConstRef(Constant.forLong(java.lang.Long.MIN_VALUE))); break;
             default:   throw GraalInternalError.shouldNotReachHere();
         }
         masm.jcc(ConditionFlag.equal, slowPath.start);
@@ -525,8 +525,8 @@
         public void emitCode(TargetMethodAssembler tasm, AMD64MacroAssembler masm) {
             masm.bind(start);
             switch (x.kind) {
-                case Float:  masm.ucomiss(asFloatReg(x),  tasm.asFloatConstRef(RiConstant.FLOAT_0)); break;
-                case Double: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(RiConstant.DOUBLE_0)); break;
+                case Float:  masm.ucomiss(asFloatReg(x),  tasm.asFloatConstRef(Constant.FLOAT_0)); break;
+                case Double: masm.ucomisd(asDoubleReg(x), tasm.asDoubleConstRef(Constant.DOUBLE_0)); break;
                 default:     throw GraalInternalError.shouldNotReachHere();
             }
             Label nan = new Label();
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Compare.java	Fri Jun 08 23:41:02 2012 +0200
@@ -87,7 +87,7 @@
                 case ICMP: masm.cmpl(asIntReg(x), tasm.asIntConst(y)); break;
                 case LCMP: masm.cmpq(asLongReg(x), tasm.asIntConst(y)); break;
                 case ACMP:
-                    if (((RiConstant) y).isNull()) {
+                    if (((Constant) y).isNull()) {
                         masm.cmpq(asObjectReg(x), 0); break;
                     } else {
                         throw GraalInternalError.shouldNotReachHere("Only null object constants are allowed in comparisons");
--- a/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.lir.amd64/src/com/oracle/graal/lir/amd64/AMD64Move.java	Fri Jun 08 23:41:02 2012 +0200
@@ -282,9 +282,9 @@
             }
         } else if (isConstant(input)) {
             if (isRegister(result)) {
-                const2reg(tasm, masm, result, (RiConstant) input);
+                const2reg(tasm, masm, result, (Constant) input);
             } else if (isStackSlot(result)) {
-                const2stack(tasm, masm, result, (RiConstant) input);
+                const2stack(tasm, masm, result, (Constant) input);
             } else {
                 throw GraalInternalError.shouldNotReachHere();
             }
@@ -332,7 +332,7 @@
         }
     }
 
-    private static void const2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, RiValue result, RiConstant input) {
+    private static void const2reg(TargetMethodAssembler tasm, AMD64MacroAssembler masm, RiValue result, Constant input) {
         // Note: we use the kind of the input operand (and not the kind of the result operand) because they don't match
         // in all cases. For example, an object constant can be loaded to a long register when unsafe casts occurred (e.g.,
         // for a write barrier where arithmetic operations are then performed on the pointer).
@@ -384,7 +384,7 @@
         }
     }
 
-    private static void const2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, RiValue result, RiConstant input) {
+    private static void const2stack(TargetMethodAssembler tasm, AMD64MacroAssembler masm, RiValue result, Constant input) {
         switch (input.kind.stackKind()) {
             case Jsr:
             case Int:    masm.movl(tasm.asAddress(result), input.asInt()); break;
@@ -441,7 +441,7 @@
                 default:     throw GraalInternalError.shouldNotReachHere();
             }
         } else if (isConstant(input)) {
-            RiConstant c = (RiConstant) input;
+            Constant c = (Constant) input;
             switch (storeAddr.kind) {
                 case Boolean:
                 case Byte:   masm.movb(storeAddr, c.asInt() & 0xFF); break;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/FrameMap.java	Fri Jun 08 23:41:02 2012 +0200
@@ -317,7 +317,7 @@
     /**
      * Marks the specified location as a reference in the reference map of the debug information.
      * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
-     * {@link RiConstant} is automatically tracked.
+     * {@link Constant} is automatically tracked.
      *
      * @param location The location to be added to the reference map.
      * @param registerRefMap A register reference map, as created by {@link #initRegisterRefMap()}.
@@ -341,7 +341,7 @@
     /**
      * Clears the specified location as a reference in the reference map of the debug information.
      * The tracked location can be a {@link CiRegisterValue} or a {@link CiStackSlot}. Note that a
-     * {@link RiConstant} is automatically tracked.
+     * {@link Constant} is automatically tracked.
      *
      * @param location The location to be removed from the reference map.
      * @param registerRefMap A register reference map, as created by {@link #initRegisterRefMap()}.
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Fri Jun 08 23:41:02 2012 +0200
@@ -202,7 +202,7 @@
         targetMethod.recordSafepoint(pos, debugInfo);
     }
 
-    public CiAddress recordDataReferenceInCode(RiConstant data, int alignment) {
+    public CiAddress recordDataReferenceInCode(Constant data, int alignment) {
         assert data != null;
         int pos = asm.codeBuffer.position();
         Debug.log("Data reference in code: pos = %d, data = %s", pos, data.toString());
@@ -221,7 +221,7 @@
      */
     public int asIntConst(RiValue value) {
         assert (value.kind.stackKind() == RiKind.Int || value.kind == RiKind.Jsr || value.kind == RiKind.Long) && isConstant(value);
-        long c = ((RiConstant) value).asLong();
+        long c = ((Constant) value).asLong();
         if (!(NumUtil.isInt(c))) {
             throw GraalInternalError.shouldNotReachHere();
         }
@@ -237,7 +237,7 @@
 
     public CiAddress asFloatConstRef(RiValue value, int alignment) {
         assert value.kind == RiKind.Float && isConstant(value);
-        return recordDataReferenceInCode((RiConstant) value, alignment);
+        return recordDataReferenceInCode((Constant) value, alignment);
     }
 
     /**
@@ -249,7 +249,7 @@
 
     public CiAddress asDoubleConstRef(RiValue value, int alignment) {
         assert value.kind == RiKind.Double && isConstant(value);
-        return recordDataReferenceInCode((RiConstant) value, alignment);
+        return recordDataReferenceInCode((Constant) value, alignment);
     }
 
     /**
@@ -257,7 +257,7 @@
      */
     public CiAddress asLongConstRef(RiValue value) {
         assert value.kind == RiKind.Long && isConstant(value);
-        return recordDataReferenceInCode((RiConstant) value, 8);
+        return recordDataReferenceInCode((Constant) value, 8);
     }
 
     public CiAddress asIntAddr(RiValue value) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ConstantNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -36,9 +36,9 @@
 @NodeInfo(shortName = "Const")
 public class ConstantNode extends BooleanNode implements LIRLowerable {
 
-    public final RiConstant value;
+    public final Constant value;
 
-    protected ConstantNode(RiConstant value) {
+    protected ConstantNode(Constant value) {
         super(StampFactory.forConstant(value));
         this.value = value;
     }
@@ -47,7 +47,7 @@
      * Constructs a new ConstantNode representing the specified constant.
      * @param value the constant
      */
-    protected ConstantNode(RiConstant value, RiRuntime runtime) {
+    protected ConstantNode(Constant value, RiRuntime runtime) {
         super(StampFactory.forConstant(value, runtime));
         this.value = value;
     }
@@ -65,7 +65,7 @@
         return usages().filter(NodePredicates.isNotA(FrameState.class)).isEmpty();
     }
 
-    public static ConstantNode forCiConstant(RiConstant constant, RiRuntime runtime, Graph graph) {
+    public static ConstantNode forCiConstant(Constant constant, RiRuntime runtime, Graph graph) {
         if (constant.kind == RiKind.Object) {
             return graph.unique(new ConstantNode(constant, runtime));
         } else {
@@ -80,7 +80,7 @@
      * @return a node for a double constant
      */
     public static ConstantNode forDouble(double d, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forDouble(d)));
+        return graph.unique(new ConstantNode(Constant.forDouble(d)));
     }
 
     /**
@@ -90,7 +90,7 @@
      * @return a node for a float constant
      */
     public static ConstantNode forFloat(float f, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forFloat(f)));
+        return graph.unique(new ConstantNode(Constant.forFloat(f)));
     }
 
     /**
@@ -100,7 +100,7 @@
      * @return a node for an long constant
      */
     public static ConstantNode forLong(long i, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forLong(i)));
+        return graph.unique(new ConstantNode(Constant.forLong(i)));
     }
 
     /**
@@ -110,7 +110,7 @@
      * @return a node for an integer constant
      */
     public static ConstantNode forInt(int i, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forInt(i)));
+        return graph.unique(new ConstantNode(Constant.forInt(i)));
     }
 
     /**
@@ -120,7 +120,7 @@
      * @return a node representing the boolean
      */
     public static ConstantNode forBoolean(boolean i, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forBoolean(i)));
+        return graph.unique(new ConstantNode(Constant.forBoolean(i)));
     }
 
     /**
@@ -130,7 +130,7 @@
      * @return a node representing the byte
      */
     public static ConstantNode forByte(byte i, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forByte(i)));
+        return graph.unique(new ConstantNode(Constant.forByte(i)));
     }
 
     /**
@@ -140,7 +140,7 @@
      * @return a node representing the char
      */
     public static ConstantNode forChar(char i, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forChar(i)));
+        return graph.unique(new ConstantNode(Constant.forChar(i)));
     }
 
     /**
@@ -150,7 +150,7 @@
      * @return a node representing the short
      */
     public static ConstantNode forShort(short i, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forShort(i)));
+        return graph.unique(new ConstantNode(Constant.forShort(i)));
     }
 
     /**
@@ -160,7 +160,7 @@
      * @return a node representing the address
      */
     public static ConstantNode forJsr(int i, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forJsr(i)));
+        return graph.unique(new ConstantNode(Constant.forJsr(i)));
     }
 
     /**
@@ -170,7 +170,7 @@
      * @return a node representing the object
      */
     public static ConstantNode forObject(Object o, RiRuntime runtime, Graph graph) {
-        return graph.unique(new ConstantNode(RiConstant.forObject(o), runtime));
+        return graph.unique(new ConstantNode(Constant.forObject(o), runtime));
     }
 
     public static ConstantNode forIntegerKind(RiKind kind, long value, Graph graph) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValueNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -98,10 +98,10 @@
 
     /**
      * Convert this value to a constant if it is a constant, otherwise return null.
-     * @return the {@link RiConstant} represented by this value if it is a constant; {@code null}
+     * @return the {@link Constant} represented by this value if it is a constant; {@code null}
      * otherwise
      */
-    public final RiConstant asConstant() {
+    public final Constant asConstant() {
         if (this instanceof ConstantNode) {
             return ((ConstantNode) this).value;
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/CompareNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -80,9 +80,9 @@
     }
 
 
-    private ValueNode optimizeMaterialize(RiConstant constant, MaterializeNode materializeNode, RiRuntime runtime, Condition cond) {
-        RiConstant trueConstant = materializeNode.trueValue().asConstant();
-        RiConstant falseConstant = materializeNode.falseValue().asConstant();
+    private ValueNode optimizeMaterialize(Constant constant, MaterializeNode materializeNode, RiRuntime runtime, Condition cond) {
+        Constant trueConstant = materializeNode.trueValue().asConstant();
+        Constant falseConstant = materializeNode.falseValue().asConstant();
 
         if (falseConstant != null && trueConstant != null) {
             Boolean trueResult = cond.foldCondition(trueConstant, constant, runtime, unorderedIsTrue());
@@ -109,7 +109,7 @@
         return this;
     }
 
-    protected ValueNode optimizeNormalizeCmp(RiConstant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
+    protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
         throw new GraalInternalError("NormalizeCompareNode connected to %s (%s %s %s)", this, constant, normalizeNode, mirrored);
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/Condition.java	Fri Jun 08 23:41:02 2012 +0200
@@ -246,7 +246,7 @@
      * @return {@link Boolean#TRUE} if the comparison is known to be true,
      * {@link Boolean#FALSE} if the comparison is known to be false
      */
-    public boolean foldCondition(RiConstant lt, RiConstant rt, RiRuntime runtime) {
+    public boolean foldCondition(Constant lt, Constant rt, RiRuntime runtime) {
         assert !lt.kind.isFloatOrDouble() && !rt.kind.isFloatOrDouble();
         return foldCondition(lt, rt, runtime, false);
     }
@@ -259,7 +259,7 @@
      * @param unorderedIsTrue true if an undecided float comparison should result in "true"
      * @return true if the comparison is known to be true, false if the comparison is known to be false
      */
-    public boolean foldCondition(RiConstant lt, RiConstant rt, RiRuntime runtime, boolean unorderedIsTrue) {
+    public boolean foldCondition(Constant lt, Constant rt, RiRuntime runtime, boolean unorderedIsTrue) {
         switch (lt.kind) {
             case Boolean:
             case Byte:
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ConvertNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -89,7 +89,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
         if (value instanceof ConstantNode) {
-            RiConstant c = ((ConstantNode) value).asConstant();
+            Constant c = ((ConstantNode) value).asConstant();
             switch (opcode) {
                 case I2L: return ConstantNode.forLong(c.asInt(), graph());
                 case L2I: return ConstantNode.forInt((int) c.asLong(), graph());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerEqualsNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -53,7 +53,7 @@
     }
 
     @Override
-    protected ValueNode optimizeNormalizeCmp(RiConstant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
+    protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
         if (constant.kind == RiKind.Int && constant.asInt() == 0) {
             ValueNode a = mirrored ? normalizeNode.y() : normalizeNode.x();
             ValueNode b = mirrored ? normalizeNode.x() : normalizeNode.y();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IntegerLessThanNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -53,7 +53,7 @@
     }
 
     @Override
-    protected ValueNode optimizeNormalizeCmp(RiConstant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
+    protected ValueNode optimizeNormalizeCmp(Constant constant, NormalizeCompareNode normalizeNode, boolean mirrored) {
         assert condition() == Condition.LT;
         if (constant.kind == RiKind.Int && constant.asInt() == 0) {
             ValueNode a = mirrored ? normalizeNode.y() : normalizeNode.x();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/IsNullNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -63,7 +63,7 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
-        RiConstant constant = object().asConstant();
+        Constant constant = object().asConstant();
         if (constant != null) {
             assert constant.kind == RiKind.Object;
             return ConstantNode.forBoolean(constant.isNull(), graph());
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/FloatingReadNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -66,7 +66,7 @@
                 Object value = object().asConstant().asObject();
                 long displacement = location().displacement();
                 RiKind kind = location().kind();
-                RiConstant constant = kind.readUnsafeConstant(value, displacement);
+                Constant constant = kind.readUnsafeConstant(value, displacement);
                 if (constant != null) {
                     return ConstantNode.forCiConstant(constant, runtime, graph());
                 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/IndexedLocationNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -68,7 +68,7 @@
 
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
-        RiConstant constantIndex = index.asConstant();
+        Constant constantIndex = index.asConstant();
         if (constantIndex != null && constantIndex.kind.stackKind().isInt()) {
             long constantIndexLong = constantIndex.asInt();
             if (indexScalingEnabled) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -49,7 +49,7 @@
                 Object value = object().asConstant().asObject();
                 long displacement = location().displacement();
                 RiKind kind = location().kind();
-                RiConstant constant = kind.readUnsafeConstant(value, displacement);
+                Constant constant = kind.readUnsafeConstant(value, displacement);
                 if (constant != null) {
                     return ConstantNode.forCiConstant(constant, runtime, graph());
                 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnboxNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -61,7 +61,7 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
         if (source.isConstant()) {
-            RiConstant constant = source.asConstant();
+            Constant constant = source.asConstant();
             Object o = constant.asObject();
             if (o != null) {
                 switch (destinationKind) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ValueAnchorNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -69,7 +69,7 @@
             if (node instanceof IntegerDivNode || node instanceof IntegerRemNode) {
                 ArithmeticNode arithmeticNode = (ArithmeticNode) node;
                 if (arithmeticNode.y().isConstant()) {
-                    RiConstant  constant = arithmeticNode.y().asConstant();
+                    Constant  constant = arithmeticNode.y().asConstant();
                     assert constant.kind == arithmeticNode.kind() : constant.kind + " != " + arithmeticNode.kind();
                     if (constant.asLong() != 0) {
                         continue;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessIndexedNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -70,6 +70,6 @@
 
     @Override
     public void typeFeedback(TypeFeedbackTool tool) {
-        tool.addScalar(index()).constantBound(Condition.GE, RiConstant.INT_0);
+        tool.addScalar(index()).constantBound(Condition.GE, Constant.INT_0);
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -54,7 +54,7 @@
         }
         RiRuntime runtime = tool.runtime();
         if (runtime != null && array().isConstant() && !array().isNullConstant()) {
-            RiConstant constantValue = array().asConstant();
+            Constant constantValue = array().asConstant();
             if (constantValue != null && constantValue.isNonNull()) {
                 return ConstantNode.forInt(runtime.getArrayLength(constantValue), graph());
             }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -81,7 +81,7 @@
             }
         }
 
-        RiConstant constant = object().asConstant();
+        Constant constant = object().asConstant();
         if (constant != null) {
             assert constant.kind == RiKind.Object;
             if (constant.isNull()) {
@@ -101,7 +101,7 @@
     @Override
     public Result canonical(TypeFeedbackTool tool) {
         ObjectTypeQuery query = tool.queryObject(object());
-        if (query.constantBound(Condition.EQ, RiConstant.NULL_OBJECT)) {
+        if (query.constantBound(Condition.EQ, Constant.NULL_OBJECT)) {
             return new Result(object(), query);
         } else if (targetClass() != null) {
             if (query.declaredType(targetClass())) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/InstanceOfNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -104,7 +104,7 @@
             }
         }
 
-        RiConstant constant = object().asConstant();
+        Constant constant = object().asConstant();
         if (constant != null) {
             assert constant.kind == RiKind.Object;
             if (constant.isNull()) {
@@ -124,13 +124,13 @@
     @Override
     public Result canonical(TypeFeedbackTool tool) {
         ObjectTypeQuery query = tool.queryObject(object());
-        if (query.constantBound(Condition.EQ, RiConstant.NULL_OBJECT)) {
+        if (query.constantBound(Condition.EQ, Constant.NULL_OBJECT)) {
             return new Result(ConstantNode.forBoolean(false, graph()), query);
         } else if (targetClass() != null) {
             if (query.notDeclaredType(targetClass())) {
                 return new Result(ConstantNode.forBoolean(false, graph()), query);
             }
-            if (query.constantBound(Condition.NE, RiConstant.NULL_OBJECT)) {
+            if (query.constantBound(Condition.NE, Constant.NULL_OBJECT)) {
                 if (query.declaredType(targetClass())) {
                     return new Result(ConstantNode.forBoolean(true, graph()), query);
                 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/IsTypeNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -63,8 +63,8 @@
     @Override
     public ValueNode canonical(CanonicalizerTool tool) {
         if (objectClass().isConstant()) {
-            RiConstant constant = objectClass().asConstant();
-            RiConstant typeHub = type.getEncoding(Representation.ObjectHub);
+            Constant constant = objectClass().asConstant();
+            Constant typeHub = type.getEncoding(Representation.ObjectHub);
             assert constant.kind == typeHub.kind;
             return ConstantNode.forBoolean(constant.equivalent(typeHub), graph());
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadFieldNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -57,7 +57,7 @@
     public ValueNode canonical(CanonicalizerTool tool) {
         RiRuntime runtime = tool.runtime();
         if (runtime != null) {
-            RiConstant constant = null;
+            Constant constant = null;
             if (isStatic()) {
                 constant = field().constantValue(null);
             } else if (object().isConstant() && !object().isNullConstant()) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/LoadIndexedNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -64,7 +64,7 @@
     public ValueNode canonical(CanonicalizerTool tool) {
         RiRuntime runtime = tool.runtime();
         if (runtime != null && index().isConstant() && array().isConstant() && !array().isNullConstant()) {
-            RiConstant arrayConst = array().asConstant();
+            Constant arrayConst = array().asConstant();
             if (tool.isImmutable(arrayConst)) {
                 int index = index().asConstant().asInt();
                 Object array = arrayConst.asObject();
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewArrayNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -79,7 +79,7 @@
     @Override
     public void typeFeedback(TypeFeedbackTool tool) {
         assert length.kind() == RiKind.Int;
-        tool.addScalar(length).constantBound(Condition.GE, RiConstant.INT_0);
+        tool.addScalar(length).constantBound(Condition.GE, Constant.INT_0);
     }
 
     public EscapeOp getEscapeOp() {
@@ -91,7 +91,7 @@
         @Override
         public boolean canAnalyze(Node node) {
             NewArrayNode x = (NewArrayNode) node;
-            RiConstant length = x.dimension(0).asConstant();
+            Constant length = x.dimension(0).asConstant();
             return length != null && length.asInt() >= 0 && length.asInt() < MaximumEscapeAnalysisArrayLength;
         }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/NewMultiArrayNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -74,7 +74,7 @@
     public void typeFeedback(TypeFeedbackTool tool) {
         for (ValueNode length : dimensions) {
             assert length.kind() == RiKind.Int;
-            tool.addScalar(length).constantBound(Condition.GE, RiConstant.INT_0);
+            tool.addScalar(length).constantBound(Condition.GE, Constant.INT_0);
         }
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/CanonicalizerTool.java	Fri Jun 08 23:41:02 2012 +0200
@@ -35,5 +35,5 @@
      * Determines if a given constant is an object/array whose current
      * fields/elements will never change.
      */
-    boolean isImmutable(RiConstant objectConstant);
+    boolean isImmutable(Constant objectConstant);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeOp.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/EscapeOp.java	Fri Jun 08 23:41:02 2012 +0200
@@ -94,9 +94,9 @@
     }
 
     public static boolean isValidConstantIndex(AccessIndexedNode x) {
-        RiConstant index = x.index().asConstant();
+        Constant index = x.index().asConstant();
         if (x.array() instanceof NewArrayNode) {
-            RiConstant length = ((NewArrayNode) x.array()).dimension(0).asConstant();
+            Constant length = ((NewArrayNode) x.array()).dimension(0).asConstant();
             return index != null && length != null && index.asInt() >= 0 && index.asInt() < length.asInt();
         } else {
             return false;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/LIRGeneratorTool.java	Fri Jun 08 23:41:02 2012 +0200
@@ -38,7 +38,7 @@
      * @param c The constant to check.
      * @return True if the constant can be used directly, false if the constant needs to be in a register.
      */
-    public abstract boolean canInlineConstant(RiConstant c);
+    public abstract boolean canInlineConstant(Constant c);
 
     /**
      * Checks whether the supplied constant can be used without loading it into a register
@@ -46,7 +46,7 @@
      * @param c The constant to check.
      * @return True if the constant can be used directly, false if the constant needs to be in a register.
      */
-    public abstract boolean canStoreConstant(RiConstant c);
+    public abstract boolean canStoreConstant(Constant c);
 
     public abstract RiValue operand(ValueNode object);
     public abstract RiValue newVariable(RiKind kind);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackStore.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackStore.java	Fri Jun 08 23:41:02 2012 +0200
@@ -44,7 +44,7 @@
         }
 
         @Override
-        public boolean constantBound(Condition condition, final RiConstant constant) {
+        public boolean constantBound(Condition condition, final Constant constant) {
             assert condition == Condition.EQ || condition == Condition.NE;
             if (condition == Condition.EQ) {
                 return store.prove(Equals.class, new BooleanPredicate<Equals>() {
@@ -149,9 +149,9 @@
     }
 
     private static final class Equals extends Info {
-        public final RiConstant constant;
+        public final Constant constant;
 
-        public Equals(RiConstant constant) {
+        public Equals(Constant constant) {
             this.constant = constant;
         }
 
@@ -162,9 +162,9 @@
     }
 
     private static final class NotEquals extends Info {
-        public final RiConstant constant;
+        public final Constant constant;
 
-        public NotEquals(RiConstant constant) {
+        public NotEquals(Constant constant) {
             this.constant = constant;
         }
 
@@ -290,7 +290,7 @@
     }
 
     @Override
-    public void constantBound(Condition condition, RiConstant constant) {
+    public void constantBound(Condition condition, Constant constant) {
         assert condition == Condition.EQ || condition == Condition.NE;
 
         if (condition == Condition.EQ) {
@@ -357,7 +357,7 @@
                 if (typeInfo.type == type && index == 0) {
                     if (index == 0) {
                         if (nonNull) {
-                            constantBound(Condition.NE, RiConstant.NULL_OBJECT);
+                            constantBound(Condition.NE, Constant.NULL_OBJECT);
                         }
                         return;
                     } else {
@@ -369,7 +369,7 @@
         infos.add(new ObjectTypeDeclared(type));
         updateDependency();
         if (nonNull) {
-            constantBound(Condition.NE, RiConstant.NULL_OBJECT);
+            constantBound(Condition.NE, Constant.NULL_OBJECT);
         }
     }
 
@@ -384,7 +384,7 @@
                 ObjectTypeExact typeInfo = (ObjectTypeExact) info;
                 if (typeInfo.type == type && index == 0) {
                     if (index == 0) {
-                        constantBound(Condition.NE, RiConstant.NULL_OBJECT);
+                        constantBound(Condition.NE, Constant.NULL_OBJECT);
                         return;
                     } else {
                         iter.remove();
@@ -394,7 +394,7 @@
         }
         infos.add(new ObjectTypeExact(type));
         updateDependency();
-        constantBound(Condition.NE, RiConstant.NULL_OBJECT);
+        constantBound(Condition.NE, Constant.NULL_OBJECT);
     }
 
     @Override
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackTool.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeFeedbackTool.java	Fri Jun 08 23:41:02 2012 +0200
@@ -28,7 +28,7 @@
 
 public interface ObjectTypeFeedbackTool {
 
-    void constantBound(Condition condition, RiConstant constant);
+    void constantBound(Condition condition, Constant constant);
 
     void valueBound(Condition condition, ValueNode otherValue);
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeQuery.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ObjectTypeQuery.java	Fri Jun 08 23:41:02 2012 +0200
@@ -28,7 +28,7 @@
 
 public interface ObjectTypeQuery extends TypeQuery {
 
-    boolean constantBound(Condition condition, RiConstant constant);
+    boolean constantBound(Condition condition, Constant constant);
 
     boolean valueBound(Condition condition, ValueNode otherValue);
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeFeedbackStore.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeFeedbackStore.java	Fri Jun 08 23:41:02 2012 +0200
@@ -39,7 +39,7 @@
         }
 
         @Override
-        public boolean constantBound(Condition condition, RiConstant constant) {
+        public boolean constantBound(Condition condition, Constant constant) {
             if (constant.kind == RiKind.Int || constant.kind == RiKind.Long) {
                 switch (condition) {
                     case EQ:
@@ -156,7 +156,7 @@
     }
 
     @Override
-    public void constantBound(Condition condition, RiConstant constant) {
+    public void constantBound(Condition condition, Constant constant) {
         ConstantBound newBound = createBounds(condition, constant);
         if (newBound != null) {
             if (constantBounds.join(newBound)) {
@@ -165,7 +165,7 @@
         }
     }
 
-    private static ConstantBound createBounds(Condition condition, RiConstant constant) {
+    private static ConstantBound createBounds(Condition condition, Constant constant) {
         ConstantBound newBound;
         if (constant.kind == RiKind.Int || constant.kind == RiKind.Long) {
             switch (condition) {
@@ -236,39 +236,39 @@
             case LE:
             case LT:
                 simpleValueBound(condition, otherValue);
-                constantBound(condition, new RiConstant(kind, other.constantBounds.upperBound));
+                constantBound(condition, new Constant(kind, other.constantBounds.upperBound));
                 break;
             case GE:
             case GT:
                 simpleValueBound(condition, otherValue);
-                constantBound(condition, new RiConstant(kind, other.constantBounds.lowerBound));
+                constantBound(condition, new Constant(kind, other.constantBounds.lowerBound));
                 break;
             case BT:
                 if (other.constantBounds.lowerBound >= 0) {
                     simpleValueBound(Condition.LT, otherValue);
-                    constantBound(Condition.GE, new RiConstant(kind, 0));
-                    constantBound(Condition.LT, new RiConstant(kind, other.constantBounds.upperBound));
+                    constantBound(Condition.GE, new Constant(kind, 0));
+                    constantBound(Condition.LT, new Constant(kind, other.constantBounds.upperBound));
                 }
                 break;
             case BE:
                 if (other.constantBounds.lowerBound >= 0) {
                     simpleValueBound(Condition.LE, otherValue);
-                    constantBound(Condition.GE, new RiConstant(kind, 0));
-                    constantBound(Condition.LE, new RiConstant(kind, other.constantBounds.upperBound));
+                    constantBound(Condition.GE, new Constant(kind, 0));
+                    constantBound(Condition.LE, new Constant(kind, other.constantBounds.upperBound));
                 }
                 break;
             case AT:
                 if (other.constantBounds.upperBound < 0) {
                     simpleValueBound(Condition.GT, otherValue);
-                    constantBound(Condition.LT, new RiConstant(kind, 0));
-                    constantBound(Condition.GT, new RiConstant(kind, other.constantBounds.lowerBound));
+                    constantBound(Condition.LT, new Constant(kind, 0));
+                    constantBound(Condition.GT, new Constant(kind, other.constantBounds.lowerBound));
                 }
                 break;
             case AE:
                 if (other.constantBounds.upperBound < 0) {
                     simpleValueBound(Condition.GE, otherValue);
-                    constantBound(Condition.LT, new RiConstant(kind, 0));
-                    constantBound(Condition.GE, new RiConstant(kind, other.constantBounds.lowerBound));
+                    constantBound(Condition.LT, new Constant(kind, 0));
+                    constantBound(Condition.GE, new Constant(kind, other.constantBounds.lowerBound));
                 }
                 break;
         }
@@ -357,7 +357,7 @@
     }
 
     @Override
-    public void setTranslated(RiConstant deltaConstant, ScalarTypeQuery old) {
+    public void setTranslated(Constant deltaConstant, ScalarTypeQuery old) {
         assert deltaConstant.kind == kind;
         ScalarTypeFeedbackStore other = old.store();
         assert other.kind == kind;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeFeedbackTool.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeFeedbackTool.java	Fri Jun 08 23:41:02 2012 +0200
@@ -28,9 +28,9 @@
 
 public interface ScalarTypeFeedbackTool {
 
-    void constantBound(Condition condition, RiConstant constant);
+    void constantBound(Condition condition, Constant constant);
 
     void valueBound(Condition condition, ValueNode otherValue, ScalarTypeQuery type);
 
-    void setTranslated(RiConstant delta, ScalarTypeQuery old);
+    void setTranslated(Constant delta, ScalarTypeQuery old);
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeQuery.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/spi/types/ScalarTypeQuery.java	Fri Jun 08 23:41:02 2012 +0200
@@ -28,7 +28,7 @@
 
 public interface ScalarTypeQuery extends TypeQuery {
 
-    boolean constantBound(Condition condition, RiConstant constant);
+    boolean constantBound(Condition condition, Constant constant);
 
     boolean valueBound(Condition condition, ValueNode otherValue);
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Fri Jun 08 23:41:02 2012 +0200
@@ -105,7 +105,7 @@
         return new IntegerStamp(RiKind.Long, lowerBound, upperBound);
     }
 
-    public static Stamp forConstant(RiConstant value) {
+    public static Stamp forConstant(Constant value) {
         assert value.kind != RiKind.Object;
         if (value.kind == RiKind.Object) {
             throw new GraalInternalError("unexpected kind: %s", value.kind);
@@ -119,7 +119,7 @@
         }
     }
 
-    public static Stamp forConstant(RiConstant value, RiRuntime runtime) {
+    public static Stamp forConstant(Constant value, RiRuntime runtime) {
         assert value.kind == RiKind.Object;
         if (value.kind == RiKind.Object) {
             RiResolvedType type = value.isNull() ? null : runtime.getTypeOf(value);
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippet.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/Snippet.java	Fri Jun 08 23:41:02 2012 +0200
@@ -70,7 +70,7 @@
      */
     @Retention(RetentionPolicy.RUNTIME)
     @Target(ElementType.PARAMETER)
-    public @interface Constant {
+    public @interface ConstantParameter {
         /**
          * The name of this constant.
          */
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/SnippetTemplate.java	Fri Jun 08 23:41:02 2012 +0200
@@ -38,14 +38,14 @@
 import com.oracle.graal.nodes.java.*;
 import com.oracle.graal.nodes.type.*;
 import com.oracle.graal.nodes.util.*;
-import com.oracle.graal.snippets.Snippet.Constant;
+import com.oracle.graal.snippets.Snippet.ConstantParameter;
 import com.oracle.graal.snippets.Snippet.Multiple;
 import com.oracle.graal.snippets.Snippet.Parameter;
 import com.oracle.graal.snippets.nodes.*;
 
 /**
  * A snippet template is a graph created by parsing a snippet method and then
- * specialized by binding constants to the snippet's {@link Constant} parameters.
+ * specialized by binding constants to the snippet's {@link ConstantParameter} parameters.
  *
  * Snippet templates can be managed in a {@link Cache}.
  */
@@ -190,14 +190,14 @@
         Parameter[] parameterAnnotations = new Parameter[parameterCount];
         ConstantNode[] placeholders = new ConstantNode[parameterCount];
         for (int i = 0; i < parameterCount; i++) {
-            Constant c = CiUtil.getParameterAnnotation(Constant.class, i, method);
+            ConstantParameter c = CiUtil.getParameterAnnotation(ConstantParameter.class, i, method);
             if (c != null) {
                 String name = c.value();
                 Object arg = key.get(name);
                 assert arg != null : method + ": requires a constant named " + name;
                 RiKind kind = signature.argumentKindAt(i);
                 assert checkConstantArgument(method, signature, i, name, arg, kind);
-                replacements.put(snippetGraph.getLocal(i), ConstantNode.forCiConstant(RiConstant.forBoxed(kind, arg), runtime, snippetCopy));
+                replacements.put(snippetGraph.getLocal(i), ConstantNode.forCiConstant(Constant.forBoxed(kind, arg), runtime, snippetCopy));
             } else {
                 Parameter p = CiUtil.getParameterAnnotation(Parameter.class, i, method);
                 assert p != null : method + ": parameter " + i + " must be annotated with either @Constant or @Parameter";
@@ -385,7 +385,7 @@
                     replacements.put((LocalNode) parameter, (ValueNode) argument);
                 } else {
                     RiKind kind = ((LocalNode) parameter).kind();
-                    RiConstant constant = RiConstant.forBoxed(kind, argument);
+                    Constant constant = Constant.forBoxed(kind, argument);
                     replacements.put((LocalNode) parameter, ConstantNode.forCiConstant(constant, runtime, replaceeGraph));
                 }
             } else {
@@ -398,7 +398,7 @@
                 for (int j = 0; j < length; j++) {
                     LocalNode local = locals[j];
                     assert local != null;
-                    RiConstant constant = RiConstant.forBoxed(local.kind(), Array.get(array, j));
+                    Constant constant = Constant.forBoxed(local.kind(), Array.get(array, j));
                     ConstantNode element = ConstantNode.forCiConstant(constant, runtime, replaceeGraph);
                     replacements.put(local, element);
                 }
--- a/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.snippets/src/com/oracle/graal/snippets/nodes/MathIntrinsicNode.java	Fri Jun 08 23:41:02 2012 +0200
@@ -65,7 +65,7 @@
         Variable input = gen.load(gen.operand(x()));
         Variable result = gen.newVariable(kind());
         switch (operation()) {
-            case ABS:   gen.append(new Op2Reg(DAND, result, input, RiConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)))); break;
+            case ABS:   gen.append(new Op2Reg(DAND, result, input, Constant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)))); break;
             case SQRT:  gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.SQRT, result, input)); break;
             case LOG:   gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.LOG, result, input)); break;
             case LOG10: gen.append(new AMD64MathIntrinsicOp(AMD64MathIntrinsicOp.Opcode.LOG10, result, input)); break;
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/CompiledMethodTest.java	Fri Jun 08 23:41:02 2012 +0200
@@ -27,7 +27,7 @@
 import org.junit.*;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.RiCompiledMethod.*;
+import com.oracle.graal.api.meta.InstalledCode.*;
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.phases.*;
 import com.oracle.graal.graph.*;
@@ -67,7 +67,7 @@
         }
 
         final RiResolvedMethod riMethod = runtime.getRiMethod(method);
-        RiCompiledMethod compiledMethod = compile(riMethod, graph);
+        InstalledCode compiledMethod = compile(riMethod, graph);
         try {
             Object result = compiledMethod.execute("1", "2", "3");
             Assert.assertEquals("1-2-3", result);
@@ -81,7 +81,7 @@
         Method method = getMethod("testMethod");
         final StructuredGraph graph = parse(method);
         final RiResolvedMethod riMethod = runtime.getRiMethod(method);
-        RiCompiledMethod compiledMethod = compile(riMethod, graph);
+        InstalledCode compiledMethod = compile(riMethod, graph);
         try {
             Object result = compiledMethod.executeVarargs("1", "2", "3");
             Assert.assertEquals("1 2 3", result);
@@ -95,7 +95,7 @@
         Method method = getMethod("testMethodVirtual");
         final StructuredGraph graph = parse(method);
         final RiResolvedMethod riMethod = runtime.getRiMethod(method);
-        RiCompiledMethod compiledMethod = compile(riMethod, graph);
+        InstalledCode compiledMethod = compile(riMethod, graph);
         try {
             f1 = "0";
             Object result = compiledMethod.executeVarargs(this, "1", "2", "3");
@@ -123,7 +123,7 @@
             }
         }
 
-        RiCompiledMethod compiledMethod = compile(riMethod, graph);
+        InstalledCode compiledMethod = compile(riMethod, graph);
         final CompilableObject compilableObject = new CompilableObjectImpl(0);
 
         Object result;
@@ -175,9 +175,9 @@
 
     private final class ObjectCompilerImpl implements ObjectCompiler {
 
-        private final RiCompiledMethod compiledMethod;
+        private final InstalledCode compiledMethod;
 
-        private ObjectCompilerImpl(RiCompiledMethod compiledMethod) {
+        private ObjectCompilerImpl(InstalledCode compiledMethod) {
             this.compiledMethod = compiledMethod;
         }
 
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/ConditionTest.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/ConditionTest.java	Fri Jun 08 23:41:02 2012 +0200
@@ -42,8 +42,8 @@
                 boolean implies = c1.implies(c2);
                 if (implies) {
                     for (int i = 0; i < 1000; i++) {
-                        RiConstant a = RiConstant.forInt(rand.nextInt());
-                        RiConstant b = RiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        Constant a = Constant.forInt(rand.nextInt());
+                        Constant b = Constant.forInt(i < 100 ? a.asInt() : rand.nextInt());
                         boolean result1 = c1.foldCondition(a, b, null, false);
                         boolean result2 = c2.foldCondition(a, b, null, false);
                         if (result1 && implies) {
@@ -64,8 +64,8 @@
                 assertTrue(join == c2.join(c1));
                 if (join != null) {
                     for (int i = 0; i < 1000; i++) {
-                        RiConstant a = RiConstant.forInt(rand.nextInt());
-                        RiConstant b = RiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        Constant a = Constant.forInt(rand.nextInt());
+                        Constant b = Constant.forInt(i < 100 ? a.asInt() : rand.nextInt());
                         boolean result1 = c1.foldCondition(a, b, null, false);
                         boolean result2 = c2.foldCondition(a, b, null, false);
                         boolean resultJoin = join.foldCondition(a, b, null, false);
@@ -87,8 +87,8 @@
                 assertTrue(meet == c2.meet(c1));
                 if (meet != null) {
                     for (int i = 0; i < 1000; i++) {
-                        RiConstant a = RiConstant.forInt(rand.nextInt());
-                        RiConstant b = RiConstant.forInt(i < 100 ? a.asInt() : rand.nextInt());
+                        Constant a = Constant.forInt(rand.nextInt());
+                        Constant b = Constant.forInt(i < 100 ? a.asInt() : rand.nextInt());
                         boolean result1 = c1.foldCondition(a, b, null, false);
                         boolean result2 = c2.foldCondition(a, b, null, false);
                         boolean resultMeet = meet.foldCondition(a, b, null, false);
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/EscapeAnalysisTest.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/EscapeAnalysisTest.java	Fri Jun 08 23:41:02 2012 +0200
@@ -41,7 +41,7 @@
 
     @Test
     public void test1() {
-        test("test1Snippet", RiConstant.forInt(101));
+        test("test1Snippet", Constant.forInt(101));
     }
 
     @SuppressWarnings("all")
@@ -52,7 +52,7 @@
 
     @Test
     public void test2() {
-        test("test2Snippet", RiConstant.forInt(0));
+        test("test2Snippet", Constant.forInt(0));
     }
 
     @SuppressWarnings("all")
@@ -63,7 +63,7 @@
 
     @Test
     public void test3() {
-        test("test3Snippet", RiConstant.forObject(null));
+        test("test3Snippet", Constant.forObject(null));
     }
 
     @SuppressWarnings("all")
@@ -74,7 +74,7 @@
 
     @Test
     public void testMonitor() {
-        test("testMonitorSnippet", RiConstant.forInt(0));
+        test("testMonitorSnippet", Constant.forInt(0));
     }
 
     private static native void notInlineable();
@@ -95,7 +95,7 @@
     }
 
     public void testMonitor2() {
-        test("testMonitor2Snippet", RiConstant.forInt(0));
+        test("testMonitor2Snippet", Constant.forInt(0));
     }
 
     /**
@@ -116,7 +116,7 @@
         }
     }
 
-    private void test(String snippet, RiConstant expectedResult) {
+    private void test(String snippet, Constant expectedResult) {
         StructuredGraph graph = parse(snippet);
         for (Invoke n : graph.getInvokes()) {
             n.node().setProbability(100000);
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/GraphTest.java	Fri Jun 08 23:41:02 2012 +0200
@@ -147,21 +147,21 @@
 
     private static int compilationId = 0;
 
-    protected RiCompiledMethod compile(final RiResolvedMethod method, final StructuredGraph graph) {
-        return Debug.scope("Compiling", new DebugDumpScope(String.valueOf(compilationId++), true), new Callable<RiCompiledMethod>() {
-            public RiCompiledMethod call() throws Exception {
+    protected InstalledCode compile(final RiResolvedMethod method, final StructuredGraph graph) {
+        return Debug.scope("Compiling", new DebugDumpScope(String.valueOf(compilationId++), true), new Callable<InstalledCode>() {
+            public InstalledCode call() throws Exception {
                 CiTargetMethod targetMethod = runtime.compile(method, graph);
                 return addMethod(method, targetMethod);
             }
         });
     }
 
-    protected RiCompiledMethod addMethod(final RiResolvedMethod method, final CiTargetMethod tm) {
-        return Debug.scope("CodeInstall", new Object[] {method}, new Callable<RiCompiledMethod>() {
+    protected InstalledCode addMethod(final RiResolvedMethod method, final CiTargetMethod tm) {
+        return Debug.scope("CodeInstall", new Object[] {method}, new Callable<InstalledCode>() {
             @Override
-            public RiCompiledMethod call() throws Exception {
+            public InstalledCode call() throws Exception {
                 final CodeInfo[] info = Debug.isDumpEnabled() ? new CodeInfo[1] : null;
-                RiCompiledMethod installedMethod = runtime.addMethod(method, tm, info);
+                InstalledCode installedMethod = runtime.addMethod(method, tm, info);
                 if (info != null) {
                     Debug.dump(info[0], "After code installation");
                 }
--- a/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeCheckTest.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.graal.tests/src/com/oracle/graal/compiler/tests/TypeCheckTest.java	Fri Jun 08 23:41:02 2012 +0200
@@ -37,7 +37,7 @@
 
     protected abstract void replaceProfile(StructuredGraph graph, RiTypeProfile profile);
 
-    private RiCompiledMethod compile(Method method, RiTypeProfile profile) {
+    private InstalledCode compile(Method method, RiTypeProfile profile) {
         final StructuredGraph graph = parse(method);
         replaceProfile(graph, profile);
         return compile(runtime.getRiMethod(method), graph);
@@ -66,7 +66,7 @@
         } catch (Exception e) {
             throw new RuntimeException(e);
         }
-        RiCompiledMethod compiledMethod = compile(method, profile);
+        InstalledCode compiledMethod = compile(method, profile);
         compiledMethod.method();
 
         if (exception != null) {
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/CiXirAssembler.java	Fri Jun 08 23:41:02 2012 +0200
@@ -224,9 +224,9 @@
     }
 
     public static class XirConstant extends XirOperand implements XirConstantOperand {
-        public final RiConstant value;
+        public final Constant value;
 
-        XirConstant(CiXirAssembler asm, RiConstant value) {
+        XirConstant(CiXirAssembler asm, Constant value) {
             super(asm, value, value.kind);
             this.value = value;
         }
@@ -820,7 +820,7 @@
         return new XirConstantParameter(this, name, kind);
     }
 
-    public XirConstant createConstant(RiConstant constant) {
+    public XirConstant createConstant(Constant constant) {
         assert !finished;
         XirConstant temp = new XirConstant(this, constant);
         constants.add(temp);
@@ -868,19 +868,19 @@
     }
 
     public XirConstant i(int v) {
-        return createConstant(RiConstant.forInt(v));
+        return createConstant(Constant.forInt(v));
     }
 
     public XirConstant l(long v) {
-        return createConstant(RiConstant.forLong(v));
+        return createConstant(Constant.forLong(v));
     }
 
     public XirConstant b(boolean v) {
-        return createConstant(RiConstant.forBoolean(v));
+        return createConstant(Constant.forBoolean(v));
     }
 
     public XirConstant o(Object obj) {
-        return createConstant(RiConstant.forObject(obj));
+        return createConstant(Constant.forObject(obj));
     }
 
     public void reserveOutgoingStack(int size) {
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirArgument.java	Fri Jun 08 23:35:16 2012 +0200
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/xir/XirArgument.java	Fri Jun 08 23:41:02 2012 +0200
@@ -26,14 +26,14 @@
 
 /**
  * Represents an argument to an {@link XirSnippet}.
- * Currently, this is a <i>union </i> type; it is either a {@link RiConstant} or an {@code Object}.
+ * Currently, this is a <i>union </i> type; it is either a {@link Constant} or an {@code Object}.
  */
 public final class XirArgument {
 
-    public final RiConstant constant;
+    public final Constant constant;
     public final Object object;
 
-    private XirArgument(RiConstant value) {
+    private XirArgument(Constant value) {
         this.constant = value;
         this.object = null;
     }
@@ -48,15 +48,15 @@
     }
 
     public static XirArgument forInt(int x) {
-        return new XirArgument(RiConstant.forInt(x));
+        return new XirArgument(Constant.forInt(x));
     }
 
     public static XirArgument forLong(long x) {
-        return new XirArgument(RiConstant.forLong(x));
+        return new XirArgument(Constant.forLong(x));
     }
 
     public static XirArgument forObject(Object o) {
-        return new XirArgument(RiConstant.forObject(o));
+        return new XirArgument(Constant.forObject(o));
     }
 
     @Override
--- a/src/share/vm/classfile/vmSymbols.hpp	Fri Jun 08 23:35:16 2012 +0200
+++ b/src/share/vm/classfile/vmSymbols.hpp	Fri Jun 08 23:41:02 2012 +0200
@@ -309,7 +309,7 @@
   template(com_oracle_max_cri_ci_CiRegisterValue,                     "com/oracle/graal/api/code/CiRegisterValue")                            \
   template(com_oracle_max_cri_ci_CiRegister,                          "com/oracle/graal/api/code/CiRegister")                                 \
   template(com_oracle_max_cri_ci_CiCodePos,                           "com/oracle/graal/api/code/CiCodePos")                                  \
-  template(com_oracle_max_cri_ci_CiConstant,                          "com/oracle/graal/api/meta/RiConstant")                                 \
+  template(com_oracle_max_cri_ci_CiConstant,                          "com/oracle/graal/api/meta/Constant")                                 \
   template(com_oracle_max_cri_ci_CiVirtualObject,                     "com/oracle/graal/api/code/CiVirtualObject")                            \
   template(com_oracle_max_cri_ci_CiMonitorValue,                      "com/oracle/graal/api/code/CiMonitorValue")                             \
   template(com_oracle_max_cri_ci_CiKind,                              "com/oracle/graal/api/meta/RiKind")                                     \
@@ -337,13 +337,13 @@
   template(createRiTypeUnresolved_name,               "createRiTypeUnresolved")                                         \
   template(createRiTypeUnresolved_signature,          "(Ljava/lang/String;)Lcom/oracle/graal/api/meta/RiType;")             \
   template(createCiConstant_name,                     "createCiConstant")                                               \
-  template(createCiConstant_signature,                "(Lcom/oracle/graal/api/meta/RiKind;J)Lcom/oracle/graal/api/meta/RiConstant;") \
+  template(createCiConstant_signature,                "(Lcom/oracle/graal/api/meta/RiKind;J)Lcom/oracle/graal/api/meta/Constant;") \
   template(createCiConstantFloat_name,                "createCiConstantFloat")                                          \
-  template(createCiConstantFloat_signature,           "(F)Lcom/oracle/graal/api/meta/RiConstant;")                          \
+  template(createCiConstantFloat_signature,           "(F)Lcom/oracle/graal/api/meta/Constant;")                          \
   template(createCiConstantDouble_name,               "createCiConstantDouble")                                         \
-  template(createCiConstantDouble_signature,          "(D)Lcom/oracle/graal/api/meta/RiConstant;")                          \
+  template(createCiConstantDouble_signature,          "(D)Lcom/oracle/graal/api/meta/Constant;")                          \
   template(createCiConstantObject_name,               "createCiConstantObject")                                         \
-  template(createCiConstantObject_signature,          "(Ljava/lang/Object;)Lcom/oracle/graal/api/meta/RiConstant;")         \
+  template(createCiConstantObject_signature,          "(Ljava/lang/Object;)Lcom/oracle/graal/api/meta/Constant;")         \
   template(getVMToCompiler_name,                      "getVMToCompiler")                                                     \
   template(getVMToCompiler_signature,                 "()Lcom/oracle/graal/hotspot/bridge/VMToCompiler;")               \
   template(getInstance_name,                          "getInstance")                                                    \
--- a/src/share/vm/graal/graalCompilerToVM.cpp	Fri Jun 08 23:35:16 2012 +0200
+++ b/src/share/vm/graal/graalCompilerToVM.cpp	Fri Jun 08 23:41:02 2012 +0200
@@ -1137,7 +1137,7 @@
 #define HS_COMP_METHOD  "Lcom/oracle/graal/hotspot/ri/HotSpotCompiledMethod;"
 #define HS_CODE_INFO    "Lcom/oracle/graal/hotspot/ri/HotSpotCodeInfo;"
 #define METHOD_DATA     "Lcom/oracle/graal/hotspot/ri/HotSpotMethodData;"
-#define CI_CONSTANT     "Lcom/oracle/graal/api/meta/RiConstant;"
+#define CI_CONSTANT     "Lcom/oracle/graal/api/meta/Constant;"
 #define CI_KIND         "Lcom/oracle/graal/api/meta/RiKind;"
 #define CI_RUNTIME_CALL "Lcom/oracle/graal/api/code/CiRuntimeCall;"
 #define STRING          "Ljava/lang/String;"
--- a/src/share/vm/graal/graalJavaAccess.hpp	Fri Jun 08 23:35:16 2012 +0200
+++ b/src/share/vm/graal/graalJavaAccess.hpp	Fri Jun 08 23:41:02 2012 +0200
@@ -80,7 +80,7 @@
     oop_field(HotSpotType, name, "Ljava/lang/String;")                                  \
   end_class                                                                             \
   start_class(HotSpotField)                                                             \
-    oop_field(HotSpotField, constant, "Lcom/oracle/graal/api/meta/RiConstant;")             \
+    oop_field(HotSpotField, constant, "Lcom/oracle/graal/api/meta/Constant;")             \
     int_field(HotSpotField, offset)                                                     \
     int_field(HotSpotField, accessFlags)                                                \
   end_class                                                                             \
@@ -139,7 +139,7 @@
     oop_field(CiTargetMethod_Call, debugInfo, "Lcom/oracle/graal/api/code/CiDebugInfo;")    \
   end_class                                                                             \
   start_class(CiTargetMethod_DataPatch)                                                 \
-    oop_field(CiTargetMethod_DataPatch, constant, "Lcom/oracle/graal/api/meta/RiConstant;") \
+    oop_field(CiTargetMethod_DataPatch, constant, "Lcom/oracle/graal/api/meta/Constant;") \
     int_field(CiTargetMethod_DataPatch, alignment)                                      \
   end_class                                                                             \
   start_class(CiTargetMethod_Safepoint)                                                 \