Annotation Interface HostCompilerDirectives.InliningCutoff

Enclosing class:
HostCompilerDirectives

@Retention(RUNTIME) @Target({METHOD,CONSTRUCTOR}) public static @interface HostCompilerDirectives.InliningCutoff
Hints to Truffle host inlining that a particular method is partial evaluatable, but it would be a good place for a cutoff when performing host inlining. A host compiler may use this information as a hint to take trade-offs optimizing the code. Good examples of cutoffs are:
  • Methods related to instrumentation or tracing. Instrumentation and tracing are typically not critical for interpreter performance.
  • Methods raising guest language exceptions. Such paths must often partially evaluate for good peak performance, but are not a priority to optimize during interpreter execution.
  • Methods related to Truffle interoperability behavior. Such paths are typically only used exceptionally, as the vast majority of code is likely non-interop code.
  • Methods that are very complex and would only deny other more important methods to be inlined.
If a method is already annotated with CompilerDirectives.TruffleBoundary or is dominated by a call to transferToInterpreter() then this method has no effect, as any path that is not designed for partial evaluation is already considered a slow-path in hosted inlining.

This annotation may be used to tune Truffle hosted inlining decisions. It is useful in cases where the host inliner did not have enough budget to exhaustively inline the entire partial evaluatable fast-path. In such a case it might be worthwhile to annotate rarely executed methods with HostCompilerDirectives.InliningCutoff to reduce their priority to make room for more important methods.

For more details on host inlining see the documentation

Since:
22.3