Interface CallTarget
- All Known Subinterfaces:
RootCallTarget
RootNode
by calling RootNode.getCallTarget()
.
A call target allows the runtime to employ a compilation heuristic to trigger partial evaluation
of the underlying RootNode
, typically in the background. Additionally, calling a call
target builds a guest language level stack trace
which can be inspected
using TruffleRuntime.iterateFrames(com.oracle.truffle.api.frame.FrameInstanceVisitor)
or
TruffleStackTrace.getStackTrace(Throwable)
.
Do not subclass CallTarget
directly, as this interface is likely to become sealed in the
future.
- Since:
- 0.8 or earlier
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault Object
Calls the encapsulated root node with an explicit call location and arguments, and returns the result.Calls the encapsulated root node with the given arguments and returns the result.
-
Method Details
-
call
Calls the encapsulated root node with the given arguments and returns the result.By calling this method, the call location is looked up using
EncapsulatingNodeReference
. Usecall(Node, Object...)
if the call location is already known.Calling this method in partially evaluated code will allow it to get inlined if the receiver (this) is a
pe-constant
. Call sitecloning
is only supported if aDirectCallNode
is used instead.- Parameters:
arguments
- The arguments passed to the call, as an object array.- Returns:
- The result of the call.
- Since:
- 0.8 or earlier
- See Also:
-
call
Calls the encapsulated root node with an explicit call location and arguments, and returns the result.This method should be preferred over
call(Object...)
if the current location is known, as it avoids looking up the current location from a thread-local.- Parameters:
location
- ANode
that identifies the location of this call. The location may benull
if no location is available.arguments
- The arguments passed to the call, as an object array.- Returns:
- The result of the call.
- Since:
- 24.1
- See Also:
-