# HG changeset patch # User Doug Simon # Date 1336574392 -7200 # Node ID a4218dd1b157322a0c55c41db836d260221d8209 # Parent 7cf71c7961c667ec703967ab8e5438e15a69210b added javadoc to GuardNode diff -r 7cf71c7961c6 -r a4218dd1b157 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/GuardNode.java --- 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;