# HG changeset patch # User Andreas Woess # Date 1390998980 -3600 # Node ID 5318db77ec76282f700cd3f8122adfe0a53e0505 # Parent 0636944acb67d5f6a7e3089bf70a5f5e28fe18c5 GraphBuilderPhase: remove unused constant added by createExceptionDispatch diff -r 0636944acb67 -r 5318db77ec76 graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java --- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Jan 29 13:10:02 2014 +0100 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Wed Jan 29 13:36:20 2014 +0100 @@ -1067,15 +1067,6 @@ } } - private ConstantNode genTypeOrDeopt(Representation representation, JavaType type, boolean initialized) { - if (initialized) { - return appendConstant(((ResolvedJavaType) type).getEncoding(representation)); - } else { - handleUnresolvedExceptionType(representation, type); - return null; - } - } - private void appendOptimizedStoreField(StoreFieldNode store) { append(store); } @@ -1721,8 +1712,7 @@ } } - ConstantNode typeInstruction = genTypeOrDeopt(Representation.ObjectHub, catchType, initialized); - if (typeInstruction != null) { + if (initialized) { Block nextBlock = block.successors.size() == 1 ? unwindBlock(block.deoptBci) : block.successors.get(1); ValueNode exception = frameState.stackAt(0); CheckCastNode checkCast = currentGraph.add(new CheckCastNode((ResolvedJavaType) catchType, exception, null, false)); @@ -1734,6 +1724,8 @@ FixedNode nextDispatch = createTarget(nextBlock, frameState); checkCast.setNext(catchSuccessor); append(new IfNode(currentGraph.unique(new InstanceOfNode((ResolvedJavaType) catchType, exception, null)), checkCast, nextDispatch, 0.5)); + } else { + handleUnresolvedExceptionType(Representation.ObjectHub, catchType); } }