comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 7530:5e3d1a68664e

applied mx eclipseformat to all Java files
author Doug Simon <doug.simon@oracle.com>
date Wed, 23 Jan 2013 16:34:57 +0100
parents 225002aba5a5
children 7d66682cc901
comparison
equal deleted inserted replaced
7529:4a11124a3563 7530:5e3d1a68664e
27 import com.oracle.graal.nodes.*; 27 import com.oracle.graal.nodes.*;
28 import com.oracle.graal.nodes.spi.*; 28 import com.oracle.graal.nodes.spi.*;
29 import com.oracle.graal.nodes.type.*; 29 import com.oracle.graal.nodes.type.*;
30 30
31 public class MethodCallTargetNode extends CallTargetNode implements Node.IterableNodeType, Canonicalizable { 31 public class MethodCallTargetNode extends CallTargetNode implements Node.IterableNodeType, Canonicalizable {
32
32 public enum InvokeKind { 33 public enum InvokeKind {
33 Interface, 34 Interface, Special, Static, Virtual
34 Special,
35 Static,
36 Virtual
37 } 35 }
38 36
39 private final JavaType returnType; 37 private final JavaType returnType;
40 private ResolvedJavaMethod targetMethod; 38 private ResolvedJavaMethod targetMethod;
41 private InvokeKind invokeKind; 39 private InvokeKind invokeKind;
50 this.targetMethod = targetMethod; 48 this.targetMethod = targetMethod;
51 } 49 }
52 50
53 /** 51 /**
54 * Gets the target method for this invocation instruction. 52 * Gets the target method for this invocation instruction.
53 *
55 * @return the target method 54 * @return the target method
56 */ 55 */
57 public ResolvedJavaMethod targetMethod() { 56 public ResolvedJavaMethod targetMethod() {
58 return targetMethod; 57 return targetMethod;
59 } 58 }
70 targetMethod = method; 69 targetMethod = method;
71 } 70 }
72 71
73 /** 72 /**
74 * Gets the instruction that produces the receiver object for this invocation, if any. 73 * Gets the instruction that produces the receiver object for this invocation, if any.
75 * @return the instruction that produces the receiver object for this invocation if any, {@code null} if this 74 *
76 * invocation does not take a receiver object 75 * @return the instruction that produces the receiver object for this invocation if any,
76 * {@code null} if this invocation does not take a receiver object
77 */ 77 */
78 public ValueNode receiver() { 78 public ValueNode receiver() {
79 return isStatic() ? null : arguments().get(0); 79 return isStatic() ? null : arguments().get(0);
80 } 80 }
81 81
82 /** 82 /**
83 * Checks whether this is an invocation of a static method. 83 * Checks whether this is an invocation of a static method.
84 *
84 * @return {@code true} if the invocation is a static invocation 85 * @return {@code true} if the invocation is a static invocation
85 */ 86 */
86 public boolean isStatic() { 87 public boolean isStatic() {
87 return invokeKind() == InvokeKind.Static; 88 return invokeKind() == InvokeKind.Static;
88 } 89 }
92 } 93 }
93 94
94 public Invoke invoke() { 95 public Invoke invoke() {
95 return (Invoke) this.usages().first(); 96 return (Invoke) this.usages().first();
96 } 97 }
97
98 98
99 @Override 99 @Override
100 public boolean verify() { 100 public boolean verify() {
101 assert usages().count() <= 1 : "call target may only be used by a single invoke"; 101 assert usages().count() <= 1 : "call target may only be used by a single invoke";
102 for (Node n : usages()) { 102 for (Node n : usages()) {