# HG changeset patch # User Josef Eisl # Date 1411993816 -7200 # Node ID 4c31d6e44c18e93e743e965956c9315282827cad # Parent 182062f9739d990dc59c5d07f11c8d20576d32bf LSRA: replace anonymous ValueProcedures with Lambdas. diff -r 182062f9739d -r 4c31d6e44c18 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 Mon Sep 29 13:56:34 2014 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java Mon Sep 29 14:30:16 2014 +0200 @@ -923,13 +923,9 @@ try (Indent indent3 = Debug.logAndIndent("used in block B%d", block.getId())) { for (LIRInstruction ins : ir.getLIRforBlock(block)) { try (Indent indent4 = Debug.logAndIndent("%d: %s", ins.id(), ins)) { - ins.forEachState(new ValueProcedure() { - - @Override - public Value doValue(Value liveStateOperand, OperandMode mode, EnumSet flags) { - Debug.log("operand=%s", liveStateOperand); - return liveStateOperand; - } + ins.forEachState((liveStateOperand, mode, flags) -> { + Debug.log("operand=%s", liveStateOperand); + return liveStateOperand; }); } } @@ -1124,26 +1120,22 @@ void addRegisterHint(final LIRInstruction op, final Value targetValue, OperandMode mode, EnumSet flags, final boolean hintAtDef) { if (flags.contains(OperandFlag.HINT) && isVariableOrRegister(targetValue)) { - op.forEachRegisterHint(targetValue, mode, new ValueProcedure() { - - @Override - public Value doValue(Value registerHint, OperandMode valueMode, EnumSet valueFlags) { - if (isVariableOrRegister(registerHint)) { - Interval from = getOrCreateInterval((AllocatableValue) registerHint); - Interval to = getOrCreateInterval((AllocatableValue) targetValue); + op.forEachRegisterHint(targetValue, mode, (registerHint, valueMode, valueFlags) -> { + if (isVariableOrRegister(registerHint)) { + Interval from = getOrCreateInterval((AllocatableValue) registerHint); + Interval to = getOrCreateInterval((AllocatableValue) targetValue); - // hints always point from def to use - if (hintAtDef) { - to.setLocationHint(from); - } else { - from.setLocationHint(to); - } - Debug.log("operation at opId %d: added hint from interval %d to %d", op.id(), from.operandNumber, to.operandNumber); + /* hints always point from def to use */ + if (hintAtDef) { + to.setLocationHint(from); + } else { + from.setLocationHint(to); + } + Debug.log("operation at opId %d: added hint from interval %d to %d", op.id(), from.operandNumber, to.operandNumber); - return registerHint; - } - return null; + return registerHint; } + return null; }); } }