Class SLScopedNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.sl.nodes.local.SLScopedNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface,Cloneable
- Direct Known Subclasses:
SLStatementNode
public abstract class SLScopedNode
extends com.oracle.truffle.api.nodes.Node
The SL implementation of
NodeLibrary provides fast access to local variables. It's used
by tools like debugger, profiler, tracer, etc. To provide good performance, we cache write nodes
that declare variables and use them in the interop contract.-
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.Children -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal com.oracle.truffle.api.nodes.NodeFind block of this node.protected final intProvide the index that determines variables on node enter.booleanhasScope(com.oracle.truffle.api.frame.Frame frame) We do provide a scope.final voidsetVisibleVariablesIndexOnEnter(int index) Set the index to the theblock's variablesthat determine variables belonging into this scope (excluding parent scopes) on node enter.final voidsetVisibleVariablesIndexOnExit(int index) Similar tosetVisibleVariablesIndexOnEnter(int), but determines variables on node exit.Methods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, reportReplace, toString
-
Constructor Details
-
SLScopedNode
public SLScopedNode()
-
-
Method Details
-
hasScope
public boolean hasScope(com.oracle.truffle.api.frame.Frame frame) We do provide a scope. -
findBlock
public final com.oracle.truffle.api.nodes.Node findBlock()Find block of this node. Traverse the parent chain and find the firstSLBlockNode. If none is found,RootNodeis returned.- Returns:
- the block node, always non-null. Either SLBlockNode, or SLRootNode.
-
setVisibleVariablesIndexOnEnter
public final void setVisibleVariablesIndexOnEnter(int index) Set the index to the theblock's variablesthat determine variables belonging into this scope (excluding parent scopes) on node enter. -
setVisibleVariablesIndexOnExit
public final void setVisibleVariablesIndexOnExit(int index) Similar tosetVisibleVariablesIndexOnEnter(int), but determines variables on node exit. -
getVisibleVariablesIndexOnEnter
protected final int getVisibleVariablesIndexOnEnter()Provide the index that determines variables on node enter.
-