Mercurial > hg > truffle
changeset 19172:76090119f89c
Do only constant folding when creating a new array length node in the parser.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Fri, 06 Feb 2015 04:33:04 +0100 |
parents | 5adc03d22312 |
children | 396ca3a22ee8 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/ArrayLengthNode.java |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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();