# HG changeset patch # User Roland Schatz # Date 1362645810 -3600 # Node ID 569b7d482918dda3acf0869083aaf1dc0c4cc04d # Parent d413770c6dd089fa196d5e2766581f783209813e Use MoveOp marker interface in AllocatorTest. diff -r d413770c6dd0 -r 569b7d482918 graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java --- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java Thu Mar 07 09:43:25 2013 +0100 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/backend/AllocatorTest.java Thu Mar 07 09:43:30 2013 +0100 @@ -34,6 +34,7 @@ import com.oracle.graal.debug.*; import com.oracle.graal.lir.*; import com.oracle.graal.lir.LIRInstruction.ValueProcedure; +import com.oracle.graal.lir.StandardOp.MoveOp; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.cfg.*; import com.oracle.graal.phases.*; @@ -108,32 +109,30 @@ } private void collectStats(final LIRInstruction instr) { - final boolean move = instr.name().equals("MOVE"); instr.forEachOutput(new ValueProcedure() { @Override - public Value doValue(Value defValue) { - if (ValueUtil.isRegister(defValue)) { - final Register reg = ValueUtil.asRegister(defValue); + public Value doValue(Value value) { + if (ValueUtil.isRegister(value)) { + final Register reg = ValueUtil.asRegister(value); registers.add(reg); - if (move) { - instr.forEachInput(new ValueProcedure() { - - @Override - public Value doValue(Value useValue) { - if (ValueUtil.isRegister(useValue) && ValueUtil.asRegister(useValue) != reg) { - regRegMoves++; - } - return useValue; - } - }); - } - } else if (move && ValueUtil.isStackSlot(defValue)) { - spillMoves++; } - return defValue; + return value; } }); + + if (instr instanceof MoveOp) { + MoveOp move = (MoveOp) instr; + Value def = move.getResult(); + Value use = move.getInput(); + if (ValueUtil.isRegister(def)) { + if (ValueUtil.isRegister(use) && ValueUtil.asRegister(def) != ValueUtil.asRegister(use)) { + regRegMoves++; + } + } else if (ValueUtil.isStackSlot(def)) { + spillMoves++; + } + } } }