changeset 8385:85d4392b9e26

Introduce a ControlSinkNode base class.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Tue, 19 Mar 2013 20:48:45 +0100
parents 0edb2a515cb1
children a019b27cb9ef
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSinkNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ReturnNode.java graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/PostOrderNodeIterator.java graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ScopedPostOrderNodeIterator.java
diffstat 7 files changed, 39 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ControlSinkNode.java	Tue Mar 19 20:48:45 2013 +0100
@@ -0,0 +1,32 @@
+/*
+ * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package com.oracle.graal.nodes;
+
+import com.oracle.graal.nodes.type.*;
+
+public abstract class ControlSinkNode extends FixedNode {
+
+    public ControlSinkNode(Stamp stamp) {
+        super(stamp);
+    }
+}
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Tue Mar 19 20:48:28 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/DeoptimizeNode.java	Tue Mar 19 20:48:45 2013 +0100
@@ -29,7 +29,7 @@
 import com.oracle.graal.nodes.type.*;
 
 @NodeInfo(shortName = "Deopt", nameTemplate = "Deopt {p#reason/s}")
-public class DeoptimizeNode extends FixedNode implements Node.IterableNodeType, LIRLowerable {
+public class DeoptimizeNode extends ControlSinkNode implements Node.IterableNodeType, LIRLowerable {
 
     private final DeoptimizationAction action;
     private final DeoptimizationReason reason;
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ReturnNode.java	Tue Mar 19 20:48:28 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/ReturnNode.java	Tue Mar 19 20:48:45 2013 +0100
@@ -26,7 +26,7 @@
 import com.oracle.graal.nodes.spi.*;
 import com.oracle.graal.nodes.type.*;
 
-public final class ReturnNode extends FixedNode implements LIRLowerable, Node.IterableNodeType {
+public final class ReturnNode extends ControlSinkNode implements LIRLowerable, Node.IterableNodeType {
 
     @Input private ValueNode result;
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java	Tue Mar 19 20:48:28 2013 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/UnwindNode.java	Tue Mar 19 20:48:45 2013 +0100
@@ -31,7 +31,7 @@
  * Unwind takes an exception object, destroys the current stack frame and passes the exception
  * object to the system's exception dispatch code.
  */
-public final class UnwindNode extends FixedNode implements Lowerable, LIRLowerable, Node.IterableNodeType {
+public final class UnwindNode extends ControlSinkNode implements Lowerable, LIRLowerable, Node.IterableNodeType {
 
     @Input private ValueNode exception;
 
--- a/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java	Tue Mar 19 20:48:28 2013 +0100
+++ b/graal/com.oracle.graal.phases.common/src/com/oracle/graal/phases/common/InliningPhase.java	Tue Mar 19 20:48:45 2013 +0100
@@ -443,11 +443,7 @@
                     queueSuccessors(current);
                 } else if (current instanceof EndNode) {
                     queueMerge((EndNode) current);
-                } else if (current instanceof DeoptimizeNode) {
-                    // nothing todo
-                } else if (current instanceof ReturnNode) {
-                    // nothing todo
-                } else if (current instanceof UnwindNode) {
+                } else if (current instanceof ControlSinkNode) {
                     // nothing todo
                 } else if (current instanceof ControlSplitNode) {
                     queueSuccessors(current);
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/PostOrderNodeIterator.java	Tue Mar 19 20:48:28 2013 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/PostOrderNodeIterator.java	Tue Mar 19 20:48:45 2013 +0100
@@ -89,14 +89,8 @@
                 end((EndNode) current);
                 queueMerge((EndNode) current);
                 current = nextQueuedNode();
-            } else if (current instanceof DeoptimizeNode) {
-                deoptimize((DeoptimizeNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof ReturnNode) {
-                returnNode((ReturnNode) current);
-                current = nextQueuedNode();
-            } else if (current instanceof UnwindNode) {
-                unwind((UnwindNode) current);
+            } else if (current instanceof ControlSinkNode) {
+                node(current);
                 current = nextQueuedNode();
             } else if (current instanceof ControlSplitNode) {
                 Set<Node> successors = controlSplit((ControlSplitNode) current);
@@ -216,24 +210,12 @@
         node(loopEnd);
     }
 
-    protected void deoptimize(DeoptimizeNode deoptimize) {
-        node(deoptimize);
-    }
-
     protected Set<Node> controlSplit(ControlSplitNode controlSplit) {
         node(controlSplit);
         return null;
     }
 
-    protected void returnNode(ReturnNode returnNode) {
-        node(returnNode);
-    }
-
     protected void invoke(Invoke invoke) {
         node(invoke.node());
     }
-
-    protected void unwind(UnwindNode unwind) {
-        node(unwind);
-    }
 }
--- a/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ScopedPostOrderNodeIterator.java	Tue Mar 19 20:48:28 2013 +0100
+++ b/graal/com.oracle.graal.phases/src/com/oracle/graal/phases/graph/ScopedPostOrderNodeIterator.java	Tue Mar 19 20:48:45 2013 +0100
@@ -73,11 +73,7 @@
                 queueSuccessors(current);
             } else if (current instanceof EndNode) {
                 queueMerge((EndNode) current);
-            } else if (current instanceof DeoptimizeNode) {
-                // nothing todo
-            } else if (current instanceof ReturnNode) {
-                // nothing todo
-            } else if (current instanceof UnwindNode) {
+            } else if (current instanceof ControlSinkNode) {
                 // nothing todo
             } else if (current instanceof ControlSplitNode) {
                 queueSuccessors(current);