changeset 16115:9a595d3f9a2f

Handle narrow oops in redundant move elimination.
author Roland Schatz <roland.schatz@oracle.com>
date Tue, 17 Jun 2014 09:43:23 +0200
parents a0d1dfc113b8
children 9e5a323e0a1e
files graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java	Mon Jun 16 19:38:05 2014 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/RedundantMoveElimination.java	Tue Jun 17 09:43:23 2014 +0200
@@ -340,7 +340,7 @@
                 int sourceIdx = getStateIdx(moveOp.getInput());
                 int destIdx = getStateIdx(moveOp.getResult());
                 if (sourceIdx >= 0 && destIdx >= 0) {
-                    assert isObjectValue(state[sourceIdx]) || (moveOp.getInput().getKind() != Kind.Object) : "move op moves object but input is not defined as object";
+                    assert isObjectValue(state[sourceIdx]) || moveOp.getInput().getLIRKind().isValue() : "move op moves object but input is not defined as object";
                     state[destIdx] = state[sourceIdx];
                     Debug.log("move value %d from %d to %d", state[sourceIdx], sourceIdx, destIdx);
                     return initValueNum;
@@ -378,7 +378,7 @@
                         /*
                          * Assign a unique number to the output or temp location.
                          */
-                        state[stateIdx] = encodeValueNum(opValueNum++, operand.getKind() == Kind.Object);
+                        state[stateIdx] = encodeValueNum(opValueNum++, !operand.getLIRKind().isValue());
                         Debug.log("set def %d for register %s(%d): %d", opValueNum, operand, stateIdx, state[stateIdx]);
                     }
                     return operand;
@@ -510,7 +510,7 @@
             /*
              * Moves with mismatching kinds are not moves, but memory loads/stores!
              */
-            return source.getKind() == dest.getKind() && source.getLIRKind() == dest.getLIRKind() && source.getKind() != Kind.Illegal;
+            return source.getLIRKind().equals(dest.getLIRKind());
         }
         return false;
     }