changeset 9665:8f2f4c9e2dcf

VerifyValueUsage: use method name and signature instead of `toString()'
author Bernhard Urban <bernhard.urban@jku.at>
date Mon, 13 May 2013 16:47:13 +0200
parents 843dde5a83af
children a886c764ea59
files graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyValueUsage.java
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyValueUsage.java	Mon May 13 16:37:57 2013 +0200
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/verify/VerifyValueUsage.java	Mon May 13 16:47:13 2013 +0200
@@ -51,7 +51,8 @@
     @Override
     protected boolean verify(StructuredGraph graph) {
         for (ObjectEqualsNode cn : graph.getNodes().filter(ObjectEqualsNode.class)) {
-            if (!graph.method().toString().endsWith("equals(Object)>")) {
+            Signature signature = graph.method().getSignature();
+            if (!(graph.method().getName().equals("equals") && signature.getParameterCount(false) == 1 && signature.getParameterKind(0).equals(Kind.Object))) {
                 assert !((checkType(cn.x()) && !(cn.y() instanceof ConstantNode)) || (checkType(cn.y()) && !(cn.x() instanceof ConstantNode))) : "VerifyValueUsage: " + cn.x() + " or " + cn.y() +
                                 " in " + graph.method() + " uses object identity. Should use equals() instead.";
             }