Annotation Interface HostCompilerDirectives.BytecodeInterpreterHandlerConfig

Enclosing class:
HostCompilerDirectives

@Retention(RUNTIME) @Target(METHOD) public static @interface HostCompilerDirectives.BytecodeInterpreterHandlerConfig
Configuration for all bytecode interpreter handler arguments, including the receiver. Must be used in conjunction with HostCompilerDirectives.BytecodeInterpreterSwitch.
Since:
25.1
See Also:
  • Element Details

    • maximumOperationCode

      int maximumOperationCode
      The maximum unsigned value of the opcode. This is relevant for HostCompilerDirectives.BytecodeInterpreterHandler when tail call threading is enabled, and is used to construct a handler table.
    • arguments

      Configuration for each method argument. For non-static methods, the first element corresponds to the receiver.
    • secondarySwitch

      boolean secondarySwitch
      Indicates that the annotated method implements a secondary partition of a bytecode interpreter switch.

      A secondary switch is expected to be inlined into a primary HostCompilerDirectives.BytecodeInterpreterSwitch method during host compilation. Its handler configuration is retained so that handler calls originating from the inlined secondary switch can be mapped to the primary switch's handler stubs.

      When compiled as a separate method, however, handler calls in a secondary switch are not outlined. In particular, a deoptimization target may invoke the separately compiled secondary switch without first passing through host inlining. Keeping its handler calls ordinary prevents such execution from entering threaded handler stubs without the primary switch's exception and state-management paths.

      Returns:
      true if the annotated method is a secondary switch partition whose handler calls must not be outlined when the method is compiled separately
      Default:
      false
    • enableTailDuplication

      boolean enableTailDuplication
      Enables tail duplication for this interpreter's threaded bytecode handler stubs. When enabled, the compiler removes the control-flow anchor at the handler return and encourages duplication of the dispatch tail, allowing different handler paths to have separate indirect tail-call sites. Duplication remains subject to compiler safety checks and code size budgets; enabling this option does not guarantee that a tail will be duplicated.

      Separate dispatch sites can improve branch prediction, but the additional code can also reduce performance. This option is disabled by default and should only be enabled after measuring the effect on the interpreter's workloads. When disabled, the return anchor is retained and no tail-duplication hint is emitted. This option has no effect on non-threaded stubs, which always retain their return anchor.

      Since:
      25.5
      Default:
      false