Mercurial > hg > truffle
diff graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java @ 16895:06c15e88d383
added factory method to all Node classes; replaced Node classes instantiation with calls to factory methods; replaced identity tests on Node classes with ' == <node class>.getGenClass()' idiom
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 18 Aug 2014 14:04:21 +0200 |
parents | cbd42807a31f |
children | f90dcdbbb75e |
line wrap: on
line diff
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Mon Aug 18 13:49:25 2014 +0200 +++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/TailDuplicationPhase.java Mon Aug 18 14:04:21 2014 +0200 @@ -64,7 +64,11 @@ @NodeInfo static class DummyAnchorNode extends FixedWithNextNode implements GuardingNode { - public DummyAnchorNode() { + public static DummyAnchorNode create() { + return new TailDuplicationPhase_DummyAnchorNodeGen(); + } + + protected DummyAnchorNode() { super(StampFactory.forVoid()); } } @@ -339,7 +343,7 @@ * @return The new {@link ValueAnchorNode} that was created. */ private DummyAnchorNode addValueAnchor() { - DummyAnchorNode anchor = graph.add(new DummyAnchorNode()); + DummyAnchorNode anchor = graph.add(DummyAnchorNode.create()); graph.addAfterFixed(merge, anchor); merge.replaceAtUsages(InputType.Guard, anchor); merge.replaceAtUsages(InputType.Anchor, anchor); @@ -449,8 +453,8 @@ * @return The newly created end node. */ private AbstractEndNode createNewMerge(FixedNode successor, FrameState stateAfterMerge) { - MergeNode newBottomMerge = graph.add(new MergeNode()); - AbstractEndNode newBottomEnd = graph.add(new EndNode()); + MergeNode newBottomMerge = graph.add(MergeNode.create()); + AbstractEndNode newBottomEnd = graph.add(EndNode.create()); newBottomMerge.addForwardEnd(newBottomEnd); newBottomMerge.setStateAfter(stateAfterMerge); ((FixedWithNextNode) successor.predecessor()).setNext(newBottomEnd); @@ -524,7 +528,7 @@ ValueNode node = (ValueNode) duplicated; PhiNode newPhi = bottomPhis.get(node); if (newPhi == null) { - newPhi = graph.addWithoutUnique(new ValuePhiNode(node.stamp().unrestricted(), newBottomMerge)); + newPhi = graph.addWithoutUnique(ValuePhiNode.create(node.stamp().unrestricted(), newBottomMerge)); bottomPhis.put(node, newPhi); newPhi.addInput(node); }