Mercurial > hg > truffle
comparison graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyUsageWithEquals.java @ 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 | ef6915cf1e59 |
children | 23ccaa863eda |
comparison
equal
deleted
inserted
replaced
11802:82c4106741f7 | 11803:eb2def6529bc |
---|---|
71 protected boolean verify(StructuredGraph graph, PhaseContext context) { | 71 protected boolean verify(StructuredGraph graph, PhaseContext context) { |
72 for (ObjectEqualsNode cn : graph.getNodes().filter(ObjectEqualsNode.class)) { | 72 for (ObjectEqualsNode cn : graph.getNodes().filter(ObjectEqualsNode.class)) { |
73 if (!isEqualsMethod(graph)) { | 73 if (!isEqualsMethod(graph)) { |
74 // bail out if we compare an object of type klass with == or != (except null checks) | 74 // bail out if we compare an object of type klass with == or != (except null checks) |
75 assert !(checkUsage(cn.x(), cn.y(), context.getRuntime()) && checkUsage(cn.y(), cn.x(), context.getRuntime())) : "Verifcation of " + klass.getName() + " usage failed: Comparing " + | 75 assert !(checkUsage(cn.x(), cn.y(), context.getRuntime()) && checkUsage(cn.y(), cn.x(), context.getRuntime())) : "Verifcation of " + klass.getName() + " usage failed: Comparing " + |
76 cn.x() + " and" + cn.y() + " in " + graph.method() + " must use .equals() for object equality, not '==' or '!='"; | 76 cn.x() + " and " + cn.y() + " in " + graph.method() + " must use .equals() for object equality, not '==' or '!='"; |
77 } | 77 } |
78 } | 78 } |
79 return true; | 79 return true; |
80 } | 80 } |
81 } | 81 } |