# HG changeset patch # User Tom Rodriguez # Date 1433385197 25200 # Node ID e7f5ddef438daa82af68a355df9091f009aee8a3 # Parent 99fe8116f3e812a128b1982a0f95f93d27448dc0 Make illegal value a nested class diff -r 99fe8116f3e8 -r e7f5ddef438d graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java --- a/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java Wed Jun 03 19:35:19 2015 -0700 +++ b/graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java Wed Jun 03 19:33:17 2015 -0700 @@ -30,7 +30,12 @@ Value[] NO_VALUES = new Value[0]; - AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) { + AllocatableValue ILLEGAL = new IllegalValue(); + + public final class IllegalValue extends AllocatableValue { + private IllegalValue() { + super(LIRKind.Illegal); + } @Override public String toString() { @@ -41,9 +46,9 @@ public boolean equals(Object other) { // Due to de-serialization this object may exist multiple times. So we compare classes // instead of the individual objects. (This anonymous class has always the same meaning) - return other != null && this.getClass() == other.getClass(); + return other instanceof IllegalValue; } - }; + } LIRKind getLIRKind();