Mercurial > hg > truffle
diff graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java @ 7037:dd81042f4eb1
added unit tests for ResolvedJavaType
replaced some CompilerToVM methods used by HotSpotResolvedJavaType with pure Java code
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 27 Nov 2012 11:21:48 +0100 |
parents | 7bf5a6c42db7 |
children | 6644cecbd3a7 |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Tue Nov 27 11:18:34 2012 +0100 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/ConditionalEliminationPhase.java Tue Nov 27 11:21:48 2012 +0100 @@ -240,9 +240,9 @@ return a; } else if (a == b) { return a; - } else if (a.isSubtypeOf(b)) { + } else if (a.isAssignableTo(b)) { return a; - } else if (b.isSubtypeOf(a)) { + } else if (b.isAssignableTo(a)) { return b; } else { return a; @@ -326,7 +326,7 @@ } else if (node instanceof CheckCastNode) { CheckCastNode checkCast = (CheckCastNode) node; ResolvedJavaType type = state.getNodeType(checkCast.object()); - if (type != null && type.isSubtypeOf(checkCast.type())) { + if (type != null && type.isAssignableTo(checkCast.type())) { PiNode piNode; boolean nonNull = state.knownNotNull.contains(checkCast.object()); piNode = graph.unique(new PiNode(checkCast.object(), lastBegin, nonNull ? StampFactory.declaredNonNull(type) : StampFactory.declared(type))); @@ -351,7 +351,7 @@ replaceWith = ConstantNode.forBoolean(false, graph); } else if (state.knownNotNull.contains(object)) { ResolvedJavaType type = state.getNodeType(object); - if (type != null && type.isSubtypeOf(instanceOf.type())) { + if (type != null && type.isAssignableTo(instanceOf.type())) { replaceWith = ConstantNode.forBoolean(true, graph); } }