Interface TruffleCompilerListener
public interface TruffleCompilerListener
A listener for events related to the compilation of a
TruffleCompilable. The events are
described only in terms of types that can be easily serialized or proxied across a heap boundary.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSummary information for the result of a compilation.static interfaceSummary information for a compiler graph. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidonCompilationRetry(TruffleCompilable compilable, TruffleCompilationTask task) Notifies this object when compilation ofcompilableis re-tried to diagnose a compilation problem.default voidonFailure(TruffleCompilable compilable, String reason, boolean bailout, boolean permanentBailout, int tier) Deprecated.default voidonFailure(TruffleCompilable compilable, String reason, boolean bailout, boolean permanentBailout, int tier, Supplier<String> lazyStackTrace) Notifies this object when compilation ofcompilablefails.voidonGraalTierFinished(TruffleCompilable compilable, TruffleCompilerListener.GraphInfo graph) Notifies this object when Graal IR compilationcompilablecompletes.default voidonSuccess(TruffleCompilable compilable, TruffleCompilationTask task, TruffleCompilerListener.GraphInfo graph, TruffleCompilerListener.CompilationResultInfo compilationResultInfo, int tier) Notifies this object when compilation ofcompilablesucceeds.voidonTruffleTierFinished(TruffleCompilable compilable, TruffleCompilationTask task, TruffleCompilerListener.GraphInfo graph) Notifies this object when compilation ofcompilablehas completed partial evaluation and is about to perform compilation of the graph produced by partial evaluation.
-
Method Details
-
onGraalTierFinished
Notifies this object when Graal IR compilationcompilablecompletes. Graal compilation occurs betweenonTruffleTierFinished(com.oracle.truffle.compiler.TruffleCompilable, com.oracle.truffle.compiler.TruffleCompilationTask, com.oracle.truffle.compiler.TruffleCompilerListener.GraphInfo)and code installation.- Parameters:
compilable- the call target that was compiledgraph- the graph representingcompilable. Thegraphobject is only valid for the lifetime of a call to this method. Invoking anyTruffleCompilerListener.GraphInfomethod ongraphafter this method returns will result in anIllegalStateException.
-
onTruffleTierFinished
void onTruffleTierFinished(TruffleCompilable compilable, TruffleCompilationTask task, TruffleCompilerListener.GraphInfo graph) Notifies this object when compilation ofcompilablehas completed partial evaluation and is about to perform compilation of the graph produced by partial evaluation.- Parameters:
compilable- the call target being compiledtask- the compilation taskgraph- the graph representingcompilable. Thegraphobject is only valid for the lifetime of a call to this method. Invoking anyTruffleCompilerListener.GraphInfomethod ongraphafter this method returns will result in anIllegalStateException.
-
onSuccess
default void onSuccess(TruffleCompilable compilable, TruffleCompilationTask task, TruffleCompilerListener.GraphInfo graph, TruffleCompilerListener.CompilationResultInfo compilationResultInfo, int tier) Notifies this object when compilation ofcompilablesucceeds.- Parameters:
compilable- the Truffle AST whose compilation succeededtask- the compilation taskgraph- the graph representingcompilable. Thegraphobject is only valid for the lifetime of a call to this method. Invoking anyTruffleCompilerListener.GraphInfomethod ongraphafter this method returns will result in anIllegalStateException.compilationResultInfo- the result of a compilation. ThecompilationResultInfoobject is only valid for the lifetime of a call to this method. Invoking anyTruffleCompilerListener.CompilationResultInfomethod oncompilationResultInfoafter this method returns will result in anIllegalStateException.tier- Which compilation tier was the compilation
-
onFailure
@Deprecated(since="24.1") default void onFailure(TruffleCompilable compilable, String reason, boolean bailout, boolean permanentBailout, int tier) Notifies this object when compilation ofcompilablefails.GR-54187: Remove in graalvm-25.1
- Parameters:
compilable- the Truffle AST whose compilation failedreason- the reason compilation failedbailout- 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 was the compilation
-
onFailure
default void onFailure(TruffleCompilable compilable, String reason, boolean bailout, boolean permanentBailout, int tier, Supplier<String> lazyStackTrace) Notifies this object when compilation ofcompilablefails.- Parameters:
compilable- the Truffle AST whose compilation failedreason- the reason compilation failedbailout- 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 was the compilationlazyStackTrace- 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).
-
onCompilationRetry
Notifies this object when compilation ofcompilableis re-tried to diagnose a compilation problem.- Parameters:
compilable- the Truffle AST which is going to be re-compiled.task- Which compilation task is in question.
-
onFailure(TruffleCompilable, String, boolean, boolean, int, Supplier)