Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 5541:b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
author | Thomas Wuerthinger <thomas.wuerthinger@oracle.com> |
---|---|
date | Sat, 09 Jun 2012 16:52:12 +0200 |
parents | a891c53a295b |
children | 823a2978e7ba |
comparison
equal
deleted
inserted
replaced
5540:a891c53a295b | 5541:b4c406861c33 |
---|---|
34 Special, | 34 Special, |
35 Static, | 35 Static, |
36 Virtual | 36 Virtual |
37 } | 37 } |
38 | 38 |
39 private final RiType returnType; | 39 private final JavaType returnType; |
40 private RiResolvedMethod targetMethod; | 40 private ResolvedJavaMethod targetMethod; |
41 private InvokeKind invokeKind; | 41 private InvokeKind invokeKind; |
42 | 42 |
43 /** | 43 /** |
44 * @param arguments | 44 * @param arguments |
45 */ | 45 */ |
46 public MethodCallTargetNode(InvokeKind invokeKind, RiResolvedMethod targetMethod, ValueNode[] arguments, RiType returnType) { | 46 public MethodCallTargetNode(InvokeKind invokeKind, ResolvedJavaMethod targetMethod, ValueNode[] arguments, JavaType returnType) { |
47 super(arguments); | 47 super(arguments); |
48 this.invokeKind = invokeKind; | 48 this.invokeKind = invokeKind; |
49 this.returnType = returnType; | 49 this.returnType = returnType; |
50 this.targetMethod = targetMethod; | 50 this.targetMethod = targetMethod; |
51 } | 51 } |
52 | 52 |
53 @Override | 53 @Override |
54 public RiType returnType() { | 54 public JavaType returnType() { |
55 return returnType; | 55 return returnType; |
56 } | 56 } |
57 | 57 |
58 /** | 58 /** |
59 * Gets the target method for this invocation instruction. | 59 * Gets the target method for this invocation instruction. |
60 * @return the target method | 60 * @return the target method |
61 */ | 61 */ |
62 public RiResolvedMethod targetMethod() { | 62 public ResolvedJavaMethod targetMethod() { |
63 return targetMethod; | 63 return targetMethod; |
64 } | 64 } |
65 | 65 |
66 public InvokeKind invokeKind() { | 66 public InvokeKind invokeKind() { |
67 return invokeKind; | 67 return invokeKind; |
69 | 69 |
70 public void setInvokeKind(InvokeKind kind) { | 70 public void setInvokeKind(InvokeKind kind) { |
71 this.invokeKind = kind; | 71 this.invokeKind = kind; |
72 } | 72 } |
73 | 73 |
74 public void setTargetMethod(RiResolvedMethod method) { | 74 public void setTargetMethod(ResolvedJavaMethod method) { |
75 targetMethod = method; | 75 targetMethod = method; |
76 } | 76 } |
77 | 77 |
78 /** | 78 /** |
79 * Gets the instruction that produces the receiver object for this invocation, if any. | 79 * Gets the instruction that produces the receiver object for this invocation, if any. |
124 public ValueNode canonical(CanonicalizerTool tool) { | 124 public ValueNode canonical(CanonicalizerTool tool) { |
125 if (!isStatic()) { | 125 if (!isStatic()) { |
126 ValueNode receiver = receiver(); | 126 ValueNode receiver = receiver(); |
127 if (receiver != null && receiver.objectStamp().isExactType()) { | 127 if (receiver != null && receiver.objectStamp().isExactType()) { |
128 if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) { | 128 if (invokeKind == InvokeKind.Interface || invokeKind == InvokeKind.Virtual) { |
129 RiResolvedMethod method = receiver.objectStamp().type().resolveMethodImpl(targetMethod); | 129 ResolvedJavaMethod method = receiver.objectStamp().type().resolveMethodImpl(targetMethod); |
130 if (method != null) { | 130 if (method != null) { |
131 invokeKind = InvokeKind.Special; | 131 invokeKind = InvokeKind.Special; |
132 targetMethod = method; | 132 targetMethod = method; |
133 } | 133 } |
134 } | 134 } |
137 return this; | 137 return this; |
138 } | 138 } |
139 | 139 |
140 public Stamp returnStamp() { | 140 public Stamp returnStamp() { |
141 Kind returnKind = targetMethod.signature().returnKind(); | 141 Kind returnKind = targetMethod.signature().returnKind(); |
142 if (returnKind == Kind.Object && returnType instanceof RiResolvedType) { | 142 if (returnKind == Kind.Object && returnType instanceof ResolvedJavaType) { |
143 return StampFactory.declared((RiResolvedType) returnType); | 143 return StampFactory.declared((ResolvedJavaType) returnType); |
144 } else { | 144 } else { |
145 return StampFactory.forKind(returnKind); | 145 return StampFactory.forKind(returnKind); |
146 } | 146 } |
147 } | 147 } |
148 } | 148 } |