# HG changeset patch # User Josef Eisl # Date 1412343519 -7200 # Node ID 7ef8091e35420f67e9f35b0b09502f244985287b # Parent e354b82355fcd9e6061db58a9704aca51324461d ValuePosition: regenerate hashCode(), equals(), toString(). diff -r e354b82355fc -r 7ef8091e3542 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValuePosition.java --- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValuePosition.java Mon Oct 06 18:14:12 2014 +0200 +++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValuePosition.java Fri Oct 03 15:38:39 2014 +0200 @@ -136,10 +136,11 @@ @Override public String toString() { - if (outerPosition == ROOT_VALUE_POSITION) { - return values.getMode() + "(" + index + (subIndex < 0 ? "" : "/" + subIndex) + ")"; + String str = "(" + index + (subIndex < 0 ? "" : "/" + subIndex) + ")"; + if (isCompositePosition()) { + return outerPosition.toString() + "[" + str + "]"; } - return outerPosition.toString() + "[" + values.getMode() + "(" + index + (subIndex < 0 ? "" : "/" + subIndex) + ")]"; + return str; } @Override @@ -147,9 +148,9 @@ final int prime = 31; int result = 1; result = prime * result + index; - result = prime * result + ((values.getMode() == null) ? 0 : values.getMode().hashCode()); result = prime * result + subIndex; result = prime * result + ((outerPosition == null) ? 0 : outerPosition.hashCode()); + result = prime * result + ((values == null) ? 0 : values.hashCode()); return result; } @@ -168,9 +169,6 @@ if (index != other.index) { return false; } - if (values.getMode() != other.values.getMode()) { - return false; - } if (subIndex != other.subIndex) { return false; } @@ -181,6 +179,13 @@ } else if (!outerPosition.equals(other.outerPosition)) { return false; } + if (values == null) { + if (other.values != null) { + return false; + } + } else if (!values.equals(other.values)) { + return false; + } return true; }