# HG changeset patch # User Bernhard Urban # Date 1389606175 -3600 # Node ID 14db6fb488a0eb38c33445998fdd261027334cb7 # Parent e4678d4988466e0c283d613a5608393b14556cf5 UnsafeAllocTest: fix stamp problem diff -r e4678d498846 -r 14db6fb488a0 graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/UnsafeAllocateInstance01.java --- a/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/UnsafeAllocateInstance01.java Mon Jan 13 09:10:54 2014 +0100 +++ b/graal/com.oracle.graal.jtt/src/com/oracle/graal/jtt/jdk/UnsafeAllocateInstance01.java Mon Jan 13 10:42:55 2014 +0100 @@ -74,7 +74,6 @@ } @Test - @Ignore("abstract type isn't allowed by ObjectStamp") public void run2() throws Throwable { runTest("testClassForException", AbstractList.class); } diff -r e4678d498846 -r 14db6fb488a0 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java Mon Jan 13 09:10:54 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/ObjectStamp.java Mon Jan 13 10:42:55 2014 +0100 @@ -37,7 +37,7 @@ public ObjectStamp(ResolvedJavaType type, boolean exactType, boolean nonNull, boolean alwaysNull) { super(Kind.Object); - assert !exactType || (type != null && (!Modifier.isAbstract(type.getModifiers()) || type.isArray())); + assert !exactType || (type != null && (isConcreteType(type))); this.type = type; this.exactType = exactType; this.nonNull = nonNull; @@ -198,7 +198,7 @@ } if (joinAlwaysNull && joinNonNull) { return StampFactory.illegal(Kind.Object); - } else if (joinExactType && Modifier.isAbstract(joinType.getModifiers()) && !joinType.isArray()) { + } else if (joinExactType && !isConcreteType(joinType)) { return StampFactory.illegal(Kind.Object); } if (joinType == type && joinExactType == exactType && joinNonNull == nonNull && joinAlwaysNull == alwaysNull) { @@ -210,6 +210,10 @@ } } + public static boolean isConcreteType(ResolvedJavaType type) { + return !(Modifier.isAbstract(type.getModifiers()) && !type.isArray()); + } + private static ResolvedJavaType meetTypes(ResolvedJavaType a, ResolvedJavaType b) { if (a == b) { return a; diff -r e4678d498846 -r 14db6fb488a0 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java Mon Jan 13 09:10:54 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/type/StampFactory.java Mon Jan 13 10:42:55 2014 +0100 @@ -218,7 +218,11 @@ } public static Stamp exactNonNull(ResolvedJavaType type) { - return new ObjectStamp(type, true, true, false); + if (ObjectStamp.isConcreteType(type)) { + return new ObjectStamp(type, true, true, false); + } else { + return illegal(Kind.Object); + } } public static Stamp exact(ResolvedJavaType type) {