changeset 17281:0f299d663944

Remove InstructionValueProcedure.doValue(LIRInstruction, Value).
author Josef Eisl <josef.eisl@jku.at>
date Thu, 25 Sep 2014 14:32:47 +0200
parents 0acefec7231a
children 0578dc1c1a62
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest2.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueProcedure.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java
diffstat 5 files changed, 19 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Sep 25 14:02:35 2014 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Thu Sep 25 14:32:47 2014 +0200
@@ -1740,7 +1740,7 @@
     private InstructionValueProcedure debugInfoProc = new InstructionValueProcedure() {
 
         @Override
-        public Value doValue(LIRInstruction op, Value operand) {
+        public Value doValue(LIRInstruction op, Value operand, OperandMode valueMode, EnumSet<OperandFlag> flags) {
             int tempOpId = op.id();
             OperandMode mode = OperandMode.USE;
             AbstractBlock<?> block = blockForId(tempOpId);
--- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java	Thu Sep 25 14:02:35 2014 +0200
+++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java	Thu Sep 25 14:32:47 2014 +0200
@@ -25,11 +25,14 @@
 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
 import static org.junit.Assert.*;
 
+import java.util.*;
+
 import org.junit.*;
 
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.LIRInstruction.OperandFlag;
+import com.oracle.graal.lir.LIRInstruction.OperandMode;
 import com.oracle.graal.lir.asm.*;
 
 /**
@@ -128,7 +131,7 @@
 
         op1.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue2;
             }
@@ -136,7 +139,7 @@
 
         op2.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue3;
             }
@@ -168,7 +171,7 @@
 
         op1.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue2;
             }
@@ -176,7 +179,7 @@
 
         op2.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue3;
             }
--- a/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest2.java	Thu Sep 25 14:02:35 2014 +0200
+++ b/graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest2.java	Thu Sep 25 14:32:47 2014 +0200
@@ -25,11 +25,14 @@
 import static com.oracle.graal.lir.LIRInstruction.OperandFlag.*;
 import static org.junit.Assert.*;
 
+import java.util.*;
+
 import org.junit.*;
 
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.lir.*;
 import com.oracle.graal.lir.LIRInstruction.OperandFlag;
+import com.oracle.graal.lir.LIRInstruction.OperandMode;
 import com.oracle.graal.lir.asm.*;
 
 /**
@@ -129,7 +132,7 @@
 
         op1.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue2;
             }
@@ -137,7 +140,7 @@
 
         op2.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue3;
             }
@@ -169,7 +172,7 @@
 
         op1.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue2;
             }
@@ -177,7 +180,7 @@
 
         op2.forEachInput(new InstructionValueProcedure() {
             @Override
-            public Value doValue(LIRInstruction instruction, Value value) {
+            public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
                 assertEquals(dummyValue1, value);
                 return dummyValue3;
             }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueProcedure.java	Thu Sep 25 14:02:35 2014 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueProcedure.java	Thu Sep 25 14:32:47 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;
 
 /**
  * Iterator for iterating over a list of values. Subclasses must overwrite one of the doValue
@@ -36,20 +36,7 @@
 public abstract class InstructionValueProcedure extends InstructionValueProcedureBase {
 
     /**
-     * Iterator method to be overwritten. This version of the iterator does not take additional
-     * parameters to keep the signature short.
-     *
-     * @param instruction The current instruction.
-     * @param value The value that is iterated.
-     * @return The new value to replace the value that was passed in.
-     */
-    public Value doValue(LIRInstruction instruction, 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 instruction The current instruction.
      * @param value The value that is iterated.
@@ -57,9 +44,7 @@
      * @param flags A set of flags for the value.
      * @return The new value to replace the value that was passed in.
      */
-    public Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
-        return doValue(instruction, value);
-    }
+    public abstract Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags);
 
     @Override
     public final Value processValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java	Thu Sep 25 14:02:35 2014 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java	Thu Sep 25 14:32:47 2014 +0200
@@ -58,11 +58,6 @@
     }
 
     @Override
-    public final Value doValue(LIRInstruction instruction, Value value) {
-        throw GraalInternalError.shouldNotReachHere("This doValue() method should never be called");
-    }
-
-    @Override
     public final Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet<OperandFlag> flags) {
         return doValue(value, mode, flags);
     }