Mercurial > hg > graal-compiler
comparison graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/java/MethodCallTargetNode.java @ 6409:823a2978e7ba
Lowering of call targets to direct / indirect call targets
author | Christian Wimmer <christian.wimmer@oracle.com> |
---|---|
date | Fri, 14 Sep 2012 14:45:47 -0700 |
parents | b4c406861c33 |
children | 2463eb24b644 |
comparison
equal
deleted
inserted
replaced
6408:e5768e936147 | 6409:823a2978e7ba |
---|---|
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 | |
54 public JavaType returnType() { | |
55 return returnType; | |
56 } | |
57 | |
58 /** | 53 /** |
59 * Gets the target method for this invocation instruction. | 54 * Gets the target method for this invocation instruction. |
60 * @return the target method | 55 * @return the target method |
61 */ | 56 */ |
62 public ResolvedJavaMethod targetMethod() { | 57 public ResolvedJavaMethod targetMethod() { |
90 */ | 85 */ |
91 public boolean isStatic() { | 86 public boolean isStatic() { |
92 return invokeKind() == InvokeKind.Static; | 87 return invokeKind() == InvokeKind.Static; |
93 } | 88 } |
94 | 89 |
95 @Override | |
96 public Kind returnKind() { | 90 public Kind returnKind() { |
97 return targetMethod().signature().returnKind(); | 91 return targetMethod().signature().returnKind(); |
98 } | 92 } |
99 | 93 |
100 public Invoke invoke() { | 94 public Invoke invoke() { |
135 } | 129 } |
136 } | 130 } |
137 return this; | 131 return this; |
138 } | 132 } |
139 | 133 |
134 @Override | |
140 public Stamp returnStamp() { | 135 public Stamp returnStamp() { |
141 Kind returnKind = targetMethod.signature().returnKind(); | 136 Kind returnKind = targetMethod.signature().returnKind(); |
142 if (returnKind == Kind.Object && returnType instanceof ResolvedJavaType) { | 137 if (returnKind == Kind.Object && returnType instanceof ResolvedJavaType) { |
143 return StampFactory.declared((ResolvedJavaType) returnType); | 138 return StampFactory.declared((ResolvedJavaType) returnType); |
144 } else { | 139 } else { |
145 return StampFactory.forKind(returnKind); | 140 return StampFactory.forKind(returnKind); |
146 } | 141 } |
147 } | 142 } |
143 | |
144 @Override | |
145 public String targetName() { | |
146 if (targetMethod() == null) { | |
147 return "??Invalid!"; | |
148 } | |
149 return targetMethod().name(); | |
150 } | |
148 } | 151 } |