Class JavaScriptNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.JavaScriptNode
- All Implemented Interfaces:
com.oracle.truffle.api.instrumentation.InstrumentableNode,com.oracle.truffle.api.nodes.NodeInterface,Cloneable
- Direct Known Subclasses:
AbstractAwaitNode,AbstractBodyNode,AccessArgumentsArrayDirectlyNode,AccessDerivedConstructorThisNode,AccessFrameArgumentNode,AccessFunctionNode,AccessIndexedArgumentNode,AccessLevelFunctionNode,AccessLexicalThisNode,AccessThisNode,ArgumentsObjectNode,ArrayLiteralNode,ArrayLiteralNode.SpreadArrayNode,AsyncFunctionBodyNode,AsyncGeneratorBodyNode,CallApplyArgumentsNode,ClearFrameSlotsNode,ConstantVariableWriteNode,ConstructorResultNode,DecoratorListEvaluationNode,DefaultDerivedConstructorSuperCallNode,DualNode,EnumerateNode,EvalNode,FrameSlotNode,GeneratorBodyNode,GeneratorWrapperNode,GetAsyncIteratorNode,GetIteratorUnaryNode,GetPrototypeFromConstructorNode,GetTemplateObjectNode,GlobalObjectNode,GlobalScopeNode,ImportCallNode,ImportMetaNode,InitializeInstanceElementsNode,IterationScopeNode,IteratorCloseWrapperNode,IteratorCompleteUnaryNode,IteratorGetNextValueNode,IteratorIsDoneNode,IteratorNextUnaryNode,IteratorSetDoneNode,IteratorToArrayNode,IteratorValueNode.Unary,JSBinaryNode,JSConstantNode,JSFunctionCallNode,JSFunctionExpressionNode,JSGuardDisconnectedArgumentRead,JSGuardDisconnectedArgumentWrite,JSInputGeneratingNodeWrapper,JSLogicalNode,JSNewNode,JSTaggedExecutionNode,JSTargetableNode,JSUnaryNode,ModuleBodyNode,ModuleInitializeEnvironmentNode,ModuleYieldNode,NamedEvaluationNode,NamedEvaluationTargetNode,NewPrivateNameNode,ObjectLiteralNode,ObjectLiteralNode.MakeMethodNode,OptionalChainNode,OptionalChainNode.ShortCircuitNode,OrdinaryCreateFromConstructorNode,ReadImportBindingNode,RegExpLiteralNode,RestObjectNode,ReturnTargetNode,SpreadArgumentNode,StatementNode,TopLevelAwaitModuleBodyNode,VarWrapperNode,WithTargetNode,YieldNode,YieldStarNode
public abstract class JavaScriptNode
extends JavaScriptBaseNode
implements com.oracle.truffle.api.instrumentation.InstrumentableNode
-
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 -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedJavaScriptNode(com.oracle.truffle.api.source.SourceSection sourceSection) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal voidfinal voidfinal voidstatic <T extends JavaScriptNode>
T[]cloneUninitialized(T[] nodeArray, Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) static <T extends JavaScriptNode>
TcloneUninitialized(T node, Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) copy()protected JavaScriptNodecopyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) com.oracle.truffle.api.instrumentation.InstrumentableNode.WrapperNodecreateWrapper(com.oracle.truffle.api.instrumentation.ProbeNode probe) abstract Objectexecute(com.oracle.truffle.api.frame.VirtualFrame frame) Executes this node using the specified context and frame and returns the result value.booleanexecuteBoolean(com.oracle.truffle.api.frame.VirtualFrame frame) Likeexecute(VirtualFrame)except that it tries to convert the result value to a boolean.doubleexecuteDouble(com.oracle.truffle.api.frame.VirtualFrame frame) Likeexecute(VirtualFrame)except that it tries to convert the result value to a double.intexecuteInt(com.oracle.truffle.api.frame.VirtualFrame frame) Likeexecute(VirtualFrame)except that it tries to convert the result value to an int.voidexecuteVoid(com.oracle.truffle.api.frame.VirtualFrame frame) Likeexecute(VirtualFrame)except that it throws away the result.static com.oracle.truffle.api.nodes.NodefindBlockScopeNode(com.oracle.truffle.api.nodes.Node node) final com.oracle.truffle.api.source.SourceSectionfinal booleanbooleanbooleanbooleanisResultAlwaysOfType(Class<?> clazz) protected voidonReplace(com.oracle.truffle.api.nodes.Node newNode, CharSequence reason) final voidsetSourceSection(com.oracle.truffle.api.source.Source source, int charIndex, int charLength) final voidsetSourceSection(com.oracle.truffle.api.source.SourceSection section) toString()static voidtransferSourceSection(JavaScriptNode fromNode, JavaScriptNode toNode) static voidtransferSourceSectionAddExpressionTag(JavaScriptNode fromNode, JavaScriptNode toNode) static voidtransferSourceSectionAndTags(JavaScriptNode fromNode, JavaScriptNode toNode) Methods inherited from class com.oracle.truffle.js.nodes.JavaScriptBaseNode
getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, reportLoopCount, reportLoopCountMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, 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
-
Field Details
-
INTERMEDIATE_VALUE
- See Also:
-
-
Constructor Details
-
JavaScriptNode
protected JavaScriptNode() -
JavaScriptNode
protected JavaScriptNode(com.oracle.truffle.api.source.SourceSection sourceSection)
-
-
Method Details
-
isInstrumentable
public boolean isInstrumentable()- Specified by:
isInstrumentablein 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
-
execute
Executes this node using the specified context and frame and returns the result value.- Parameters:
frame- the frame of the currently executing guest language method- Returns:
- the value of the execution
-
executeInt
public int executeInt(com.oracle.truffle.api.frame.VirtualFrame frame) throws com.oracle.truffle.api.nodes.UnexpectedResultException Likeexecute(VirtualFrame)except that it tries to convert the result value to an int. A node can override this method if it has a better way to producing a value of type int.- Parameters:
frame- the frame of the currently executing guest language method- Returns:
- the value of the execution as an int
- Throws:
com.oracle.truffle.api.nodes.UnexpectedResultException- if a loss-free conversion of the result to int is not possible
-
executeDouble
public double executeDouble(com.oracle.truffle.api.frame.VirtualFrame frame) throws com.oracle.truffle.api.nodes.UnexpectedResultException Likeexecute(VirtualFrame)except that it tries to convert the result value to a double. A node can override this method if it has a better way to producing a value of type double.- Parameters:
frame- the frame of the currently executing guest language method- Returns:
- the value of the execution as a double
- Throws:
com.oracle.truffle.api.nodes.UnexpectedResultException- if a loss-free conversion of the result to double is not possible
-
executeBoolean
public boolean executeBoolean(com.oracle.truffle.api.frame.VirtualFrame frame) throws com.oracle.truffle.api.nodes.UnexpectedResultException Likeexecute(VirtualFrame)except that it tries to convert the result value to a boolean. A node can override this method if it has a better way to producing a value of type boolean.- Parameters:
frame- the frame of the currently executing guest language method- Returns:
- the value of the execution as a boolean
- Throws:
com.oracle.truffle.api.nodes.UnexpectedResultException- if a loss-free conversion of the result to double is not possible
-
executeVoid
public void executeVoid(com.oracle.truffle.api.frame.VirtualFrame frame) Likeexecute(VirtualFrame)except that it throws away the result. A node can override this method if it has a better way to execute without producing a value.- Parameters:
frame- the frame of the currently executing guest language method
-
copy
- Overrides:
copyin classJavaScriptBaseNode
-
toString
- Overrides:
toStringin classcom.oracle.truffle.api.nodes.Node
-
onReplace
- Overrides:
onReplacein classJavaScriptBaseNode
-
transferSourceSectionAndTags
-
transferSourceSectionAddExpressionTag
public static void transferSourceSectionAddExpressionTag(JavaScriptNode fromNode, JavaScriptNode toNode) -
transferSourceSection
-
hasSourceSection
public final boolean hasSourceSection() -
getSourceSection
public final com.oracle.truffle.api.source.SourceSection getSourceSection()- Overrides:
getSourceSectionin classcom.oracle.truffle.api.nodes.Node
-
setSourceSection
public final void setSourceSection(com.oracle.truffle.api.source.SourceSection section) -
setSourceSection
public final void setSourceSection(com.oracle.truffle.api.source.Source source, int charIndex, int charLength) -
isResultAlwaysOfType
-
hasTag
- Specified by:
hasTagin interfacecom.oracle.truffle.api.instrumentation.InstrumentableNode
-
addStatementTag
public final void addStatementTag() -
addCallTag
public final void addCallTag() -
addRootBodyTag
public final void addRootBodyTag() -
addExpressionTag
public final void addExpressionTag() -
copyUninitialized
protected JavaScriptNode copyUninitialized(Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) -
cloneUninitialized
public static <T extends JavaScriptNode> T cloneUninitialized(T node, Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) -
cloneUninitialized
public static <T extends JavaScriptNode> T[] cloneUninitialized(T[] nodeArray, Set<Class<? extends com.oracle.truffle.api.instrumentation.Tag>> materializedTags) -
expressionToString
-
findBlockScopeNode
public static com.oracle.truffle.api.nodes.Node findBlockScopeNode(com.oracle.truffle.api.nodes.Node node)
-