# HG changeset patch # User Bernhard Urban # Date 1368182649 -7200 # Node ID 97db51025787544e865026720553f95bc57da5dc # Parent 3c9aeef2702c69e876180f65b6f95905d4588ea7 Value: use `equals()' instead of object equality 8841fab and this changeset fixes a regression introduced by 688219 (removed cached RegisterValues) diff -r 3c9aeef2702c -r 97db51025787 graal/com.oracle.graal.compiler.amd64.test/src/com/oracle/graal/compiler/amd64/test/AMD64AllocatorTest.java --- 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); diff -r 3c9aeef2702c -r 97db51025787 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 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); } diff -r 3c9aeef2702c -r 97db51025787 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/LinearScanWalker.java --- 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; } diff -r 3c9aeef2702c -r 97db51025787 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/alloc/MoveResolver.java --- 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; } } diff -r 3c9aeef2702c -r 97db51025787 graal/com.oracle.graal.lir/src/com/oracle/graal/lir/EdgeMoveOptimizer.java --- 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; }