8160197: [JVMCI] AllocatableValue.toString overrides are missing reference information

Reviewed-by: kvn
This commit is contained in:
Tom Rodriguez 2016-06-23 10:22:36 -07:00
parent ac81dcb779
commit 9bea129ff7
2 changed files with 15 additions and 1 deletions

View File

@ -65,7 +65,7 @@ public abstract class Value {
* {@link #toString()} implementation of subclasses.
*/
protected final String getKindSuffix() {
return "|" + getPlatformKind().getTypeChar();
return "|" + valueKind.getKindSuffix();
}
public final ValueKind<?> getValueKind() {

View File

@ -60,6 +60,11 @@ public abstract class ValueKind<K extends ValueKind<K>> {
public IllegalValueKind changeType(PlatformKind newPlatformKind) {
return this;
}
@Override
public String toString() {
return "ILLEGAL";
}
}
/**
@ -82,4 +87,13 @@ public abstract class ValueKind<K extends ValueKind<K>> {
* override this to preserve the additional information added by the compiler.
*/
public abstract K changeType(PlatformKind newPlatformKind);
/**
* Returns a String representation of the kind, which will be included at the end of
* {@link Value#toString()} implementation. Defaults to {@link #toString()} but can be
* overridden to provide something more specific.
*/
public String getKindSuffix() {
return toString();
}
}