changeset 17292:4c31d6e44c18

LSRA: replace anonymous ValueProcedures with Lambdas.
author Josef Eisl <josef.eisl@jku.at>
date Mon, 29 Sep 2014 14:30:16 +0200
parents 182062f9739d
children 6855e4c325d0
files graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java
diffstat 1 files changed, 16 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- 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<OperandFlag> 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<OperandFlag> 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<OperandFlag> 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;
             });
         }
     }