Interface OptimizedTruffleRuntimeListener
- All Known Implementing Classes:
AbstractGraalTruffleRuntimeListener, JFRListener, StatisticsListener, TraceASTCompilationListener, TraceCompilationListener, TraceCompilationPolymorphismListener, TraceSplittingListener
public interface OptimizedTruffleRuntimeListener
A listener for events related to the execution and compilation phases of a
OptimizedCallTarget. The states for a OptimizedCallTarget instance can be
described using the following deterministic automata: *
( (split | (queue . unqueue))*
. queue . started
. (truffleTierFinished . graalTierFinished . success)
| ([truffleTierFinished] . [graalTierFinished] . failed)
. invalidate )*
Note: | is the 'or' and . is the sequential operator. The
* represents the Kleene Closure.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddASTSizeProperty(OptimizedCallTarget target, Map<String, Object> properties) static booleanisPermanentFailure(boolean bailout, boolean permanentBailout) Determines if a failure is permanent.default voidonCompilationDeoptimized(OptimizedCallTarget target, com.oracle.truffle.api.frame.Frame frame) Notifies this object whentargethas just deoptimized and is now executing in the Truffle interpreter instead of executing compiled code.default voidonCompilationDequeued(OptimizedCallTarget target, Object source, CharSequence reason, int tier) Notifies this object aftertargetis removed from the compilation queue.default voidonCompilationFailed(OptimizedCallTarget target, String reason, boolean bailout, boolean permanentBailout) Deprecated.default voidonCompilationFailed(OptimizedCallTarget target, String reason, boolean bailout, boolean permanentBailout, int tier) default voidonCompilationFailed(OptimizedCallTarget target, String reason, boolean bailout, boolean permanentBailout, int tier, Supplier<String> lazyStackTrace) Notifies this object when compilation oftargetfails.default voidonCompilationGraalTierFinished(OptimizedCallTarget target, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph) Notifies this object when Graal compilation of a call target completes.default voidonCompilationInvalidated(OptimizedCallTarget target, Object source, CharSequence reason) Notifies this object whentargetis invalidated.default voidonCompilationQueued(OptimizedCallTarget target, int tier) Notifies this object aftertargetis added to the compilation queue.default voidonCompilationSplit(OptimizedDirectCallNode callNode) Notifies this object when the target of a Truffle call node is cloned.default voidonCompilationSplitFailed(OptimizedDirectCallNode callNode, CharSequence reason) Notifies this object when the target of a Truffle call node should be split but, for given reason, could not be.default voidonCompilationStarted(OptimizedCallTarget target, int tier) Deprecated.default voidonCompilationStarted(OptimizedCallTarget target, com.oracle.truffle.compiler.TruffleCompilationTask task) Deprecated.default voidonCompilationStarted(OptimizedCallTarget target, AbstractCompilationTask task) Notifies this object when compilation oftargetis about to start.default voidonCompilationSuccess(OptimizedCallTarget target, AbstractCompilationTask task, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph, com.oracle.truffle.compiler.TruffleCompilerListener.CompilationResultInfo result) Notifies this object when compilation oftargetsucceeds.default voidonCompilationSuccess(OptimizedCallTarget target, TruffleInlining inliningDecision, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph, com.oracle.truffle.compiler.TruffleCompilerListener.CompilationResultInfo result) default voidonCompilationSuccess(OptimizedCallTarget target, TruffleInlining inliningDecision, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph, com.oracle.truffle.compiler.TruffleCompilerListener.CompilationResultInfo result, int tier) default voidonCompilationTruffleTierFinished(OptimizedCallTarget target, AbstractCompilationTask task, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph) Notifies this object when compilation oftargethas completed partial evaluation and is about to perform compilation of the graph produced by partial evaluation.default voidonCompilationTruffleTierFinished(OptimizedCallTarget target, TruffleInlining inliningDecision, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph) Deprecated.default voidonEngineClosed(EngineData runtimeData) Notifies this object an engine using theOptimizedTruffleRuntimewas closed.default voidNotifies this object theOptimizedTruffleRuntimeis being shut down.
-
Method Details
-
onCompilationSplit
Notifies this object when the target of a Truffle call node is cloned.- Parameters:
callNode- the call node whose target has just been cloned
-
onCompilationSplitFailed
Notifies this object when the target of a Truffle call node should be split but, for given reason, could not be.- Parameters:
callNode- the call node whose where splitting could not occur.reason- why splitting of this node could not occur
-
onCompilationQueued
Notifies this object aftertargetis added to the compilation queue.- Parameters:
target- the call target that has just been enqueued for compilationtier- Which compilation tier is in question.
-
onCompilationDequeued
default void onCompilationDequeued(OptimizedCallTarget target, Object source, CharSequence reason, int tier) Notifies this object aftertargetis removed from the compilation queue.- Parameters:
target- the call target that has just been removed from the compilation queuesource- the source object that caused the compilation to be unqueued. For example the sourceNodeobject. May benull.reason- a textual description of the reason why the compilation was unqueued. May benull.tier- Which compilation tier is in question.
-
onCompilationStarted
Deprecated.- Parameters:
target- the call target about to be compiledtier- Which compilation tier is in question.
-
onCompilationStarted
@Deprecated(since="23.0") default void onCompilationStarted(OptimizedCallTarget target, com.oracle.truffle.compiler.TruffleCompilationTask task) Deprecated.Notifies this object when compilation oftargetis about to start.- Parameters:
target- the call target about to be compiledtask- which compilation task is in question.
-
onCompilationStarted
Notifies this object when compilation oftargetis about to start.- Parameters:
target- the call target about to be compiledtask- which compilation task is in question.
-
onCompilationTruffleTierFinished
@Deprecated default void onCompilationTruffleTierFinished(OptimizedCallTarget target, TruffleInlining inliningDecision, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph) Deprecated.Notifies this object when compilation oftargethas completed partial evaluation and is about to perform compilation of the graph produced by partial evaluation.- Parameters:
target- the call target being compiledinliningDecision- the inlining plan used during partial evaluationgraph- access to compiler graph info
-
onCompilationTruffleTierFinished
default void onCompilationTruffleTierFinished(OptimizedCallTarget target, AbstractCompilationTask task, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph) Notifies this object when compilation oftargethas completed partial evaluation and is about to perform compilation of the graph produced by partial evaluation.- Parameters:
target- the call target being compiledtask- the compilation taskgraph- access to compiler graph info
-
onCompilationGraalTierFinished
default void onCompilationGraalTierFinished(OptimizedCallTarget target, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph) Notifies this object when Graal compilation of a call target completes. Graal compilation occurs betweenonCompilationTruffleTierFinished(OptimizedCallTarget, TruffleInlining, TruffleCompilerListener.GraphInfo)and code installation.- Parameters:
target- the call target that was compiledgraph- the graph representingtarget
-
onCompilationSuccess
@Deprecated(since="21.0") default void onCompilationSuccess(OptimizedCallTarget target, TruffleInlining inliningDecision, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph, com.oracle.truffle.compiler.TruffleCompilerListener.CompilationResultInfo result) -
onCompilationSuccess
@Deprecated(since="23.0") default void onCompilationSuccess(OptimizedCallTarget target, TruffleInlining inliningDecision, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph, com.oracle.truffle.compiler.TruffleCompilerListener.CompilationResultInfo result, int tier) -
onCompilationSuccess
default void onCompilationSuccess(OptimizedCallTarget target, AbstractCompilationTask task, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo graph, com.oracle.truffle.compiler.TruffleCompilerListener.CompilationResultInfo result) Notifies this object when compilation oftargetsucceeds.- Parameters:
target- the call target whose compilation succeededtask- the taskgraph- access to compiler graph inforesult- access to compilation result info
-
onCompilationFailed
@Deprecated(since="21.0") default void onCompilationFailed(OptimizedCallTarget target, String reason, boolean bailout, boolean permanentBailout) -
onCompilationFailed
@Deprecated default void onCompilationFailed(OptimizedCallTarget target, String reason, boolean bailout, boolean permanentBailout, int tier) Deprecated.Notifies this object when compilation oftargetfails.- Parameters:
target- the call target whose compilation failedreason- a description of the failurebailout- specifies whether the failure was a bailout or an error in the compiler. A bailout means the compiler aborted the compilation based on some of property oftarget(e.g., too big). A non-bailout means an unexpected error in the compiler itself.permanentBailout- specifies if a bailout is due to a condition that probably won't change if thetargetis compiled again. This value is meaningless ifbailout == false.tier- Which compilation tier is in question.
-
onCompilationFailed
default void onCompilationFailed(OptimizedCallTarget target, String reason, boolean bailout, boolean permanentBailout, int tier, Supplier<String> lazyStackTrace) Notifies this object when compilation oftargetfails.- Parameters:
target- the call target whose compilation failedreason- a description of the failurebailout- specifies whether the failure was a bailout or an error in the compiler. A bailout means the compiler aborted the compilation based on some of property oftarget(e.g., too big). A non-bailout means an unexpected error in the compiler itself.permanentBailout- specifies if a bailout is due to a condition that probably won't change if thetargetis compiled again. This value is meaningless ifbailout == false.tier- Which compilation tier is in question.lazyStackTrace- a serialized representation of the exception indicating the reason and stack trace for a compilation failure, ornullin the case of a bailout or when the compiler does not provide a stack trace. SeeTruffleCompilable.serializeException(Throwable).
-
onCompilationInvalidated
default void onCompilationInvalidated(OptimizedCallTarget target, Object source, CharSequence reason) Notifies this object whentargetis invalidated.- Parameters:
target- the call target whose compiled code was just invalidatedsource- the source object that caused the compilation to be invalidated. For example the sourceNodeobject. May benull.reason- a textual description of the reason why the compilation was invalidated. May benull.
-
onCompilationDeoptimized
default void onCompilationDeoptimized(OptimizedCallTarget target, com.oracle.truffle.api.frame.Frame frame) Notifies this object whentargethas just deoptimized and is now executing in the Truffle interpreter instead of executing compiled code.- Parameters:
target- the call target whose compiled code was just deoptimizedframe-
-
onShutdown
default void onShutdown()Notifies this object theOptimizedTruffleRuntimeis being shut down. -
onEngineClosed
Notifies this object an engine using theOptimizedTruffleRuntimewas closed.- Parameters:
runtimeData- the engine's compiler configuration
-
addASTSizeProperty
-
isPermanentFailure
static boolean isPermanentFailure(boolean bailout, boolean permanentBailout) Determines if a failure is permanent.
-
onCompilationFailed(OptimizedCallTarget, String, boolean, boolean, int, Supplier))}