changeset 20926:35e1b66f2810

Rename Stamp.illegal() to Stamp.empty().
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 14 Apr 2015 14:40:36 +0200
parents cea0b7285190
children 5ad8a163b843 f41cd2c2916d
files graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampMeetTest.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/InferStamps.java
diffstat 16 files changed, 85 insertions(+), 85 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/AbstractObjectStamp.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -48,7 +48,7 @@
     }
 
     @Override
-    public Stamp illegal() {
+    public Stamp empty() {
         return copyWith(null, true, true, false);
     }
 
@@ -60,7 +60,7 @@
     }
 
     @Override
-    public boolean isLegal() {
+    public boolean hasValues() {
         return !exactType || (type != null && (isConcreteType(type)));
     }
 
@@ -86,8 +86,8 @@
     }
 
     protected void appendString(StringBuilder str) {
-        if (this.isIllegal()) {
-            str.append(" illegal");
+        if (this.isEmpty()) {
+            str.append(" empty");
         } else {
             str.append(nonNull() ? "!" : "").append(exactType ? "#" : "").append(' ').append(type == null ? "-" : type.getName()).append(alwaysNull() ? " NULL" : "");
         }
@@ -99,9 +99,9 @@
             return this;
         }
         AbstractObjectStamp other = (AbstractObjectStamp) otherStamp;
-        if (isIllegal()) {
+        if (isEmpty()) {
             return other;
-        } else if (other.isIllegal()) {
+        } else if (other.isEmpty()) {
             return this;
         }
         ResolvedJavaType meetType;
@@ -168,9 +168,9 @@
             return this;
         }
         AbstractObjectStamp other = (AbstractObjectStamp) otherStamp;
-        if (isIllegal()) {
+        if (isEmpty()) {
             return this;
-        } else if (other.isIllegal()) {
+        } else if (other.isEmpty()) {
             return other;
         }
 
@@ -215,12 +215,12 @@
             joinExactType = false;
         }
         if (joinExactType && joinType == null) {
-            return StampFactory.illegal(Kind.Object);
+            return StampFactory.empty(Kind.Object);
         }
         if (joinAlwaysNull && joinNonNull) {
-            return StampFactory.illegal(Kind.Object);
+            return StampFactory.empty(Kind.Object);
         } else if (joinExactType && !isConcreteType(joinType)) {
-            return StampFactory.illegal(Kind.Object);
+            return StampFactory.empty(Kind.Object);
         }
         if (Objects.equals(joinType, type) && joinExactType == exactType && joinNonNull == nonNull() && joinAlwaysNull == alwaysNull()) {
             return this;
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/FloatStamp.java	Tue Apr 14 14:40:36 2015 +0200
@@ -59,7 +59,7 @@
     }
 
     @Override
-    public Stamp illegal() {
+    public Stamp empty() {
         return new FloatStamp(getBits(), Double.POSITIVE_INFINITY, Double.NEGATIVE_INFINITY, true);
     }
 
@@ -83,7 +83,7 @@
     }
 
     @Override
-    public boolean isLegal() {
+    public boolean hasValues() {
         return lowerBound <= upperBound || !nonNaN;
     }
 
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IllegalStamp.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -52,7 +52,7 @@
     }
 
     @Override
-    public Stamp illegal() {
+    public Stamp empty() {
         return this;
     }
 
@@ -90,8 +90,8 @@
     }
 
     @Override
-    public boolean isLegal() {
-        return false;
+    public boolean hasValues() {
+        return true;
     }
 
     @Override
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/IntegerStamp.java	Tue Apr 14 14:40:36 2015 +0200
@@ -86,7 +86,7 @@
     }
 
     @Override
-    public Stamp illegal() {
+    public Stamp empty() {
         return new IntegerStamp(getBits(), CodeUtil.maxValue(getBits()), CodeUtil.minValue(getBits()), CodeUtil.mask(getBits()), 0);
     }
 
@@ -118,7 +118,7 @@
     }
 
     @Override
-    public boolean isLegal() {
+    public boolean hasValues() {
         return lowerBound <= upperBound;
     }
 
@@ -238,7 +238,7 @@
     private Stamp createStamp(IntegerStamp other, long newUpperBound, long newLowerBound, long newDownMask, long newUpMask) {
         assert getBits() == other.getBits();
         if (newLowerBound > newUpperBound || (newDownMask & (~newUpMask)) != 0 || (newUpMask == 0 && (newLowerBound > 0 || newUpperBound < 0))) {
-            return illegal();
+            return empty();
         } else if (newLowerBound == lowerBound && newUpperBound == upperBound && newDownMask == downMask && newUpMask == upMask) {
             return this;
         } else if (newLowerBound == other.lowerBound && newUpperBound == other.upperBound && newDownMask == other.downMask && newUpMask == other.upMask) {
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/Stamp.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -40,7 +40,7 @@
     public abstract ResolvedJavaType javaType(MetaAccessProvider metaAccess);
 
     public boolean alwaysDistinct(Stamp other) {
-        return join(other).isIllegal();
+        return join(other).isEmpty();
     }
 
     /**
@@ -82,9 +82,9 @@
     /**
      * Returns a stamp of the same kind, but with no allowed values.
      *
-     * {@link #illegal()} is the neutral element of the {@link #meet(Stamp)} operation.
+     * {@link #empty()} is the neutral element of the {@link #meet(Stamp)} operation.
      */
-    public abstract Stamp illegal();
+    public abstract Stamp empty();
 
     /**
      * If it is possible to represent single value stamps of this kind, this method returns the
@@ -103,13 +103,13 @@
     /**
      * Test whether this stamp has legal values.
      */
-    public abstract boolean isLegal();
+    public abstract boolean hasValues();
 
     /**
      * Tests whether this stamp represents an illegal value.
      */
-    public final boolean isIllegal() {
-        return !isLegal();
+    public final boolean isEmpty() {
+        return !hasValues();
     }
 
     /**
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/StampFactory.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2011, 2015, 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
@@ -31,7 +31,7 @@
     // JaCoCo Exclude
 
     private static final Stamp[] stampCache = new Stamp[Kind.values().length];
-    private static final Stamp[] illegalStampCache = new Stamp[Kind.values().length];
+    private static final Stamp[] emptyStampCache = new Stamp[Kind.values().length];
     private static final Stamp objectStamp = new ObjectStamp(null, false, false, false);
     private static final Stamp objectNonNullStamp = new ObjectStamp(null, false, true, false);
     private static final Stamp objectAlwaysNullStamp = new ObjectStamp(null, false, false, true);
@@ -72,13 +72,13 @@
 
         setCache(Kind.Object, objectStamp);
         setCache(Kind.Void, VoidStamp.getInstance());
+        setCache(Kind.Illegal, IllegalStamp.getInstance());
 
         for (Kind k : Kind.values()) {
             if (stampCache[k.ordinal()] != null) {
-                illegalStampCache[k.ordinal()] = stampCache[k.ordinal()].illegal();
+                emptyStampCache[k.ordinal()] = stampCache[k.ordinal()].empty();
             }
         }
-        illegalStampCache[Kind.Illegal.ordinal()] = IllegalStamp.getInstance();
     }
 
     public static Stamp tautology() {
@@ -121,8 +121,8 @@
         return positiveInt;
     }
 
-    public static Stamp illegal(Kind kind) {
-        return illegalStampCache[kind.ordinal()];
+    public static Stamp empty(Kind kind) {
+        return emptyStampCache[kind.ordinal()];
     }
 
     public static IntegerStamp forInteger(Kind kind, long lowerBound, long upperBound, long downMask, long upMask) {
@@ -188,7 +188,7 @@
             case Double:
                 return forFloat(kind, value.asDouble(), value.asDouble(), !Double.isNaN(value.asDouble()));
             case Illegal:
-                return illegal(Kind.Illegal);
+                return forKind(Kind.Illegal);
             case Object:
                 if (value.isNull()) {
                     return alwaysNull();
@@ -271,7 +271,7 @@
         if (ObjectStamp.isConcreteType(type)) {
             return new ObjectStamp(type, true, false, false);
         } else {
-            return illegal(Kind.Object);
+            return empty(Kind.Object);
         }
     }
 
@@ -282,7 +282,7 @@
         if (ObjectStamp.isConcreteType(type)) {
             return new ObjectStamp(type, true, true, false);
         } else {
-            return illegal(Kind.Object);
+            return empty(Kind.Object);
         }
     }
 
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/VoidStamp.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -88,14 +88,14 @@
     }
 
     @Override
-    public Stamp illegal() {
-        // there is no illegal void stamp
+    public Stamp empty() {
+        // the void stamp is always empty
         return this;
     }
 
     @Override
-    public boolean isLegal() {
-        return true;
+    public boolean hasValues() {
+        return false;
     }
 
     @Override
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/gen/NodeLIRBuilder.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, 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
@@ -304,8 +304,8 @@
     }
 
     protected void emitNode(ValueNode node) {
-        if (Debug.isLogEnabled() && node.stamp().isIllegal()) {
-            Debug.log("This node has invalid type, we are emitting dead code(?): %s", node);
+        if (Debug.isLogEnabled() && node.stamp().isEmpty()) {
+            Debug.log("This node has an empty stamp, we are emitting dead code(?): %s", node);
         }
         if (node instanceof LIRLowerable) {
             ((LIRLowerable) node).generate(this);
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/type/MetaspacePointerStamp.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2014, 2015, 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
@@ -61,13 +61,13 @@
     }
 
     @Override
-    public Stamp illegal() {
-        // there is no illegal pointer stamp
+    public Stamp empty() {
+        // there is no empty pointer stamp
         return this;
     }
 
     @Override
-    public boolean isLegal() {
+    public boolean hasValues() {
         return true;
     }
 
--- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/IntegerStampTest.java	Tue Apr 14 14:40:36 2015 +0200
@@ -306,8 +306,8 @@
 
     @Test
     public void testIllegalJoin() {
-        assertFalse(new IntegerStamp(32, 0, 0xff00, 0, 0xff00).join(new IntegerStamp(32, 1, 0xff, 0x00, 0xff)).isLegal());
-        assertFalse(new IntegerStamp(32, 0x100, 0xff00, 0, 0xff00).join(new IntegerStamp(32, 0, 0xff, 0x00, 0xff)).isLegal());
+        assertFalse(new IntegerStamp(32, 0, 0xff00, 0, 0xff00).join(new IntegerStamp(32, 1, 0xff, 0x00, 0xff)).hasValues());
+        assertFalse(new IntegerStamp(32, 0x100, 0xff00, 0, 0xff00).join(new IntegerStamp(32, 0, 0xff, 0x00, 0xff)).hasValues());
     }
 
     @Test
--- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampJoinTest.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -56,7 +56,7 @@
     public void testJoin2() {
         Stamp aExact = StampFactory.exactNonNull(getType(A.class));
         Stamp b = StampFactory.declared(getType(B.class));
-        Assert.assertEquals(StampFactory.illegal(Kind.Object), join(aExact, b));
+        Assert.assertEquals(StampFactory.empty(Kind.Object), join(aExact, b));
     }
 
     @Test
@@ -70,7 +70,7 @@
     public void testJoin4() {
         Stamp dExactNonNull = StampFactory.exactNonNull(getType(D.class));
         Stamp c = StampFactory.declared(getType(C.class));
-        Assert.assertEquals(StampFactory.illegal(Kind.Object), join(c, dExactNonNull));
+        Assert.assertEquals(StampFactory.empty(Kind.Object), join(c, dExactNonNull));
     }
 
     @Test
@@ -88,7 +88,7 @@
         Stamp dExactNonNull = StampFactory.exactNonNull(getType(D.class));
         Stamp alwaysNull = StampFactory.alwaysNull();
         Stamp join = join(alwaysNull, dExactNonNull);
-        Assert.assertFalse(join.isLegal());
+        Assert.assertFalse(join.hasValues());
         Assert.assertFalse(StampTool.isPointerNonNull(join));
         Assert.assertFalse(StampTool.isPointerAlwaysNull(join));
     }
@@ -108,7 +108,7 @@
         Stamp bExact = StampFactory.exactNonNull(getType(B.class));
         Stamp dExact = StampFactory.exact(getType(D.class));
         Stamp join = join(bExact, dExact);
-        Assert.assertFalse(join.isLegal());
+        Assert.assertFalse(join.hasValues());
     }
 
     @Test
@@ -125,7 +125,7 @@
     public void testJoinInterface0() {
         Stamp a = StampFactory.declared(getType(A.class));
         Stamp i = StampFactory.declaredTrusted(getType(I.class));
-        Assert.assertNotSame(StampFactory.illegal(Kind.Object), join(a, i));
+        Assert.assertNotSame(StampFactory.empty(Kind.Object), join(a, i));
     }
 
     @Test
@@ -142,7 +142,7 @@
         Stamp bExact = StampFactory.exactNonNull(getType(B.class));
         Stamp i = StampFactory.declaredTrusted(getType(I.class));
         Stamp join = join(i, bExact);
-        Assert.assertEquals(StampFactory.illegal(Kind.Object), join);
+        Assert.assertEquals(StampFactory.empty(Kind.Object), join);
     }
 
     @Test
--- a/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampMeetTest.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.nodes.test/src/com/oracle/graal/nodes/test/ObjectStampMeetTest.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -114,7 +114,7 @@
             ResolvedJavaType type = getType(clazz);
             for (Stamp test : new Stamp[]{StampFactory.declared(type), StampFactory.declaredNonNull(type), StampFactory.exact(type), StampFactory.exactNonNull(type)}) {
                 if (type.isConcrete() || !((ObjectStamp) test).isExactType()) {
-                    Assert.assertEquals("meeting illegal and " + test, test, meet(StampFactory.illegal(Kind.Object), test));
+                    Assert.assertEquals("meeting empty and " + test, test, meet(StampFactory.empty(Kind.Object), test));
                 }
             }
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardingPiNode.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -107,7 +107,7 @@
 
     @Override
     public Node canonical(CanonicalizerTool tool) {
-        if (stamp().isIllegal()) {
+        if (stamp().isEmpty()) {
             // The guard always fails
             return new DeoptimizeNode(action, reason);
         }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/CheckCastNode.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, 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
@@ -116,7 +116,7 @@
         Stamp newStamp = StampFactory.declaredTrusted(type).improveWith(object().stamp());
         ValueNode condition;
         ValueNode theValue = object;
-        if (newStamp.isIllegal()) {
+        if (newStamp.isEmpty()) {
             // This is a check cast that will always fail
             condition = LogicConstantNode.contradiction(graph());
             newStamp = StampFactory.declaredTrusted(type);
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampTool.java	Tue Apr 14 14:40:36 2015 +0200
@@ -84,8 +84,8 @@
     }
 
     /**
-     * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#isLegal() legal} pointer
-     * value which is known to be always null.
+     * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#hasValues() legal}
+     * pointer value which is known to be always null.
      *
      * @param node the node to check
      * @return true if this node represents a legal object value which is known to be always null
@@ -95,7 +95,7 @@
     }
 
     /**
-     * Checks whether this {@link Stamp} represents a {@linkplain Stamp#isLegal() legal} pointer
+     * Checks whether this {@link Stamp} represents a {@linkplain Stamp#hasValues() legal} pointer
      * stamp whose values are known to be always null.
      *
      * @param stamp the stamp to check
@@ -103,15 +103,15 @@
      *         always null
      */
     public static boolean isPointerAlwaysNull(Stamp stamp) {
-        if (stamp instanceof AbstractPointerStamp && stamp.isLegal()) {
+        if (stamp instanceof AbstractPointerStamp && stamp.hasValues()) {
             return ((AbstractPointerStamp) stamp).alwaysNull();
         }
         return false;
     }
 
     /**
-     * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#isLegal() legal} pointer
-     * value which is known to never be null.
+     * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#hasValues() legal}
+     * pointer value which is known to never be null.
      *
      * @param node the node to check
      * @return true if this node represents a legal object value which is known to never be null
@@ -121,7 +121,7 @@
     }
 
     /**
-     * Checks whether this {@link Stamp} represents a {@linkplain Stamp#isLegal() legal} pointer
+     * Checks whether this {@link Stamp} represents a {@linkplain Stamp#hasValues() legal} pointer
      * stamp whose values are known to never be null.
      *
      * @param stamp the stamp to check
@@ -129,7 +129,7 @@
      *         always null
      */
     public static boolean isPointerNonNull(Stamp stamp) {
-        if (stamp instanceof AbstractPointerStamp && stamp.isLegal()) {
+        if (stamp instanceof AbstractPointerStamp && stamp.hasValues()) {
             return ((AbstractPointerStamp) stamp).nonNull();
         }
         return false;
@@ -137,7 +137,7 @@
 
     /**
      * Returns the {@linkplain ResolvedJavaType Java type} this {@linkplain ValueNode} has if it is
-     * a {@linkplain Stamp#isLegal() legal} Object value.
+     * a {@linkplain Stamp#hasValues() legal} Object value.
      *
      * @param node the node to check
      * @return the Java type this value has if it is a legal Object type, null otherwise
@@ -148,21 +148,21 @@
 
     /**
      * Returns the {@linkplain ResolvedJavaType Java type} this {@linkplain Stamp} has if it is a
-     * {@linkplain Stamp#isLegal() legal} Object stamp.
+     * {@linkplain Stamp#hasValues() legal} Object stamp.
      *
      * @param stamp the stamp to check
      * @return the Java type this stamp has if it is a legal Object stamp, null otherwise
      */
     public static ResolvedJavaType typeOrNull(Stamp stamp) {
-        if (stamp instanceof AbstractObjectStamp && stamp.isLegal()) {
+        if (stamp instanceof AbstractObjectStamp && stamp.hasValues()) {
             return ((AbstractObjectStamp) stamp).type();
         }
         return null;
     }
 
     /**
-     * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#isLegal() legal} Object
-     * value whose Java type is known exactly. If this method returns true then the
+     * Checks whether this {@link ValueNode} represents a {@linkplain Stamp#hasValues() legal}
+     * Object value whose Java type is known exactly. If this method returns true then the
      * {@linkplain ResolvedJavaType Java type} returned by {@link #typeOrNull(ValueNode)} is the
      * concrete dynamic/runtime Java type of this value.
      *
@@ -174,7 +174,7 @@
     }
 
     /**
-     * Checks whether this {@link Stamp} represents a {@linkplain Stamp#isLegal() legal} Object
+     * Checks whether this {@link Stamp} represents a {@linkplain Stamp#hasValues() legal} Object
      * stamp whose {@linkplain ResolvedJavaType Java type} is known exactly. If this method returns
      * true then the Java type returned by {@link #typeOrNull(Stamp)} is the only concrete
      * dynamic/runtime Java type possible for values of this stamp.
@@ -183,7 +183,7 @@
      * @return true if this node represents a legal object stamp whose Java type is known exactly
      */
     public static boolean isExactType(Stamp stamp) {
-        if (stamp instanceof AbstractObjectStamp && stamp.isLegal()) {
+        if (stamp instanceof AbstractObjectStamp && stamp.hasValues()) {
             return ((AbstractObjectStamp) stamp).isExactType();
         }
         return false;
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/InferStamps.java	Tue Apr 14 12:08:41 2015 +0200
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/InferStamps.java	Tue Apr 14 14:40:36 2015 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -49,8 +49,8 @@
             if (n instanceof ValuePhiNode) {
                 ValueNode node = (ValueNode) n;
                 if (node.stamp() instanceof ObjectStamp) {
-                    assert node.stamp().isLegal() : "We assume all Phi and Proxy stamps are legal before the analysis";
-                    node.setStamp(node.stamp().illegal());
+                    assert node.stamp().hasValues() : "We assume all Phi and Proxy stamps are legal before the analysis";
+                    node.setStamp(node.stamp().empty());
                 }
             }
         }
@@ -81,14 +81,14 @@
          * Check that all the illegal stamps we introduced above are correctly replaced with real
          * stamps again.
          */
-        assert checkNoIllegalStamp(graph);
+        assert checkNoEmptyStamp(graph);
     }
 
-    private static boolean checkNoIllegalStamp(StructuredGraph graph) {
+    private static boolean checkNoEmptyStamp(StructuredGraph graph) {
         for (Node n : graph.getNodes()) {
             if (n instanceof ValuePhiNode) {
                 ValueNode node = (ValueNode) n;
-                assert node.stamp().isLegal() : "Stamp is illegal after analysis. This is not necessarily an error, but a condition that we want to investigate (and then maybe relax or remove the assertion).";
+                assert node.stamp().hasValues() : "Stamp is empty after analysis. This is not necessarily an error, but a condition that we want to investigate (and then maybe relax or remove the assertion).";
             }
         }
         return true;