Annotation Interface GenerateInline


@Retention(CLASS) @Target(TYPE) public @interface GenerateInline
Generates code for a node that makes this node inlinable when used in cached parameters of specializations. Inlining nodes significantly reduces the footprint of cached nodes as node allocations are avoided. A node subclass must fullfill the following requirements in order to be inlinable:
  • All execute methods of a the node must have a node as first parameter type.
  • The node has no instance fields and must not use NodeChild or NodeField.
  • The cached node types must not be recursive.
Truffle DSL emits warnings if the use of this annotation is recommended. In addition to inlining nodes automatically using this annotation, manually written nodes can also be written to become inlinable. See InlineSupport for details. Please see the node object inlining tutorial for details on how to use this annotation.
Since:
23.0
See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    If true enables inheritance of value() and inlineByDefault() to subclasses.
    boolean
    If true the inlined version is used by default when the node is used as a cached argument.
    boolean
    If true enables the generation of a inlined version of this specializing node.
  • Element Details

    • value

      boolean value
      If true enables the generation of a inlined version of this specializing node. It is enabled by default.
      Since:
      23.0
      Default:
      true
    • inherit

      boolean inherit
      If true enables inheritance of value() and inlineByDefault() to subclasses. It is false by default.
      Since:
      23.0
      Default:
      false
    • inlineByDefault

      boolean inlineByDefault
      If true the inlined version is used by default when the node is used as a cached argument. Changing this value on an existing node class with existing and already compiled usages will not force the recompilation of the usages. One has to manually force recompilation of all the affected code. If the node class is part of supported public API, changing this value is a source incompatible change!
      Since:
      23.0
      Default:
      false