Mercurial > hg > truffle
changeset 21729:e7f5ddef438d
Make illegal value a nested class
author | Tom Rodriguez <tom.rodriguez@oracle.com> |
---|---|
date | Wed, 03 Jun 2015 19:33:17 -0700 |
parents | 99fe8116f3e8 |
children | b9f9b8af17ff |
files | graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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();