Package com.oracle.truffle.api.dsl
Annotation 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
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionboolean
boolean
boolean
Iftrue
enables the generation of a cached version of thisspecializing
node.
-
Element Details
-
value
boolean valueIftrue
enables the generation of a cached version of thisspecializing
node. It is enabled by default.- Since:
- 23.0
- Default:
true
-
inherit
boolean inheritIftrue
enables inheritance ofvalue()
andalwaysInlineCached()
to subclasses. It isfalse
by default.- Since:
- 23.0
- Default:
false
-
alwaysInlineCached
boolean alwaysInlineCachedConfigures whether acached
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 withGenerateInline
they must always inline their cached values, as they are otherwise themselves not inlinable.- Since:
- 23.0
- Default:
false
-