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.
  • Method Details

    • onGraalTierFinished

      void onGraalTierFinished(TruffleCompilable compilable, TruffleCompilerListener.GraphInfo graph)
      Notifies this object when Graal IR compilation compilable completes. Graal compilation occurs between onTruffleTierFinished(TruffleCompilable, TruffleCompilationTask, TruffleCompilerListener.GraphInfo) and code installation.
      Parameters:
      compilable - the call target that was compiled
      graph - the graph representing compilable. The graph object is only valid for the lifetime of a call to this method. Invoking any TruffleCompilerListener.GraphInfo method on graph after this method returns will result in an IllegalStateException.
    • onTruffleTierFinished

      void onTruffleTierFinished(TruffleCompilable compilable, TruffleCompilationTask task, TruffleCompilerListener.GraphInfo graph)
      Notifies this object when compilation of compilable has completed partial evaluation and is about to perform compilation of the graph produced by partial evaluation.
      Parameters:
      compilable - the call target being compiled
      task - the compilation task
      graph - the graph representing compilable. The graph object is only valid for the lifetime of a call to this method. Invoking any TruffleCompilerListener.GraphInfo method on graph after this method returns will result in an IllegalStateException.
    • onSuccess

      default void onSuccess(TruffleCompilable compilable, TruffleCompilationTask task, TruffleCompilerListener.GraphInfo graph, TruffleCompilerListener.CompilationResultInfo compilationResultInfo, int tier)
      Notifies this object when compilation of compilable succeeds.
      Parameters:
      compilable - the Truffle AST whose compilation succeeded
      task - the compilation task
      graph - the graph representing compilable. The graph object is only valid for the lifetime of a call to this method. Invoking any TruffleCompilerListener.GraphInfo method on graph after this method returns will result in an IllegalStateException.
      compilationResultInfo - the result of a compilation. The compilationResultInfo object is only valid for the lifetime of a call to this method. Invoking any TruffleCompilerListener.CompilationResultInfo method on compilationResultInfo after this method returns will result in an IllegalStateException.
      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 of compilable fails.

      GR-54187: Remove in graalvm-25.1

      Parameters:
      compilable - the Truffle AST whose compilation failed
      reason - the reason compilation failed
      bailout - 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 of target (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 the target is compiled again. This value is meaningless if bailout == 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 of compilable fails.
      Parameters:
      compilable - the Truffle AST whose compilation failed
      reason - the reason compilation failed
      bailout - 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 of target (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 the target is compiled again. This value is meaningless if bailout == false.
      tier - Which compilation tier was the compilation
      lazyStackTrace - a serialized representation of the exception indicating the reason and stack trace for a compilation failure, or null in the case of a bailout or when the compiler does not provide a stack trace. See TruffleCompilable.serializeException(Throwable).
    • onCompilationRetry

      default void onCompilationRetry(TruffleCompilable compilable, TruffleCompilationTask task)
      Notifies this object when compilation of compilable is 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.