Mercurial > hg > graal-compiler
changeset 11803:eb2def6529bc
HSAIL, SPARC: fix some occurrences of object identity, using equals() instead
author | Bernhard Urban <bernhard.urban@jku.at> |
---|---|
date | Wed, 25 Sep 2013 17:07:33 +0200 |
parents | 82c4106741f7 |
children | 60f6d5939941 |
files | graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILAddressValue.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java |
diffstat | 4 files changed, 6 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java Wed Sep 25 16:55:03 2013 +0200 +++ b/graal/com.oracle.graal.asm.sparc/src/com/oracle/graal/asm/sparc/SPARCAddress.java Wed Sep 25 17:07:33 2013 +0200 @@ -121,7 +121,7 @@ throw GraalInternalError.shouldNotReachHere("address has index register"); } // TODO Should we also hide the register save area size here? - if (getBase() == sp || getBase() == fp) { + if (getBase().equals(sp) || getBase().equals(fp)) { return displacement + STACK_BIAS; } return displacement;
--- a/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java Wed Sep 25 16:55:03 2013 +0200 +++ b/graal/com.oracle.graal.compiler.hsail/src/com/oracle/graal/compiler/hsail/HSAILLIRGenerator.java Wed Sep 25 17:07:33 2013 +0200 @@ -143,12 +143,12 @@ } else { baseRegister = load(base); } - } else if (base == Value.ILLEGAL) { + } else if (base.equals(Value.ILLEGAL)) { baseRegister = Value.ILLEGAL; } else { baseRegister = asAllocatable(base); } - if (index != Value.ILLEGAL) { + if (!index.equals(Value.ILLEGAL)) { if (isConstant(index)) { finalDisp += asConstant(index).asLong() * scale; } else { @@ -160,7 +160,7 @@ } else { indexRegister = convertedIndex; } - if (baseRegister == Value.ILLEGAL) { + if (baseRegister.equals(Value.ILLEGAL)) { baseRegister = asAllocatable(indexRegister); } else { baseRegister = emitAdd(baseRegister, indexRegister);
--- a/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILAddressValue.java Wed Sep 25 16:55:03 2013 +0200 +++ b/graal/com.oracle.graal.lir.hsail/src/com/oracle/graal/lir/hsail/HSAILAddressValue.java Wed Sep 25 17:07:33 2013 +0200 @@ -66,7 +66,7 @@ } public HSAILAddress toAddress() { - Register baseReg = base == Value.ILLEGAL ? Register.None : asRegister(base); + Register baseReg = base.equals(Value.ILLEGAL) ? Register.None : asRegister(base); return new HSAILAddress(baseReg, displacement); }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java Wed Sep 25 16:55:03 2013 +0200 +++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java Wed Sep 25 17:07:33 2013 +0200 @@ -73,7 +73,7 @@ if (!isEqualsMethod(graph)) { // bail out if we compare an object of type klass with == or != (except null checks) assert !(checkUsage(cn.x(), cn.y(), context.getRuntime()) && checkUsage(cn.y(), cn.x(), context.getRuntime())) : "Verifcation of " + klass.getName() + " usage failed: Comparing " + - cn.x() + " and" + cn.y() + " in " + graph.method() + " must use .equals() for object equality, not '==' or '!='"; + cn.x() + " and " + cn.y() + " in " + graph.method() + " must use .equals() for object equality, not '==' or '!='"; } } return true;