Package com.oracle.truffle.api.nodes
Class ExecutableNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.ExecutableNode
- All Implemented Interfaces:
NodeInterface
,Cloneable
- Direct Known Subclasses:
RootNode
Represents an executable node in a Truffle AST. The executable node represents an AST fragment
that can be
executed
using a frame
instance
created by the framework.- Since:
- 0.31
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
Node.Child, Node.Children
-
Constructor Summary
ModifierConstructorDescriptionprotected
ExecutableNode
(TruffleLanguage<?> language) Creates new executable node with a given language instance. -
Method Summary
Modifier and TypeMethodDescriptionabstract Object
execute
(VirtualFrame frame) Execute this fragment at the place where it was parsed.final <C extends TruffleLanguage>
CgetLanguage
(Class<C> languageClass) Returns the language instance associated with this executable node.final LanguageInfo
Returns public information about the language.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
-
ExecutableNode
Creates new executable node with a given language instance. The language instance is obtainable whileTruffleLanguage.parse(InlineParsingRequest)
is executed.- Parameters:
language
- the language this executable node is associated with- Since:
- 0.31
-
-
Method Details
-
execute
Execute this fragment at the place where it was parsed.- Parameters:
frame
- the actual frame valid at the parsed location- Returns:
- the result of the execution, must be an interop type (i.e. either implementing
TruffleObject or be a primitive value), or
null
. - Since:
- 0.31
-
getLanguageInfo
Returns public information about the language. The language can be assumed equal if the instances of the language info instance are the same. To access internal details of the language within the language implementation use aTruffleLanguage.LanguageReference
.- Since:
- 0.31
-
getLanguage
Returns the language instance associated with this executable node. The language instance is intended for internal use in languages and is only accessible if the concrete type of the language is known. Public information about the language can be accessed usinggetLanguageInfo()
. The language isnull
if the executable node is not associated with a language. This method is guaranteed to return aPE constant
if the root node is also a PE constant.- Since:
- 0.31
- See Also:
-