Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.jvmci.meta/src/com/oracle/jvmci/meta/Value.java @ 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 | 27943aac2e3c |
comparison
equal
deleted
inserted
replaced
21728:99fe8116f3e8 | 21729:e7f5ddef438d |
---|---|
28 */ | 28 */ |
29 public interface Value extends KindProvider, TrustedInterface { | 29 public interface Value extends KindProvider, TrustedInterface { |
30 | 30 |
31 Value[] NO_VALUES = new Value[0]; | 31 Value[] NO_VALUES = new Value[0]; |
32 | 32 |
33 AllocatableValue ILLEGAL = new AllocatableValue(LIRKind.Illegal) { | 33 AllocatableValue ILLEGAL = new IllegalValue(); |
34 | |
35 public final class IllegalValue extends AllocatableValue { | |
36 private IllegalValue() { | |
37 super(LIRKind.Illegal); | |
38 } | |
34 | 39 |
35 @Override | 40 @Override |
36 public String toString() { | 41 public String toString() { |
37 return "-"; | 42 return "-"; |
38 } | 43 } |
39 | 44 |
40 @Override | 45 @Override |
41 public boolean equals(Object other) { | 46 public boolean equals(Object other) { |
42 // Due to de-serialization this object may exist multiple times. So we compare classes | 47 // Due to de-serialization this object may exist multiple times. So we compare classes |
43 // instead of the individual objects. (This anonymous class has always the same meaning) | 48 // instead of the individual objects. (This anonymous class has always the same meaning) |
44 return other != null && this.getClass() == other.getClass(); | 49 return other instanceof IllegalValue; |
45 } | 50 } |
46 }; | 51 } |
47 | 52 |
48 LIRKind getLIRKind(); | 53 LIRKind getLIRKind(); |
49 | 54 |
50 /** | 55 /** |
51 * Returns the platform specific kind used to store this value. | 56 * Returns the platform specific kind used to store this value. |