Class SLShortCircuitNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.sl.nodes.local.SLScopedNode
com.oracle.truffle.sl.nodes.SLStatementNode
com.oracle.truffle.sl.nodes.SLExpressionNode
com.oracle.truffle.sl.nodes.expression.SLShortCircuitNode
- All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode,com.oracle.truffle.api.nodes.NodeInterface,Cloneable
- Direct Known Subclasses:
SLLogicalAndNode,SLLogicalOrNode
Logical operations in SL use short circuit evaluation: if the evaluation of the left operand
already decides the result of the operation, the right operand must not be executed. This is
expressed in using this base class for
SLLogicalAndNode and SLLogicalOrNode.-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.ChildrenNested classes/interfaces inherited from interface com.oracle.truffle.api.instrumentation.InstrumentableNode
com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNode -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract booleanexecute(boolean leftValue, boolean rightValue) Calculates the result of the short circuit operation.final booleanexecuteBoolean(com.oracle.truffle.api.frame.VirtualFrame frame) final ObjectexecuteGeneric(com.oracle.truffle.api.frame.VirtualFrame frame) The execute method when no specialization is possible.protected abstract booleanisEvaluateRight(boolean leftValue) This method is called after the left child was evaluated, but before the right child is evaluated.Methods inherited from class com.oracle.truffle.sl.nodes.SLExpressionNode
addExpressionTag, createWrapper, executeLong, executeVoid, hasTagMethods inherited from class com.oracle.truffle.sl.nodes.SLStatementNode
addRootTag, addStatementTag, formatSourceSection, getSourceCharIndex, getSourceEndIndex, getSourceLength, getSourceSection, hasSource, isInstrumentable, setSourceSection, setUnavailableSourceSection, toStringMethods inherited from class com.oracle.truffle.sl.nodes.local.SLScopedNode
findBlock, getVisibleVariablesIndexOnEnter, hasScope, setVisibleVariablesIndexOnEnter, setVisibleVariablesIndexOnExitMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplaceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.oracle.truffle.api.instrumentation.InstrumentableNode
createProbe, findNearestNodeAt, findNearestNodeAt, findProbe, getNodeObject, materializeInstrumentableNodes
-
Constructor Details
-
SLShortCircuitNode
-
-
Method Details
-
executeGeneric
Description copied from class:SLExpressionNodeThe execute method when no specialization is possible. This is the most general case, therefore it must be provided by all subclasses.- Specified by:
executeGenericin classSLExpressionNode
-
executeBoolean
public final boolean executeBoolean(com.oracle.truffle.api.frame.VirtualFrame frame) - Overrides:
executeBooleanin classSLExpressionNode
-
isEvaluateRight
protected abstract boolean isEvaluateRight(boolean leftValue) This method is called after the left child was evaluated, but before the right child is evaluated. The right child is only evaluated when the return value is {code true}. -
execute
protected abstract boolean execute(boolean leftValue, boolean rightValue) Calculates the result of the short circuit operation. If the right node is not evaluated thenfalseis provided.
-