changeset 7106:4983da9d3fc7

Merge
author Christian Wimmer <christian.wimmer@oracle.com>
date Thu, 29 Nov 2012 17:43:48 -0800
parents f1f32b695d1e (diff) 9d0b98486483 (current diff)
children e0fcf7802786
files
diffstat 10 files changed, 113 insertions(+), 189 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/Constant.java	Thu Nov 29 17:43:48 2012 -0800
@@ -34,27 +34,27 @@
     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(Kind.Int, i);
+            INT_CONSTANT_CACHE[i] = new Constant(Kind.Int, null, i);
         }
     }
 
-    public static final Constant NULL_OBJECT = new Constant(null);
-    public static final Constant INT_MINUS_1 = new Constant(Kind.Int, -1);
+    public static final Constant NULL_OBJECT = new Constant(Kind.Object, null, 0);
+    public static final Constant INT_MINUS_1 = new Constant(Kind.Int, null, -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(Kind.Long, 0L);
-    public static final Constant LONG_1 = new Constant(Kind.Long, 1L);
-    public static final Constant FLOAT_0 = new Constant(Kind.Float, Float.floatToRawIntBits(0.0F));
-    public static final Constant FLOAT_1 = new Constant(Kind.Float, Float.floatToRawIntBits(1.0F));
-    public static final Constant FLOAT_2 = new Constant(Kind.Float, Float.floatToRawIntBits(2.0F));
-    public static final Constant DOUBLE_0 = new Constant(Kind.Double, Double.doubleToRawLongBits(0.0D));
-    public static final Constant DOUBLE_1 = new Constant(Kind.Double, Double.doubleToRawLongBits(1.0D));
-    public static final Constant TRUE = new Constant(Kind.Boolean, 1L);
-    public static final Constant FALSE = new Constant(Kind.Boolean, 0L);
+    public static final Constant LONG_0 = new Constant(Kind.Long, null, 0L);
+    public static final Constant LONG_1 = new Constant(Kind.Long, null, 1L);
+    public static final Constant FLOAT_0 = new Constant(Kind.Float, null, Float.floatToRawIntBits(0.0F));
+    public static final Constant FLOAT_1 = new Constant(Kind.Float, null, Float.floatToRawIntBits(1.0F));
+    public static final Constant FLOAT_2 = new Constant(Kind.Float, null, Float.floatToRawIntBits(2.0F));
+    public static final Constant DOUBLE_0 = new Constant(Kind.Double, null, Double.doubleToRawLongBits(0.0D));
+    public static final Constant DOUBLE_1 = new Constant(Kind.Double, null, Double.doubleToRawLongBits(1.0D));
+    public static final Constant TRUE = new Constant(Kind.Boolean, null, 1L);
+    public static final Constant FALSE = new Constant(Kind.Boolean, null, 0L);
 
     static {
         assert FLOAT_0 != forFloat(-0.0F) : "Constant for 0.0f must be different from -0.0f";
@@ -75,43 +75,9 @@
      */
     private final long primitive;
 
-    /**
-     * Creates a constant represented by the specified object reference.
-     * @param object the value of this constant
-     */
-    private Constant(Object object) {
-        super(Kind.Object);
-        this.object = object;
-        this.primitive = 0L;
-    }
-
-    /**
-     * Creates a constant represented by the specified primitive.
-     *
-     * @param kind the type of this constant
-     * @param primitive the value of this constant
-     */
-    public Constant(Kind kind, long primitive) {
+    private Constant(Kind kind, Object object, long primitive) {
         super(kind);
-        assert kind != Kind.Object;
-        this.object = null;
-        this.primitive = primitive;
-    }
-
-    /**
-     * Creates an annotated primitive constant. An annotation enables a {@linkplain MetaAccessProvider provider} to
-     * associate some extra semantic or debugging information with a primitive. An annotated primitive constant
-     * is never {@linkplain #equals(Object) equal} to a non-annotated constant.
-     *
-     * @param kind the type of this constant
-     * @param primitive the value of this constant
-     * @param annotation an arbitrary non-null object
-     */
-    public Constant(Kind kind, long primitive, Object annotation) {
-        super(kind);
-        assert kind != Kind.Object;
-        assert annotation != null;
-        this.object = annotation;
+        this.object = object;
         this.primitive = primitive;
     }
 
@@ -194,108 +160,65 @@
     }
 
     /**
-     * Converts this constant to a primitive int.
+     * Returns the primitive int value this constant represents. The constant must have a {@link Kind#getStackKind()} of
+     * {@link Kind#Int}, or kind {@link Kind#Jsr}.
      *
-     * @return the int value of this constant
+     * @return the constant value
      */
     public int asInt() {
-        if (getKind().getStackKind() == Kind.Int || getKind() == Kind.Jsr) {
-            return (int) primitive;
-        }
-        throw new Error("Constant is not int: " + this);
+        assert getKind().getStackKind() == Kind.Int || getKind() == Kind.Jsr;
+        return (int) primitive;
     }
 
     /**
-     * Converts this constant to a primitive boolean.
+     * Returns the primitive boolean value this constant represents. The constant must have kind {@link Kind#Boolean}.
      *
-     * @return the boolean value of this constant
+     * @return the constant value
      */
     public boolean asBoolean() {
-        if (getKind() == Kind.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() {
-        switch (getKind().getStackKind()) {
-            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);
-        }
+        assert getKind() == Kind.Boolean;
+        return primitive != 0L;
     }
 
     /**
-     * Converts this constant to a primitive float.
+     * Returns the primitive long value this constant represents. The constant must have kind {@link Kind#Long}, a
+     * {@link Kind#getStackKind()} of {@link Kind#Int}, or kind {@link Kind#Jsr}.
      *
-     * @return the float value of this constant
+     * @return the constant value
      */
-    public float asFloat() {
-        if (getKind() == Kind.Float) {
-            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 (getKind() == Kind.Float) {
-            return Float.intBitsToFloat((int) primitive);
-        }
-        if (getKind() == Kind.Double) {
-            return Double.longBitsToDouble(primitive);
-        }
-        throw new Error("Constant is not double: " + this);
+    public long asLong() {
+        assert getKind() == Kind.Long || getKind().getStackKind() == Kind.Int || getKind() == Kind.Jsr;
+        return primitive;
     }
 
     /**
-     * Converts this constant to the object reference it represents.
+     * Returns the primitive float value this constant represents. The constant must have kind {@link Kind#Float}.
      *
-     * @return the object which this constant represents
+     * @return the constant value
      */
-    public Object asObject() {
-        if (getKind() == Kind.Object) {
-            return object;
-        }
-        throw new Error("Constant is not object: " + this);
+    public float asFloat() {
+        assert getKind() == Kind.Float;
+        return Float.intBitsToFloat((int) primitive);
     }
 
     /**
-     * Converts this constant to the jsr reference it represents.
+     * Returns the primitive double value this constant represents. The constant must have kind {@link Kind#Double}.
      *
-     * @return the object which this constant represents
+     * @return the constant value
      */
-    public int asJsr() {
-        if (getKind() == Kind.Jsr) {
-            return (int) primitive;
-        }
-        throw new Error("Constant is not jsr: " + this);
+    public double asDouble() {
+        assert getKind() == Kind.Double;
+        return Double.longBitsToDouble(primitive);
     }
 
     /**
-     * Unchecked access to a primitive value.
+     * Returns the object reference this constant represents. The constant must have kind {@link Kind#Object}.
+     *
+     * @return the constant value
      */
-    public long asPrimitive() {
-        if (getKind() == Kind.Object) {
-            throw new Error("Constant is not primitive: " + this);
-        }
-        return primitive;
+    public Object asObject() {
+        assert getKind() == Kind.Object;
+        return object;
     }
 
     /**
@@ -345,7 +268,7 @@
         if (Double.compare(d, 1.0D) == 0) {
             return DOUBLE_1;
         }
-        return new Constant(Kind.Double, Double.doubleToRawLongBits(d));
+        return new Constant(Kind.Double, null, Double.doubleToRawLongBits(d));
     }
 
     /**
@@ -364,7 +287,7 @@
         if (Float.compare(f, 2.0F) == 0) {
             return FLOAT_2;
         }
-        return new Constant(Kind.Float, Float.floatToRawIntBits(f));
+        return new Constant(Kind.Float, null, Float.floatToRawIntBits(f));
     }
 
     /**
@@ -374,7 +297,7 @@
      * @return a boxed copy of {@code value}
      */
     public static Constant forLong(long i) {
-        return i == 0 ? LONG_0 : i == 1 ? LONG_1 : new Constant(Kind.Long, i);
+        return i == 0 ? LONG_0 : i == 1 ? LONG_1 : new Constant(Kind.Long, null, i);
     }
 
     /**
@@ -390,7 +313,7 @@
         if (i >= 0 && i < INT_CONSTANT_CACHE.length) {
             return INT_CONSTANT_CACHE[i];
         }
-        return new Constant(Kind.Int, i);
+        return new Constant(Kind.Int, null, i);
     }
 
     /**
@@ -400,7 +323,7 @@
      * @return a boxed copy of {@code value}
      */
     public static Constant forByte(byte i) {
-        return new Constant(Kind.Byte, i);
+        return new Constant(Kind.Byte, null, i);
     }
 
     /**
@@ -420,7 +343,7 @@
      * @return a boxed copy of {@code value}
      */
     public static Constant forChar(char i) {
-        return new Constant(Kind.Char, i);
+        return new Constant(Kind.Char, null, i);
     }
 
     /**
@@ -430,7 +353,7 @@
      * @return a boxed copy of {@code value}
      */
     public static Constant forShort(short i) {
-        return new Constant(Kind.Short, i);
+        return new Constant(Kind.Short, null, i);
     }
 
     /**
@@ -440,7 +363,7 @@
      * @return a boxed copy of {@code value}
      */
     public static Constant forJsr(int i) {
-        return new Constant(Kind.Jsr, i);
+        return new Constant(Kind.Jsr, null, i);
     }
 
     /**
@@ -453,7 +376,27 @@
         if (o == null) {
             return NULL_OBJECT;
         }
-        return new Constant(o);
+        return new Constant(Kind.Object, o, 0L);
+    }
+
+    /**
+     * Creates an annotated int or long constant. An annotation enables a client to associate some extra semantic or
+     * debugging information with a primitive. An annotated primitive constant is never {@linkplain #equals(Object)
+     * equal} to a non-annotated constant.
+     *
+     * @param kind the type of this constant
+     * @param i the value of this constant
+     * @param annotation an arbitrary non-null object
+     */
+    public static Constant forIntegerKind(Kind kind, long i, Object annotation) {
+        switch (kind) {
+            case Int:
+                return new Constant(kind, annotation, (int) i);
+            case Long:
+                return new Constant(kind, annotation, i);
+            default:
+                throw new IllegalArgumentException("not an integer kind: " + kind);
+        }
     }
 
     /**
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Thu Nov 29 17:43:48 2012 -0800
@@ -38,16 +38,6 @@
      */
     public enum Representation {
         /**
-         * The runtime representation of the data structure containing the static primitive fields of this type.
-         */
-        StaticPrimitiveFields,
-
-        /**
-         * The runtime representation of the data structure containing the static object fields of this type.
-         */
-        StaticObjectFields,
-
-        /**
          * The runtime representation of the Java class object of this type.
          */
         JavaClass,
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaField.java	Thu Nov 29 17:43:48 2012 -0800
@@ -27,7 +27,6 @@
 import java.lang.reflect.*;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.api.meta.ResolvedJavaType.*;
 import com.oracle.graal.hotspot.*;
 import com.oracle.graal.nodes.extended.*;
 import com.oracle.graal.phases.*;
@@ -101,8 +100,7 @@
         if (receiver == null) {
             assert Modifier.isStatic(flags);
             if (holder.isInitialized()) {
-                Constant encoding = holder.getEncoding(getKind() == Kind.Object ? Representation.StaticObjectFields : Representation.StaticPrimitiveFields);
-                return ReadNode.readUnsafeConstant(getKind(), encoding.asObject(), offset);
+                return ReadNode.readUnsafeConstant(getKind(), holder.mirror(), offset);
             }
             return null;
         } else {
@@ -116,7 +114,7 @@
     }
 
     @Override
-    public ResolvedJavaType getDeclaringClass() {
+    public HotSpotResolvedObjectType getDeclaringClass() {
         return holder;
     }
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedObjectType.java	Thu Nov 29 17:43:48 2012 -0800
@@ -249,9 +249,6 @@
                 return Constant.forObject(javaMirror);
             case ObjectHub:
                 return klass();
-            case StaticPrimitiveFields:
-            case StaticObjectFields:
-                return Constant.forObject(javaMirror);
             default:
                 assert false : "Should not reach here.";
                 return null;
@@ -451,7 +448,7 @@
      * Gets the address of the C++ Klass object for this type.
      */
     public Constant klass() {
-        return new Constant(HotSpotGraalRuntime.getInstance().getTarget().wordKind, metaspaceKlass, this);
+        return Constant.forIntegerKind(HotSpotGraalRuntime.getInstance().getTarget().wordKind, metaspaceKlass, this);
     }
 
     public boolean isPrimaryType() {
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Thu Nov 29 17:43:48 2012 -0800
@@ -485,13 +485,14 @@
                 callTarget.replaceAndDelete(loweredCallTarget);
             }
         } else if (n instanceof LoadFieldNode) {
-            LoadFieldNode field = (LoadFieldNode) n;
-            int displacement = ((HotSpotResolvedJavaField) field.field()).offset();
-            assert field.kind() != Kind.Illegal;
-            ReadNode memoryRead = graph.add(new ReadNode(field.object(), LocationNode.create(field.field(), field.field().getKind(), displacement, graph), field.stamp()));
-            memoryRead.dependencies().add(tool.createNullCheckGuard(field.object(), field.leafGraphId()));
-            graph.replaceFixedWithFixed(field, memoryRead);
-            if (field.isVolatile()) {
+            LoadFieldNode loadField = (LoadFieldNode) n;
+            HotSpotResolvedJavaField field = (HotSpotResolvedJavaField) loadField.field();
+            ValueNode object = loadField.isStatic() ? ConstantNode.forObject(field.getDeclaringClass().mirror(), this, graph) : loadField.object();
+            assert loadField.kind() != Kind.Illegal;
+            ReadNode memoryRead = graph.add(new ReadNode(object, LocationNode.create(field, field.getKind(), field.offset(), graph), loadField.stamp()));
+            memoryRead.dependencies().add(tool.createNullCheckGuard(object, loadField.leafGraphId()));
+            graph.replaceFixedWithFixed(loadField, memoryRead);
+            if (loadField.isVolatile()) {
                 MembarNode preMembar = graph.add(new MembarNode(JMM_PRE_VOLATILE_READ));
                 graph.addBeforeFixed(memoryRead, preMembar);
                 MembarNode postMembar = graph.add(new MembarNode(JMM_POST_VOLATILE_READ));
@@ -500,8 +501,9 @@
         } else if (n instanceof StoreFieldNode) {
             StoreFieldNode storeField = (StoreFieldNode) n;
             HotSpotResolvedJavaField field = (HotSpotResolvedJavaField) storeField.field();
-            WriteNode memoryWrite = graph.add(new WriteNode(storeField.object(), storeField.value(), LocationNode.create(field, field.getKind(), field.offset(), graph)));
-            memoryWrite.dependencies().add(tool.createNullCheckGuard(storeField.object(), storeField.leafGraphId()));
+            ValueNode object = storeField.isStatic() ? ConstantNode.forObject(field.getDeclaringClass().mirror(), this, graph) : storeField.object();
+            WriteNode memoryWrite = graph.add(new WriteNode(object, storeField.value(), LocationNode.create(field, field.getKind(), field.offset(), graph)));
+            memoryWrite.dependencies().add(tool.createNullCheckGuard(object, storeField.leafGraphId()));
             memoryWrite.setStateAfter(storeField.stateAfter());
             graph.replaceFixedWithFixed(storeField, memoryWrite);
             FixedWithNextNode last = memoryWrite;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/BeginLockScopeNode.java	Thu Nov 29 17:43:48 2012 -0800
@@ -56,10 +56,11 @@
     public void generate(LIRGenerator gen) {
         gen.lock();
         StackSlot lockData = gen.peekLock();
-        Value result = eliminated ? new Constant(gen.target().wordKind, 0L) : gen.emitLea(lockData);
-        FrameState stateAfter = stateAfter();
-        assert stateAfter != null;
-        gen.setResult(this, result);
+        assert stateAfter() != null;
+        if (!eliminated) {
+            Value result = gen.emitLea(lockData);
+            gen.setResult(this, result);
+        }
     }
 
     @NodeIntrinsic
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/NewObjectSnippets.java	Thu Nov 29 17:43:48 2012 -0800
@@ -273,7 +273,7 @@
 
             ValueNode memory;
             if (!useTLAB) {
-                memory = ConstantNode.forConstant(new Constant(target.wordKind, 0L), runtime, graph);
+                memory = ConstantNode.defaultForKind(target.wordKind, graph);
             } else {
                 ConstantNode sizeNode = ConstantNode.forInt(size, graph);
                 TLABAllocateNode tlabAllocateNode = graph.add(new TLABAllocateNode(sizeNode));
@@ -300,7 +300,7 @@
             final Integer length = lengthNode.isConstant() ? Integer.valueOf(lengthNode.asConstant().asInt()) : null;
             int log2ElementSize = CodeUtil.log2(target.sizeInBytes(elementKind));
             if (!useTLAB) {
-                ConstantNode zero = ConstantNode.forConstant(new Constant(target.wordKind, 0L), runtime, graph);
+                ConstantNode zero = ConstantNode.defaultForKind(target.wordKind, graph);
                 // value for 'size' doesn't matter as it isn't used since a stub call will be made anyway
                 // for both allocation and initialization - it just needs to be non-null
                 ConstantNode size = ConstantNode.forInt(-1, graph);
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Nov 29 17:43:48 2012 -0800
@@ -832,37 +832,28 @@
     }
 
     private void genGetStatic(JavaField field) {
-        JavaType holder = field.getDeclaringClass();
-        boolean isInitialized = (field instanceof ResolvedJavaField) && ((ResolvedJavaType) holder).isInitialized();
-        Constant constantValue = null;
-        if (isInitialized) {
-            constantValue = ((ResolvedJavaField) field).readConstantValue(null);
-        }
-        if (constantValue != null) {
-            frameState.push(constantValue.getKind().getStackKind(), appendConstant(constantValue));
+        Kind kind = field.getKind();
+        if (field instanceof ResolvedJavaField && ((ResolvedJavaType) field.getDeclaringClass()).isInitialized()) {
+            Constant constantValue = ((ResolvedJavaField) field).readConstantValue(null);
+            if (constantValue != null) {
+                frameState.push(constantValue.getKind().getStackKind(), appendConstant(constantValue));
+            } else {
+                LoadFieldNode load = currentGraph.add(new LoadFieldNode(null, (ResolvedJavaField) field, graphId));
+                appendOptimizedLoadField(kind, load);
+            }
         } else {
-            ValueNode container = genTypeOrDeopt(field.getKind() == Kind.Object ? Representation.StaticObjectFields : Representation.StaticPrimitiveFields, holder, isInitialized);
-            Kind kind = field.getKind();
-            if (container != null) {
-                LoadFieldNode load = currentGraph.add(new LoadFieldNode(container, (ResolvedJavaField) field, graphId));
-                appendOptimizedLoadField(kind, load);
-            } else {
-                // deopt will be generated by genTypeOrDeopt, not needed here
-                frameState.push(kind.getStackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
-            }
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
+            frameState.push(kind.getStackKind(), append(ConstantNode.defaultForKind(kind, currentGraph)));
         }
     }
 
     private void genPutStatic(JavaField field) {
-        JavaType holder = field.getDeclaringClass();
-        boolean isInitialized = (field instanceof ResolvedJavaField) && ((ResolvedJavaType) holder).isInitialized();
-        ValueNode container = genTypeOrDeopt(field.getKind() == Kind.Object ? Representation.StaticObjectFields : Representation.StaticPrimitiveFields, holder, isInitialized);
         ValueNode value = frameState.pop(field.getKind().getStackKind());
-        if (container != null) {
-            StoreFieldNode store = currentGraph.add(new StoreFieldNode(container, (ResolvedJavaField) field, value, graphId));
+        if (field instanceof ResolvedJavaField && ((ResolvedJavaType) field.getDeclaringClass()).isInitialized()) {
+            StoreFieldNode store = currentGraph.add(new StoreFieldNode(null, (ResolvedJavaField) field, value, graphId));
             appendOptimizedStoreField(store);
         } else {
-            // deopt will be generated by genTypeOrDeopt, not needed here
+            append(currentGraph.add(new DeoptimizeNode(DeoptimizationAction.InvalidateRecompile, DeoptimizationReason.Unresolved, graphId)));
         }
     }
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/AccessFieldNode.java	Thu Nov 29 17:43:48 2012 -0800
@@ -100,7 +100,7 @@
 
     @Override
     public boolean verify() {
-        assertTrue(object != null, "Access object can not be null");
+        assertTrue((object == null) == isStatic(), "static field must not have object, instance field must have object");
         return super.verify();
     }
 }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Thu Nov 29 22:53:21 2012 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java	Thu Nov 29 17:43:48 2012 -0800
@@ -137,7 +137,9 @@
         } else {
             if (value.getKind() == Kind.Int || value.getKind() == Kind.Long) {
                 return forInteger(value.getKind(), value.asLong(), value.asLong(), value.asLong() & IntegerStamp.defaultMask(value.getKind()));
-            } else if (value.getKind() == Kind.Float || value.getKind() == Kind.Double) {
+            } else if (value.getKind() == Kind.Float) {
+                return forFloat(value.getKind(), value.asFloat(), value.asFloat(), !Float.isNaN(value.asFloat()));
+            } else if (value.getKind() == Kind.Double) {
                 return forFloat(value.getKind(), value.asDouble(), value.asDouble(), !Double.isNaN(value.asDouble()));
             }
             return forKind(value.getKind().getStackKind());