# HG changeset patch # User Josef Eisl # Date 1407858939 -7200 # Node ID d7edefd16acadb260b419db8b8de53fd82d3662a # Parent 067dbd8e7114bfc8d2ec89e19261c9f07dc3a109 Use InstructionValueConsumer in RegisterVerifier. diff -r 067dbd8e7114 -r d7edefd16aca graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java Wed Aug 13 10:10:38 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java Tue Aug 12 17:55:39 2014 +0200 @@ -186,10 +186,10 @@ } void processOperations(List ops, final Interval[] inputState) { - InstructionValueProcedure useProc = new InstructionValueProcedure() { + InstructionValueConsumer useConsumer = new InstructionValueConsumer() { @Override - public Value doValue(LIRInstruction op, Value operand, OperandMode mode, EnumSet flags) { + public void visitValue(LIRInstruction op, Value operand, OperandMode mode, EnumSet flags) { // we skip spill moves inserted by the spill position optimization if (LinearScan.isVariableOrRegister(operand) && allocator.isProcessed(operand) && op.id() != LinearScan.DOMINATOR_SPILL_MOVE_ID) { Interval interval = intervalAt(operand); @@ -199,14 +199,13 @@ assert checkState(inputState, interval.location(), interval.splitParent()); } - return operand; } }; - InstructionValueProcedure defProc = new InstructionValueProcedure() { + InstructionValueConsumer defConsumer = new InstructionValueConsumer() { @Override - public Value doValue(LIRInstruction op, Value operand, OperandMode mode, EnumSet flags) { + public void visitValue(LIRInstruction op, Value operand, OperandMode mode, EnumSet flags) { if (LinearScan.isVariableOrRegister(operand) && allocator.isProcessed(operand)) { Interval interval = intervalAt(operand); if (op.id() != -1) { @@ -215,7 +214,6 @@ statePut(inputState, interval.location(), interval.splitParent()); } - return operand; } }; @@ -228,19 +226,19 @@ } // check if input operands are correct - op.forEachInput(useProc); + op.visitEachInput(useConsumer); // invalidate all caller save registers at calls if (op.destroysCallerSavedRegisters()) { for (Register r : allocator.frameMap.registerConfig.getCallerSaveRegisters()) { statePut(inputState, r.asValue(), null); } } - op.forEachAlive(useProc); + op.visitEachAlive(useConsumer); // set temp operands (some operations use temp operands also as output operands, so // can't set them null) - op.forEachTemp(defProc); + op.visitEachTemp(defConsumer); // set output operands - op.forEachOutput(defProc); + op.visitEachOutput(defConsumer); } } }