changeset 16225:69ab53db5080

add initializing ValuePhiNode constructor
author Lukas Stadler <lukas.stadler@oracle.com>
date Wed, 25 Jun 2014 16:55:01 +0200
parents 68f16c1057d4
children cc4b4fd5c484
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java	Wed Jun 25 16:55:01 2014 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ValuePhiNode.java	Wed Jun 25 16:55:01 2014 +0200
@@ -34,7 +34,7 @@
 @NodeInfo(nameTemplate = "ValuePhi({i#values})")
 public class ValuePhiNode extends PhiNode implements Simplifiable {
 
-    @Input final NodeInputList<ValueNode> values = new NodeInputList<>(this);
+    @Input final NodeInputList<ValueNode> values;
 
     /**
      * Create a value phi with the specified stamp.
@@ -45,6 +45,20 @@
     public ValuePhiNode(Stamp stamp, MergeNode merge) {
         super(stamp, merge);
         assert stamp != StampFactory.forVoid();
+        values = new NodeInputList<>(this);
+    }
+
+    /**
+     * Create a value phi with the specified stamp and the given values.
+     *
+     * @param stamp the stamp of the value
+     * @param merge the merge that the new phi belongs to
+     * @param values the initial values of the phi
+     */
+    public ValuePhiNode(Stamp stamp, MergeNode merge, ValueNode[] values) {
+        super(stamp, merge);
+        assert stamp != StampFactory.forVoid();
+        this.values = new NodeInputList<>(this, values);
     }
 
     @Override