# HG changeset patch # User Lukas Stadler # Date 1368716005 -7200 # Node ID e4d8c9b0578397ccb3fbccd239f6893ce701f238 # Parent b5dd7e3c8c80b5b88369dc2274c42d1321045f73 use only appendConstant for appending constants in GraphBuilderPhase diff -r b5dd7e3c8c80 -r e4d8c9b05783 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 Thu May 16 15:16:25 2013 +0200 +++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java Thu May 16 16:53:25 2013 +0200 @@ -306,7 +306,7 @@ */ protected void handleUnresolvedLoadConstant(JavaType type) { append(currentGraph.add(new DeoptimizeNode(InvalidateRecompile, Unresolved))); - frameState.push(Kind.Object, append(ConstantNode.forObject(null, runtime, currentGraph))); + frameState.push(Kind.Object, appendConstant(Constant.NULL_OBJECT)); } /** @@ -364,7 +364,7 @@ protected void handleUnresolvedLoadField(JavaField field, ValueNode receiver) { Kind kind = field.getKind(); append(currentGraph.add(new DeoptimizeNode(InvalidateRecompile, Unresolved))); - frameState.push(kind.getStackKind(), append(ConstantNode.defaultForKind(kind, currentGraph))); + frameState.push(kind.getStackKind(), appendConstant(Constant.defaultForKind(kind))); } /** @@ -390,7 +390,7 @@ frameState.popArguments(javaMethod.getSignature().getParameterSlots(withReceiver), javaMethod.getSignature().getParameterCount(withReceiver)); Kind kind = javaMethod.getSignature().getReturnKind(); if (kind != Kind.Void) { - frameState.push(kind.getStackKind(), append(ConstantNode.defaultForKind(kind, currentGraph))); + frameState.push(kind.getStackKind(), appendConstant(Constant.defaultForKind(kind))); } } @@ -433,7 +433,7 @@ // this is a load of class constant which might be unresolved JavaType type = (JavaType) con; if (type instanceof ResolvedJavaType) { - frameState.push(Kind.Object, append(ConstantNode.forConstant(((ResolvedJavaType) type).getEncoding(Representation.JavaClass), runtime, currentGraph))); + frameState.push(Kind.Object, appendConstant(((ResolvedJavaType) type).getEncoding(Representation.JavaClass))); } else { handleUnresolvedLoadConstant(type); } @@ -675,7 +675,7 @@ int index = stream().readLocalIndex(); int delta = stream().readIncrement(); ValueNode x = frameState.loadLocal(index); - ValueNode y = append(ConstantNode.forInt(delta, currentGraph)); + ValueNode y = appendConstant(Constant.forInt(delta)); frameState.storeLocal(index, append(currentGraph.unique(new IntegerAddNode(Kind.Int, x, y)))); } @@ -1350,6 +1350,7 @@ } private static ValueNode append(ValueNode v) { + assert !(v instanceof ConstantNode); return v; } @@ -1525,7 +1526,7 @@ private ValueNode synchronizedObject(FrameStateBuilder state, ResolvedJavaMethod target) { if (isStatic(target.getModifiers())) { - return append(ConstantNode.forConstant(target.getDeclaringClass().getEncoding(Representation.JavaClass), runtime, currentGraph)); + return appendConstant(target.getDeclaringClass().getEncoding(Representation.JavaClass)); } else { return state.loadLocal(0); }