changeset 16802:d7edefd16aca

Use InstructionValueConsumer in RegisterVerifier.
author Josef Eisl <josef.eisl@jku.at>
date Tue, 12 Aug 2014 17:55:39 +0200
parents 067dbd8e7114
children faed55e4d849
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/RegisterVerifier.java
diffstat 1 files changed, 8 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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<LIRInstruction> ops, final Interval[] inputState) {
-        InstructionValueProcedure useProc = new InstructionValueProcedure() {
+        InstructionValueConsumer useConsumer = new InstructionValueConsumer() {
 
             @Override
-            public Value doValue(LIRInstruction op, Value operand, OperandMode mode, EnumSet<OperandFlag> flags) {
+            public void visitValue(LIRInstruction op, Value operand, OperandMode mode, EnumSet<OperandFlag> 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<OperandFlag> flags) {
+            public void visitValue(LIRInstruction op, Value operand, OperandMode mode, EnumSet<OperandFlag> 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);
         }
     }
 }