Mercurial > hg > truffle
changeset 18184:49898cb251d8
Make MethodCallTargetNode Simplifiable (instead of Canonicalizable).
author | Josef Eisl <josef.eisl@jku.at> |
---|---|
date | Wed, 29 Oct 2014 16:20:02 +0100 |
parents | d3dfd1f9545f |
children | a88d819ba6a1 |
files | graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java |
diffstat | 1 files changed, 6 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- 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