changeset 9632:97db51025787

Value: use `equals()' instead of object equality 8841fab and this changeset fixes a regression introduced by 688219 (removed cached RegisterValues)
author Bernhard Urban <bernhard.urban@jku.at>
date Fri, 10 May 2013 12:44:09 +0200
parents 3c9aeef2702c
children 5207bb46598e
files graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java
diffstat 5 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java	Fri May 10 12:43:43 2013 +0200
+++ b/graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java	Fri May 10 12:44:09 2013 +0200
@@ -28,7 +28,6 @@
 
 public class AMD64AllocatorTest extends AllocatorTest {
 
-    @Ignore
     @Test
     public void test1() {
         test("test1snippet", 3, 1, 0);
@@ -38,7 +37,6 @@
         return x + 5;
     }
 
-    @Ignore
     @Test
     public void test2() {
         test("test2snippet", 3, 0, 0);
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Fri May 10 12:43:43 2013 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScan.java	Fri May 10 12:44:09 2013 +0200
@@ -1481,7 +1481,7 @@
             Interval fromInterval = intervalAtBlockEnd(fromBlock, liveOperand);
             Interval toInterval = intervalAtBlockBegin(toBlock, liveOperand);
 
-            if (fromInterval != toInterval && (fromInterval.location() != toInterval.location())) {
+            if (fromInterval != toInterval && !fromInterval.location().equals(toInterval.location())) {
                 // need to insert move instruction
                 moveResolver.addMapping(fromInterval, toInterval);
             }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Fri May 10 12:43:43 2013 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java	Fri May 10 12:44:09 2013 +0200
@@ -816,7 +816,9 @@
     static boolean isMove(LIRInstruction op, Interval from, Interval to) {
         if (op instanceof MoveOp) {
             MoveOp move = (MoveOp) op;
-            return isVariable(move.getInput()) && isVariable(move.getResult()) && move.getInput() == from.operand && move.getResult() == to.operand;
+            if (isVariable(move.getInput()) && isVariable(move.getResult())) {
+                return move.getInput() != null && move.getInput().equals(from.operand) && move.getResult() != null && move.getResult().equals(to.operand);
+            }
         }
         return false;
     }
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java	Fri May 10 12:43:43 2013 +0200
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java	Fri May 10 12:44:09 2013 +0200
@@ -169,7 +169,7 @@
 
         Value reg = to.location();
         if (isRegister(reg)) {
-            if (registerBlocked(asRegister(reg).number) > 1 || (registerBlocked(asRegister(reg).number) == 1 && reg != fromReg)) {
+            if (registerBlocked(asRegister(reg).number) > 1 || (registerBlocked(asRegister(reg).number) == 1 && !reg.equals(fromReg))) {
                 return false;
             }
         }
--- a/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java	Fri May 10 12:43:43 2013 +0200
+++ b/graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java	Fri May 10 12:44:09 2013 +0200
@@ -91,7 +91,7 @@
         if (op1 instanceof MoveOp && op2 instanceof MoveOp) {
             MoveOp move1 = (MoveOp) op1;
             MoveOp move2 = (MoveOp) op2;
-            if (move1.getInput() == move2.getInput() && move1.getResult() == move2.getResult()) {
+            if (move1.getInput().equals(move2.getInput()) && move1.getResult().equals(move2.getResult())) {
                 // these moves are exactly equal and can be optimized
                 return true;
             }