changeset 17282:0578dc1c1a62

Remove ValueProcedure.doValue(Value value).
author Josef Eisl <josef.eisl@jku.at>
date Thu, 25 Sep 2014 14:35:24 +0200
parents 0f299d663944
children e8b80721524d
files graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java
diffstat 3 files changed, 9 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java	Thu Sep 25 14:32:47 2014 +0200
+++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java	Thu Sep 25 14:35:24 2014 +0200
@@ -38,6 +38,8 @@
 import com.oracle.graal.debug.*;
 import com.oracle.graal.debug.Debug.Scope;
 import com.oracle.graal.lir.*;
+import com.oracle.graal.lir.LIRInstruction.OperandFlag;
+import com.oracle.graal.lir.LIRInstruction.OperandMode;
 import com.oracle.graal.lir.StandardOp.MoveOp;
 import com.oracle.graal.lir.gen.*;
 import com.oracle.graal.nodes.*;
@@ -82,7 +84,7 @@
         private ValueProcedure collectStatsProc = new ValueProcedure() {
 
             @Override
-            public Value doValue(Value value) {
+            public Value doValue(Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 if (ValueUtil.isRegister(value)) {
                     final Register reg = ValueUtil.asRegister(value);
                     registers.add(reg);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Sep 25 14:32:47 2014 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Sep 25 14:35:24 2014 +0200
@@ -926,7 +926,7 @@
                                             ins.forEachState(new ValueProcedure() {
 
                                                 @Override
-                                                public Value doValue(Value liveStateOperand) {
+                                                public Value doValue(Value liveStateOperand, OperandMode mode, EnumSet<OperandFlag> flags) {
                                                     Debug.log("operand=%s", liveStateOperand);
                                                     return liveStateOperand;
                                                 }
@@ -1127,7 +1127,7 @@
             op.forEachRegisterHint(targetValue, mode, new ValueProcedure() {
 
                 @Override
-                public Value doValue(Value registerHint) {
+                public Value doValue(Value registerHint, OperandMode valueMode, EnumSet<OperandFlag> valueFlags) {
                     if (isVariableOrRegister(registerHint)) {
                         Interval from = getOrCreateInterval((AllocatableValue) registerHint);
                         Interval to = getOrCreateInterval((AllocatableValue) targetValue);
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java	Thu Sep 25 14:32:47 2014 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java	Thu Sep 25 14:35:24 2014 +0200
@@ -25,8 +25,8 @@
 import java.util.*;
 
 import com.oracle.graal.api.meta.*;
-import com.oracle.graal.compiler.common.*;
-import com.oracle.graal.lir.LIRInstruction.*;
+import com.oracle.graal.lir.LIRInstruction.OperandFlag;
+import com.oracle.graal.lir.LIRInstruction.OperandMode;
 
 /**
  * Similar to {@link InstructionValueProcedure} but without an {@link LIRInstruction} parameter.
@@ -34,28 +34,14 @@
 public abstract class ValueProcedure extends InstructionValueProcedure {
 
     /**
-     * Iterator method to be overwritten. This version of the iterator does not take additional
-     * parameters to keep the signature short.
-     *
-     * @param value The value that is iterated.
-     * @return The new value to replace the value that was passed in.
-     */
-    public Value doValue(Value value) {
-        throw GraalInternalError.shouldNotReachHere("One of the doValue() methods must be overwritten");
-    }
-
-    /**
-     * Iterator method to be overwritten. This version of the iterator gets additional parameters
-     * about the processed value.
+     * Iterator method to be overwritten.
      *
      * @param value The value that is iterated.
      * @param mode The operand mode for the value.
      * @param flags A set of flags for the value.
      * @return The new value to replace the value that was passed in.
      */
-    public Value doValue(Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        return doValue(value);
-    }
+    public abstract Value doValue(Value value, OperandMode mode, EnumSet<OperandFlag> flags);
 
     @Override
     public final Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {