changeset 5368:a4218dd1b157

added javadoc to GuardNode
author Doug Simon <doug.simon@oracle.com>
date Wed, 09 May 2012 16:39:52 +0200
parents 7cf71c7961c6
children 2e9a5365dfb0
files graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Wed May 09 16:21:03 2012 +0200
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java	Wed May 09 16:39:52 2012 +0200
@@ -29,6 +29,17 @@
 import com.oracle.graal.nodes.type.*;
 import com.oracle.max.cri.ri.*;
 
+/**
+ * A guard is a node that deoptimizes based on a conditional expression. Guards are not attached to a certain frame
+ * state, they can move around freely and will always use the correct frame state when the nodes are scheduled (i.e.,
+ * the last emitted frame state). The node that is guarded has a data dependency on the guard and the guard in turn has
+ * a data dependency on the condition. A guard may only be executed if it is guaranteed that the guarded node is
+ * executed too (if no exceptions are thrown). Therefore, an {@linkplain AnchorNode anchor} is placed after a control
+ * flow split and the guard has a data dependency to the anchor. The anchor is the most distant node that is
+ * post-dominated by the guarded node and the guard can be scheduled anywhere between those two nodes. This ensures
+ * maximum flexibility for the guard node and guarantees that deoptimization occurs only if the control flow would have
+ * reached the guarded node (without taking exceptions into account).
+ */
 public final class GuardNode extends FloatingNode implements Canonicalizable, LIRLowerable, TypeFeedbackProvider, Node.IterableNodeType {
 
     @Input private BooleanNode condition;