diff graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiAddress.java @ 4206:430b5db3e6f8

Remove CiVariable from the CRI
author Christian Wimmer <Christian.Wimmer@Oracle.com>
date Tue, 03 Jan 2012 12:10:27 -0800
parents aaac4894175c
children 9ce8594bedaf
line wrap: on
line diff
--- a/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiAddress.java	Tue Jan 03 18:22:10 2012 +0100
+++ b/graal/com.oracle.max.cri/src/com/oracle/max/cri/ci/CiAddress.java	Tue Jan 03 12:10:27 2012 -0800
@@ -107,9 +107,6 @@
             this.index = IllegalValue;
             this.scale = Scale.Times1;
         } else {
-            assert isIllegal(base) || isVariable(base) || isRegister(base);
-            assert isIllegal(index) || isVariable(index) || isRegister(index);
-
             this.index = index;
             this.scale = scale;
             this.displacement = displacement;
@@ -192,14 +189,6 @@
         }
     }
 
-    private static String s(CiValue location) {
-        if (isRegister(location)) {
-            return asRegister(location).name;
-        }
-        assert isVariable(location);
-        return "v" + ((CiVariable) location).index;
-    }
-
     private static String signed(int i) {
         if (i >= 0) {
             return "+" + i;
@@ -211,10 +200,10 @@
     public String toString() {
         // Checkstyle: stop
         switch (format()) {
-            case BASE            : return "[" + s(base) + kindSuffix() + "]";
-            case BASE_DISP       : return "[" + s(base) + signed(displacement) + kindSuffix() + "]";
-            case BASE_INDEX      : return "[" + s(base) + "+" + s(index) + kindSuffix() + "]";
-            case BASE_INDEX_DISP : return "[" + s(base) + "+(" + s(index) + "*" + scale.value + ")" + signed(displacement) + kindSuffix() + "]";
+            case BASE            : return "[" + base + kindSuffix() + "]";
+            case BASE_DISP       : return "[" + base + signed(displacement) + kindSuffix() + "]";
+            case BASE_INDEX      : return "[" + base + "+" + index + kindSuffix() + "]";
+            case BASE_INDEX_DISP : return "[" + base + "+(" + index + "*" + scale.value + ")" + signed(displacement) + kindSuffix() + "]";
             case PLACEHOLDER     : return "[<placeholder>]";
             default              : throw new IllegalArgumentException("unknown format: " + format());
         }