# HG changeset patch # User Josef Eisl # Date 1411648367 -7200 # Node ID 0f299d6639440c23df967d9a03efdb84713e9488 # Parent 0acefec7231ad1807a2b758e1cc7db70c3f81323 Remove InstructionValueProcedure.doValue(LIRInstruction, Value). diff -r 0acefec7231a -r 0f299d663944 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java --- 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 flags) { int tempOpId = op.id(); OperandMode mode = OperandMode.USE; AbstractBlock block = blockForId(tempOpId); diff -r 0acefec7231a -r 0f299d663944 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest1.java --- 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 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 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 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 flags) { assertEquals(dummyValue1, value); return dummyValue3; } diff -r 0acefec7231a -r 0f299d663944 graal/com.oracle.graal.lir.test/src/com/oracle/graal/lir/test/CompositeValueReplacementTest2.java --- 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 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 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 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 flags) { assertEquals(dummyValue1, value); return dummyValue3; } diff -r 0acefec7231a -r 0f299d663944 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/InstructionValueProcedure.java --- 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 flags) { - return doValue(instruction, value); - } + public abstract Value doValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet flags); @Override public final Value processValue(LIRInstruction instruction, Value value, OperandMode mode, EnumSet flags) { diff -r 0acefec7231a -r 0f299d663944 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/ValueProcedure.java --- 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 flags) { return doValue(value, mode, flags); }