comparison graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/SnippetIntrinsificationPhase.java @ 5540:a891c53a295b

Renaming RiKind => Kind.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Fri, 08 Jun 2012 23:47:42 +0200
parents e18ba36bfebc
children b4c406861c33
comparison
equal deleted inserted replaced
5539:bc647d8b0080 5540:a891c53a295b
212 } 212 }
213 213
214 /** 214 /**
215 * Calls a Java method via reflection. 215 * Calls a Java method via reflection.
216 */ 216 */
217 private static Constant callMethod(RiKind returnKind, Class< ? > holder, String name, Class< ? >[] parameterTypes, Object receiver, Object[] arguments) { 217 private static Constant callMethod(Kind returnKind, Class< ? > holder, String name, Class< ? >[] parameterTypes, Object receiver, Object[] arguments) {
218 Method method; 218 Method method;
219 try { 219 try {
220 method = holder.getDeclaredMethod(name, parameterTypes); 220 method = holder.getDeclaredMethod(name, parameterTypes);
221 method.setAccessible(true); 221 method.setAccessible(true);
222 } catch (Exception e) { 222 } catch (Exception e) {
232 throw new RuntimeException(e); 232 throw new RuntimeException(e);
233 } 233 }
234 } 234 }
235 235
236 public void cleanUpReturnCheckCast(Node newInstance) { 236 public void cleanUpReturnCheckCast(Node newInstance) {
237 if (newInstance instanceof ValueNode && ((ValueNode) newInstance).kind() != RiKind.Object) { 237 if (newInstance instanceof ValueNode && ((ValueNode) newInstance).kind() != Kind.Object) {
238 StructuredGraph graph = (StructuredGraph) newInstance.graph(); 238 StructuredGraph graph = (StructuredGraph) newInstance.graph();
239 for (CheckCastNode checkCastNode : newInstance.usages().filter(CheckCastNode.class).snapshot()) { 239 for (CheckCastNode checkCastNode : newInstance.usages().filter(CheckCastNode.class).snapshot()) {
240 for (ValueProxyNode vpn : checkCastNode.usages().filter(ValueProxyNode.class).snapshot()) { 240 for (ValueProxyNode vpn : checkCastNode.usages().filter(ValueProxyNode.class).snapshot()) {
241 graph.replaceFloating(vpn, checkCastNode); 241 graph.replaceFloating(vpn, checkCastNode);
242 } 242 }