changeset 39449:792094902fc8

8160197: [JVMCI] AllocatableValue.toString overrides are missing reference information Reviewed-by: kvn
author never
date Thu, 23 Jun 2016 10:22:36 -0700
parents 7ba3b2a8e48e
children 78e99b030d5f 3eb9922d1a5b
files hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java hotspot/src/jdk.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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();
+    }
 }