Class DirectCallNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.DirectCallNode
- All Implemented Interfaces:
NodeInterface, Cloneable
Represents a direct call to a
CallTarget. Direct calls are calls for which the
CallTarget remains the same for each consecutive call. This part of the Truffle API
enables the runtime system to perform additional optimizations on direct calls.
Optimizations that can be applied to a DirectCallNode are inlining and call site
sensitive AST duplication. Inlining inlines this call site into the call graph of the parent
CallTarget. Call site sensitive AST duplication duplicates the CallTarget in an
uninitialized state to collect call site sensitive profiling information.
Please note: This class is not intended to be subclassed by guest language implementations.- Since:
- 0.8 or earlier
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class Node
Node.Child, Node.Children -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract ObjectCalls the innerCallTargetreturned bygetCurrentCallTarget().abstract booleanClones theCallTargetinstance returned bygetCallTarget()in an uninitialized state for thisDirectCallNode.static DirectCallNodecreate(CallTarget target) Creates cached direct call node using bytecode index-1.abstract voidEnforces the runtime system to inline theCallTargetat this call site.Returns the originally suppliedCallTargetwhen this call node was created.abstract CallTargetReturns the splitCallTargetif this call site'sCallTargetis cloned.Returns the used call target whencall(java.lang.Object[])is invoked.final RootNodefinal booleanReturnstrueif the target of theDirectCallNodewas cloned by the runtime system or by the guest language implementation.abstract booleanReturnstrueif the runtime system supports cloning and theRootNodereturnstrueinRootNode.isCloningAllowed().abstract booleanReturnstrueif the underlying runtime system supports inlining for theCallTargetin thisDirectCallNode.abstract booleanReturnstrueif theCallTargetis forced to be inlined.toString()Converts this node to a textual representation useful for debugging.Methods inherited from class 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
-
Field Details
-
callTarget
- Since:
- 0.8 or earlier
-
-
Constructor Details
-
DirectCallNode
- Since:
- 0.8 or earlier
-
-
Method Details
-
call
Calls the innerCallTargetreturned bygetCurrentCallTarget().- Parameters:
arguments- the arguments that should be passed to the callee- Returns:
- the return result of the call
- Since:
- 0.23
-
getCallTarget
Returns the originally suppliedCallTargetwhen this call node was created. Please note that the returnedCallTargetis not necessarily theCallTargetthat is called. For that usegetCurrentCallTarget()instead.- Returns:
- the
CallTargetprovided. - Since:
- 0.8 or earlier
-
isInlinable
public abstract boolean isInlinable()Returnstrueif the underlying runtime system supports inlining for theCallTargetin thisDirectCallNode.- Returns:
- true if inlining is supported.
- Since:
- 0.8 or earlier
-
isInliningForced
public abstract boolean isInliningForced()Returnstrueif theCallTargetis forced to be inlined. ADirectCallNodecan either be inlined manually by invokingforceInlining()or by the runtime system which may at any point decide to inline.- Returns:
- true if this method was inlined else false.
- Since:
- 0.8 or earlier
-
forceInlining
public abstract void forceInlining()Enforces the runtime system to inline theCallTargetat this call site. If the runtime system does not support inlining or it is already inlined this method has no effect. The runtime system may decide to not inline calls which were forced to inline.- Since:
- 0.8 or earlier
-
isCallTargetCloningAllowed
public abstract boolean isCallTargetCloningAllowed()Returnstrueif the runtime system supports cloning and theRootNodereturnstrueinRootNode.isCloningAllowed().- Returns:
trueif the target is allowed to be cloned.- Since:
- 0.8 or earlier
-
cloneCallTarget
public abstract boolean cloneCallTarget()Clones theCallTargetinstance returned bygetCallTarget()in an uninitialized state for thisDirectCallNode. This can be sensible to gather call site sensitive profiling information for thisDirectCallNode. IfisCallTargetCloningAllowed()returnsfalsethis method has no effect and returnsfalse.- Since:
- 0.8 or earlier
-
isCallTargetCloned
public final boolean isCallTargetCloned()Returnstrueif the target of theDirectCallNodewas cloned by the runtime system or by the guest language implementation.- Returns:
- if the target was split
- Since:
- 0.8 or earlier
-
getClonedCallTarget
Returns the splitCallTargetif this call site'sCallTargetis cloned.- Returns:
- the split
CallTarget - Since:
- 0.8 or earlier
-
getCurrentCallTarget
Returns the used call target whencall(java.lang.Object[])is invoked. If theCallTargetwas split this method returns theCallTargetreturned bygetClonedCallTarget().- Returns:
- the used
CallTargetwhen node is called - Since:
- 0.8 or earlier
-
getCurrentRootNode
Returns theRootNodeassociated withCallTargetreturned bygetCurrentCallTarget(). If the storedCallTargetdoes not contain aRootNodethis method returnsnull.- Returns:
- the root node of the used call target
- Since:
- 0.8 or earlier
- See Also:
-
toString
-
create
Creates cached direct call node using bytecode index-1.- Since:
- 0.8 or earlier
-