# HG changeset patch # User Thomas Wuerthinger # Date 1423193584 -3600 # Node ID 76090119f89c671d8ef070bc8d00696d5f0e86f7 # Parent 5adc03d22312770918431e8e47630795be5ced9a Do only constant folding when creating a new array length node in the parser. diff -r 5adc03d22312 -r 76090119f89c graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java Fri Feb 06 03:25:19 2015 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java Fri Feb 06 04:33:04 2015 +0100 @@ -52,7 +52,7 @@ } public static ValueNode create(ValueNode forValue, ConstantReflectionProvider constantReflection) { - ValueNode length = readArrayLength(forValue, constantReflection); + ValueNode length = readArrayLengthConstant(forValue, constantReflection); if (length != null) { return length; } @@ -101,6 +101,10 @@ // Ensure that any proxies on the original value end up on the length value return reproxyValue(originalArray, length); } + return readArrayLengthConstant(originalArray, constantReflection); + } + + private static ValueNode readArrayLengthConstant(ValueNode originalArray, ConstantReflectionProvider constantReflection) { ValueNode array = GraphUtil.unproxify(originalArray); if (constantReflection != null && array.isConstant() && !array.isNullConstant()) { JavaConstant constantValue = array.asJavaConstant();