8160197: [JVMCI] AllocatableValue.toString overrides are missing reference information
Reviewed-by: kvn
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java Thu Jun 23 15:41:33 2016 +0000
+++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java Thu Jun 23 10:22:36 2016 -0700
@@ -65,7 +65,7 @@
* {@link #toString()} implementation of subclasses.
*/
protected final String getKindSuffix() {
- return "|" + getPlatformKind().getTypeChar();
+ return "|" + valueKind.getKindSuffix();
}
public final ValueKind<?> getValueKind() {
--- a/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java Thu Jun 23 15:41:33 2016 +0000
+++ b/hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java Thu Jun 23 10:22:36 2016 -0700
@@ -60,6 +60,11 @@
public IllegalValueKind changeType(PlatformKind newPlatformKind) {
return this;
}
+
+ @Override
+ public String toString() {
+ return "ILLEGAL";
+ }
}
/**
@@ -82,4 +87,13 @@
* 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();
+ }
}