Package com.oracle.truffle.sl.nodes
Class SLStatementNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.sl.nodes.local.SLScopedNode
com.oracle.truffle.sl.nodes.SLStatementNode
- All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode,com.oracle.truffle.api.nodes.NodeInterface,Cloneable
- Direct Known Subclasses:
SLBlockNode,SLBreakNode,SLContinueNode,SLDebuggerNode,SLExpressionNode,SLIfNode,SLReturnNode,SLWhileNode
public abstract class SLStatementNode
extends SLScopedNode
implements com.oracle.truffle.api.instrumentation.InstrumentableNode
The base class of all Truffle nodes for SL. All nodes (even expressions) can be used as
statements, i.e., without returning a value. The
VirtualFrame provides access to the
local variables.-
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 TypeMethodDescriptionfinal voidMarks this node as being aStandardTags.RootTagandStandardTags.RootBodyTagfor instrumentation purposes.final voidMarks this node as being aStandardTags.StatementTagfor instrumentation purposes.com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNodecreateWrapper(com.oracle.truffle.api.instrumentation.ProbeNode probe) abstract voidexecuteVoid(com.oracle.truffle.api.frame.VirtualFrame frame) Execute this node as as statement, where no return value is necessary.static StringformatSourceSection(com.oracle.truffle.api.nodes.Node node) Formats a source section of a node in human readable form.final intfinal intfinal intfinal com.oracle.truffle.api.source.SourceSectionfinal booleanbooleanfinal booleanfinal voidsetSourceSection(int charIndex, int length) final voidtoString()Methods 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
-
SLStatementNode
public SLStatementNode()
-
-
Method Details
-
getSourceSection
public final com.oracle.truffle.api.source.SourceSection getSourceSection()- Overrides:
getSourceSectionin classcom.oracle.truffle.api.nodes.Node
-
hasSource
public final boolean hasSource() -
isInstrumentable
public final boolean isInstrumentable()- Specified by:
isInstrumentablein interfacecom.oracle.truffle.api.instrumentation.InstrumentableNode
-
getSourceCharIndex
public final int getSourceCharIndex() -
getSourceEndIndex
public final int getSourceEndIndex() -
getSourceLength
public final int getSourceLength() -
setSourceSection
public final void setSourceSection(int charIndex, int length) -
hasTag
- Specified by:
hasTagin interfacecom.oracle.truffle.api.instrumentation.InstrumentableNode
-
createWrapper
public com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNode createWrapper(com.oracle.truffle.api.instrumentation.ProbeNode probe) - Specified by:
createWrapperin interfacecom.oracle.truffle.api.instrumentation.InstrumentableNode
-
executeVoid
public abstract void executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame) Execute this node as as statement, where no return value is necessary. -
addStatementTag
public final void addStatementTag()Marks this node as being aStandardTags.StatementTagfor instrumentation purposes. -
addRootTag
public final void addRootTag()Marks this node as being aStandardTags.RootTagandStandardTags.RootBodyTagfor instrumentation purposes. -
toString
- Overrides:
toStringin classcom.oracle.truffle.api.nodes.Node
-
formatSourceSection
Formats a source section of a node in human readable form. If no source section could be found it looks up the parent hierarchy until it finds a source section. Nodes where this was required append a'~'at the end.- Parameters:
node- the node to format.- Returns:
- a formatted source section string
-