Annotation Interface Return


@Retention(SOURCE) @Target(TYPE) public @interface Return
Declares a custom return operation. A custom return operation has the same control-flow behavior as the built-in Return operation, but allows custom logic to compute the value returned from the bytecode root node.

A custom return operation has many of the same restrictions and capabilities of a regular Operation, with a few differences:

  • It must take one or more dynamic operands.
  • It must have a return value. This value is returned from the bytecode root node and should be a valid interop type.
If a custom return takes multiple dynamic operands, resultOperandIndex() specifies which operand represents the logical "result" of the return before the custom return executes. This result is used by tag instrumentation and EpilogReturn.
Since:
25.2
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether executing this operation should force the uncached interpreter (if enabled) to transition to cached.
    Optional documentation for the operation.
    int
    Index of the dynamic operand that represents the logical "result" of the return before the custom return executes.
    Class<? extends Tag>[]
    The instrumentation tags that should be implicitly associated with this operation.
  • Element Details

    • forceCached

      boolean forceCached
      Whether executing this operation should force the uncached interpreter (if enabled) to transition to cached.
      Since:
      25.2
      See Also:
      Default:
      false
    • tags

      Class<? extends Tag>[] tags
      The instrumentation tags that should be implicitly associated with this operation.
      Since:
      25.2
      See Also:
      Default:
      {}
    • javadoc

      String javadoc
      Optional documentation for the operation. This documentation is included in the javadoc for the generated interpreter.
      Since:
      25.2
      Default:
      ""
    • resultOperandIndex

      int resultOperandIndex
      Index of the dynamic operand that represents the logical "result" of the return before the custom return executes. This result is used by tag instrumentation and EpilogReturn.

      This field must be specified for custom returns with multiple dynamic operands; it should not be specified for custom returns with no dynamic operands.

      Since:
      25.2
      Default:
      0