Annotation Interface GenerateCached


@Retention(CLASS) @Target(TYPE) public @interface GenerateCached
Allows to enable or disable the generation of the cached version of a Truffle DSL node. By default any node generates a cached version of a node if it contains specialization methods. The cached version of a node is accessed through a generated class that is named with the suffix Gen of the source node. For example if the node containing specializations is named TestNode the generated node will be called TestNodeGen. Any node where generated cached is enabled will contain a create method.

This annotation is useful if only an uncached or inlinable version of the node should be generated. It also allows to disable code generation for abstract nodes with specializations that should not generate code.

Since:
23.0
  • Element Details

    • value

      boolean value
      If true enables the generation of a cached 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 alwaysInlineCached() to subclasses. It is false by default.
      Since:
      23.0
      Default:
      false
    • alwaysInlineCached

      boolean alwaysInlineCached
      Configures whether a cached inlinable node is inlined by default. By default a warning is emitted if the inline flag is not enabled explicitly. This is not necessary for nodes annotated with GenerateInline they must always inline their cached values, as they are otherwise themselves not inlinable.
      Since:
      23.0
      Default:
      false