# HG changeset patch # User Josef Eisl # Date 1414596002 -3600 # Node ID 49898cb251d81cfea867a6cad3b2a17e9c4849e6 # Parent d3dfd1f9545f3d65939199a1ec9b0b4578d907c2 Make MethodCallTargetNode Simplifiable (instead of Canonicalizable). diff -r d3dfd1f9545f -r 49898cb251d8 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Tue Oct 28 20:38:02 2014 +0100 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java Wed Oct 29 16:20:02 2014 +0100 @@ -31,7 +31,7 @@ import com.oracle.graal.nodes.type.*; @NodeInfo -public class MethodCallTargetNode extends CallTargetNode implements IterableNodeType, Canonicalizable { +public class MethodCallTargetNode extends CallTargetNode implements IterableNodeType, Simplifiable { protected final JavaType returnType; /** @@ -100,14 +100,14 @@ } @Override - public Node canonical(CanonicalizerTool tool) { + public void simplify(SimplifierTool tool) { if (invokeKind() == InvokeKind.Interface || invokeKind() == InvokeKind.Virtual) { // attempt to devirtualize the call // check for trivial cases (e.g. final methods, nonvirtual methods) if (targetMethod().canBeStaticallyBound()) { setInvokeKind(InvokeKind.Special); - return this; + return; } // check if the type of the receiver can narrow the result @@ -122,7 +122,7 @@ if (resolvedMethod != null && (resolvedMethod.canBeStaticallyBound() || StampTool.isExactType(receiver) || type.isArray())) { setInvokeKind(InvokeKind.Special); setTargetMethod(resolvedMethod); - return this; + return; } if (tool.assumptions() != null && tool.assumptions().useOptimisticAssumptions()) { ResolvedJavaType uniqueConcreteType = type.findUniqueConcreteSubtype(); @@ -132,7 +132,7 @@ tool.assumptions().recordConcreteSubtype(type, uniqueConcreteType); setInvokeKind(InvokeKind.Special); setTargetMethod(methodFromUniqueType); - return this; + return; } } @@ -141,12 +141,11 @@ tool.assumptions().recordConcreteMethod(targetMethod(), type, uniqueConcreteMethod); setInvokeKind(InvokeKind.Special); setTargetMethod(uniqueConcreteMethod); - return this; + return; } } } } - return this; } @Override