# HG changeset patch # User Doug Simon # Date 1427995399 -7200 # Node ID a927a3ccfd0d4bec4dd23d5bf7fb66747956930e # Parent 80fda5775d0c6f94ddd00b86fa489cfa31d53b32 fix canonicalization of ObjectEqualsNode to TypeCheckNode after fixing TypeCheckNode canonicalization diff -r 80fda5775d0c -r a927a3ccfd0d graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Thu Apr 02 19:21:59 2015 +0200 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/calc/ObjectEqualsNode.java Thu Apr 02 19:23:19 2015 +0200 @@ -22,7 +22,6 @@ */ package com.oracle.graal.nodes.calc; -import com.oracle.graal.api.meta.Assumptions.AssumptionResult; import com.oracle.graal.api.meta.*; import com.oracle.graal.compiler.common.*; import com.oracle.graal.compiler.common.calc.*; @@ -63,21 +62,10 @@ protected ValueNode canonicalizeSymmetricConstant(CanonicalizerTool tool, Constant constant, ValueNode nonConstant, boolean mirrored) { ResolvedJavaType type = tool.getConstantReflection().asJavaType(constant); if (type != null && nonConstant instanceof GetClassNode) { - if (type.isPrimitive()) { - return LogicConstantNode.forBoolean(false); + if (!type.isPrimitive() && (type.isConcrete() || type.isArray())) { + return TypeCheckNode.create(type, ((GetClassNode) nonConstant).getObject()); } - ResolvedJavaType exactType = type.asExactType(); - if (exactType == null) { - AssumptionResult leafConcreteSubtype = type.findLeafConcreteSubtype(); - if (leafConcreteSubtype != null) { - graph().getAssumptions().record(leafConcreteSubtype); - exactType = leafConcreteSubtype.getResult(); - } - } - - if (type.equals(exactType)) { - return TypeCheckNode.create(exactType, ((GetClassNode) nonConstant).getObject()); - } + return LogicConstantNode.forBoolean(false); } return super.canonicalizeSymmetricConstant(tool, constant, nonConstant, mirrored); } @@ -119,7 +107,7 @@ /* * One of the two objects has identity, the other doesn't. In code, this looks like * "Integer.valueOf(a) == new Integer(b)", which is always false. - * + * * In other words: an object created via valueOf can never be equal to one created * by new in the same compilation unit. */