changeset 8169:0fdbde04cca3

Remove unused Address class.
author Roland Schatz <roland.schatz@oracle.com>
date Thu, 07 Mar 2013 16:33:30 +0100
parents 58b1820ff19a
children 537f03d2bdf7
files graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/AbstractAddress.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Address.java graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAddress.java graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java
diffstat 10 files changed, 15 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/AbstractAddress.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/AbstractAddress.java	Thu Mar 07 16:33:30 2013 +0100
@@ -23,7 +23,7 @@
 package com.oracle.graal.api.code;
 
 /**
- * Marker interface that represents a platform specific address.
+ * Abstract base class that represents a platform specific address.
  */
-public interface AbstractAddress {
+public abstract class AbstractAddress {
 }
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/Address.java	Thu Mar 07 16:33:27 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,44 +0,0 @@
-/*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package com.oracle.graal.api.code;
-
-import com.oracle.graal.api.meta.*;
-
-/**
- * Base class to represent an address in target machine memory. The concrete representation of the
- * address is platform dependent.
- */
-public abstract class Address extends Value implements AbstractAddress {
-
-    private static final long serialVersionUID = -1003772042519945089L;
-
-    public Address(Kind kind) {
-        super(kind);
-    }
-
-    /**
-     * The values that this address is composed of. Used by the register allocator to manipulate
-     * addresses in a platform independent way.
-     */
-    public abstract Value[] components();
-}
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/ValueUtil.java	Thu Mar 07 16:33:30 2013 +0100
@@ -78,16 +78,6 @@
         return (StackSlot) value;
     }
 
-    public static boolean isAddress(Value value) {
-        assert value != null;
-        return value instanceof Address;
-    }
-
-    public static Address asAddress(Value value) {
-        assert value != null;
-        return (Address) value;
-    }
-
     public static boolean isRegister(Value value) {
         assert value != null;
         return value instanceof RegisterValue;
--- a/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Address.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.asm.amd64/src/com/oracle/graal/asm/amd64/AMD64Address.java	Thu Mar 07 16:33:30 2013 +0100
@@ -29,7 +29,7 @@
  * register, an index register, a displacement and a scale. Note that the base and index registers
  * may be a variable that will get a register assigned later by the register allocator.
  */
-public final class AMD64Address implements AbstractAddress {
+public final class AMD64Address extends AbstractAddress {
 
     private final Register base;
     private final Register index;
--- a/graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAddress.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.asm.ptx/src/com/oracle/graal/asm/ptx/PTXAddress.java	Thu Mar 07 16:33:30 2013 +0100
@@ -29,7 +29,7 @@
  * Represents an address in target machine memory, specified via some combination of a base register
  * and a displacement.
  */
-public final class PTXAddress implements AbstractAddress {
+public final class PTXAddress extends AbstractAddress {
 
     private final Register base;
     private final long displacement;
--- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAssembler.java	Thu Mar 07 16:33:30 2013 +0100
@@ -55,13 +55,13 @@
     }
 
     @Override
-    public Address makeAddress(Kind kind, Value base, int displacement) {
+    public AbstractAddress makeAddress(Kind kind, Value base, int displacement) {
         // SPARC: Implement address calculation.
         return null;
     }
 
     @Override
-    public Address getPlaceholder() {
+    public AbstractAddress getPlaceholder() {
         // SPARC: Implement address patching.
         return null;
     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/Interval.java	Thu Mar 07 16:33:30 2013 +0100
@@ -417,8 +417,8 @@
     public final int operandNumber;
 
     /**
-     * The {@linkplain RegisterValue register}, {@linkplain StackSlot spill slot} or
-     * {@linkplain Address address} assigned to this interval.
+     * The {@linkplain RegisterValue register} or {@linkplain StackSlot spill slot} assigned to this
+     * interval.
      */
     private Value location;
 
@@ -515,8 +515,8 @@
     }
 
     /**
-     * Gets the {@linkplain RegisterValue register}, {@linkplain StackSlot spill slot} or
-     * {@linkplain Address address} assigned to this interval.
+     * Gets the {@linkplain RegisterValue register} or {@linkplain StackSlot spill slot} assigned to
+     * this interval.
      */
     public Value location() {
         return location;
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRInstruction.java	Thu Mar 07 16:33:30 2013 +0100
@@ -166,11 +166,6 @@
         STACK,
 
         /**
-         * The value can be a {@link Address}.
-         */
-        ADDR,
-
-        /**
          * The value can be a {@link CompositeValue}.
          */
         COMPOSITE,
@@ -210,8 +205,8 @@
 
     static {
         ALLOWED_FLAGS = new EnumMap<>(OperandMode.class);
-        ALLOWED_FLAGS.put(USE, EnumSet.of(REG, STACK, ADDR, COMPOSITE, CONST, ILLEGAL, HINT, UNUSED, UNINITIALIZED));
-        ALLOWED_FLAGS.put(ALIVE, EnumSet.of(REG, STACK, ADDR, COMPOSITE, CONST, ILLEGAL, HINT, UNUSED, UNINITIALIZED));
+        ALLOWED_FLAGS.put(USE, EnumSet.of(REG, STACK, COMPOSITE, CONST, ILLEGAL, HINT, UNUSED, UNINITIALIZED));
+        ALLOWED_FLAGS.put(ALIVE, EnumSet.of(REG, STACK, COMPOSITE, CONST, ILLEGAL, HINT, UNUSED, UNINITIALIZED));
         ALLOWED_FLAGS.put(TEMP, EnumSet.of(REG, COMPOSITE, CONST, ILLEGAL, UNUSED, HINT));
         ALLOWED_FLAGS.put(DEF, EnumSet.of(REG, STACK, COMPOSITE, ILLEGAL, UNUSED, HINT));
     }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/LIRIntrospection.java	Thu Mar 07 16:33:30 2013 +0100
@@ -22,14 +22,11 @@
  */
 package com.oracle.graal.lir;
 
-import static com.oracle.graal.api.code.ValueUtil.*;
-
 import java.lang.annotation.*;
 import java.lang.reflect.*;
 import java.util.*;
 import java.util.Map.Entry;
 
-import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.lir.LIRInstruction.OperandFlag;
@@ -108,8 +105,6 @@
                 if (value instanceof CompositeValue) {
                     CompositeValue composite = (CompositeValue) value;
                     composite.forEachComponent(mode, proc);
-                } else if (isAddress(value)) {
-                    doAddress(asAddress(value), mode, flags[i], proc);
                 } else {
                     setValue(obj, offsets[i], proc.doValue(value, mode, flags[i]));
                 }
@@ -120,8 +115,6 @@
                     if (value instanceof CompositeValue) {
                         CompositeValue composite = (CompositeValue) value;
                         composite.forEachComponent(mode, proc);
-                    } else if (isAddress(value)) {
-                        doAddress(asAddress(value), mode, flags[i], proc);
                     } else {
                         values[j] = proc.doValue(value, mode, flags[i]);
                     }
@@ -130,14 +123,6 @@
         }
     }
 
-    private static void doAddress(Address address, OperandMode mode, EnumSet<OperandFlag> flags, ValueProcedure proc) {
-        assert flags.contains(OperandFlag.ADDR);
-        Value[] components = address.components();
-        for (int i = 0; i < components.length; i++) {
-            components[i] = proc.doValue(components[i], mode, LIRInstruction.ADDRESS_FLAGS);
-        }
-    }
-
     protected static Value getValue(Object obj, long offset) {
         return (Value) unsafe.getObject(obj, offset);
     }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Thu Mar 07 16:33:27 2013 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/asm/TargetMethodAssembler.java	Thu Mar 07 16:33:30 2013 +0100
@@ -231,10 +231,8 @@
     }
 
     public AbstractAddress asAddress(Value value) {
-        if (isStackSlot(value)) {
-            StackSlot slot = (StackSlot) value;
-            return asm.makeAddress(slot.getKind(), frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot));
-        }
-        return (Address) value;
+        assert isStackSlot(value);
+        StackSlot slot = asStackSlot(value);
+        return asm.makeAddress(slot.getKind(), frameMap.registerConfig.getFrameRegister().asValue(), frameMap.offsetForStackSlot(slot));
     }
 }