changeset 23708:282873d0192c

Provide more control over the kind reported when printing Values
author Tom Rodriguez <tom.rodriguez@oracle.com>
date Tue, 21 Jun 2016 14:36:00 -0700
parents 8820e1874bf7
children 1b939a613788
files jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java
diffstat 2 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java	Tue Jun 21 14:35:45 2016 -0700
+++ b/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Value.java	Tue Jun 21 14:36:00 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/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java	Tue Jun 21 14:35:45 2016 -0700
+++ b/jvmci/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java	Tue Jun 21 14:36:00 2016 -0700
@@ -82,4 +82,12 @@
      * 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.
+     */
+    public String getKindSuffix() {
+        return toString();
+    }
 }