diff graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/KillingBeginNode.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 0fe4732e5181
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/KillingBeginNode.java	Mon Aug 18 13:49:25 2014 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/KillingBeginNode.java	Mon Aug 18 14:04:21 2014 +0200
@@ -31,7 +31,11 @@
 
     private LocationIdentity locationIdentity;
 
-    public KillingBeginNode(LocationIdentity locationIdentity) {
+    public static KillingBeginNode create(LocationIdentity locationIdentity) {
+        return new KillingBeginNodeGen(locationIdentity);
+    }
+
+    protected KillingBeginNode(LocationIdentity locationIdentity) {
         this.locationIdentity = locationIdentity;
     }
 
@@ -39,7 +43,7 @@
         if (with instanceof KillingBeginNode) {
             return (KillingBeginNode) with;
         }
-        KillingBeginNode begin = with.graph().add(new KillingBeginNode(locationIdentity));
+        KillingBeginNode begin = with.graph().add(KillingBeginNode.create(locationIdentity));
         begin.setNext(with);
         return begin;
     }