changeset 19591:54e696f67c86

constopt.DefUseTree: remove ValuePosition.
author Josef Eisl <josef.eisl@jku.at>
date Tue, 24 Feb 2015 19:45:16 +0100
parents a44de2ea5b61
children bc3cd000d9c8
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java
diffstat 2 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java	Wed Feb 25 15:16:14 2015 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/ConstantLoadOptimization.java	Tue Feb 24 19:45:16 2015 +0100
@@ -195,14 +195,13 @@
                     }
                 };
 
-                ValuePositionProcedure useProcedure = (instruction, position) -> {
-                    Value value = position.get(instruction);
+                InstructionValueConsumer useConsumer = (instruction, value, mode, flags) -> {
                     if (isVariable(value)) {
                         Variable var = (Variable) value;
                         if (!phiConstants.get(var.index)) {
                             DefUseTree tree = map.get(var);
                             if (tree != null) {
-                                tree.addUsage(block, instruction, position);
+                                tree.addUsage(block, instruction, value);
                                 Debug.log("usage of %s : %s", var, instruction);
                             }
                         }
@@ -214,8 +213,8 @@
                     // set instruction id to the index in the lir instruction list
                     inst.setId(opId++);
                     inst.visitEachOutput(loadConsumer);
-                    inst.forEachInputPos(useProcedure);
-                    inst.forEachAlivePos(useProcedure);
+                    inst.forEachInput(useConsumer);
+                    inst.forEachAlive(useConsumer);
 
                 }
             }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java	Wed Feb 25 15:16:14 2015 +0100
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/constopt/DefUseTree.java	Tue Feb 24 19:45:16 2015 +0100
@@ -66,8 +66,8 @@
         return "DefUseTree [" + instruction + "|" + block + "," + uses + "]";
     }
 
-    public void addUsage(AbstractBlockBase<?> b, LIRInstruction inst, ValuePosition position) {
-        uses.add(new UseEntry(b, inst, position.get(inst)));
+    public void addUsage(AbstractBlockBase<?> b, LIRInstruction inst, Value value) {
+        uses.add(new UseEntry(b, inst, value));
     }
 
     public int usageCount() {