# HG changeset patch # User Doug Simon # Date 1407959832 -7200 # Node ID 5e647663b77e20d0db404e1fb249888f639c3108 # Parent e5e45c74d95e815568782972f185d79831b5cecd instances of generated Node classes are created with static factory methods diff -r e5e45c74d95e -r 5e647663b77e graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java --- a/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Aug 13 21:28:23 2014 +0200 +++ b/graal/com.oracle.graal.word/src/com/oracle/graal/word/phases/WordTypeRewriterPhase.java Wed Aug 13 21:57:12 2014 +0200 @@ -335,8 +335,13 @@ */ private static ValueNode createBinaryNodeInstance(Class nodeClass, ValueNode left, ValueNode right) { try { - Constructor constructor = nodeClass.getConstructor(ValueNode.class, ValueNode.class); - return constructor.newInstance(left, right); + try { + Constructor constructor = nodeClass.getConstructor(ValueNode.class, ValueNode.class); + return constructor.newInstance(left, right); + } catch (NoSuchMethodException e) { + Method create = nodeClass.getDeclaredMethod("create", ValueNode.class, ValueNode.class); + return (ValueNode) create.invoke(null, left, right); + } } catch (Throwable ex) { throw new GraalInternalError(ex).addContext(nodeClass.getName()); }