Module java.base
Package java.lang.classfile

# Enum ClassFile.ShortJumpsOption

≠
public static final enum ShortJumpsOption
extends java.lang.Enum<java.lang.classfile.ClassFile.ShortJumpsOption>
implements java.lang.classfile.ClassFile.Option
Comparing master and cf

All Implemented Interfaces:
  `Serializable, ClassFile.Option, Comparable<ClassFile.ShortJumpsOption>, Constable`

Enclosing interface:
  `ClassFile`

public static enum ClassFile.ShortJumpsOption extends Enum<ClassFile.ShortJumpsOption> implements ClassFile.Option
Option The option describing whether to automatically rewrite short jumps to long equivalent instructions when necessary. Default The default is `FIX_SHORT_JUMPS` to automatically rewrite jump instructions.

Due to physical restrictions, some types of instructions cannot encode certain jump targets with bci offsets less than -32768 or greater than 32767, as they use a `s2` to encode such an offset. (The maximum length of the `code` array is 65535.) These types of instructions are called "short jumps".

Disabling rewrite can ensure the physical accuracy of a generated `class` file and avoid the overhead from a failed first attempt for overflowing forward jumps in some cases, if the generated `class` file is stable.

Since:
  24
See Also:
  - `BranchInstruction`
  - `DiscontinuedInstruction.JsrInstruction`

## Enum Constants

- ≠
  FAIL_ON_SHORT_JUMPS
  Comparing master and cf

  ### FAIL_ON_SHORT_JUMPS

  public static final ClassFile.ShortJumpsOption FAIL_ON_SHORT_JUMPS
  Fail with an `IllegalArgumentException` if short jump overflows.

  This is useful to ensure the physical accuracy of a generated `class` file and avoids the overhead from a failed first attempt for overflowing forward jumps in some cases.

- =
  FIX_SHORT_JUMPS

## Methods

- =
  public static java.lang.classfile.ClassFile.ShortJumpsOption valueOf(java.lang.String arg0)
- =
  public static java.lang.classfile.ClassFile.ShortJumpsOption[] values()

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ClassFile.ShortJumpsOption |  |  |  |  |  |  | 3 | 3 | 1 | 7
FAIL_ON_SHORT_JUMPS |  |  |  |  |  |  | 1 |  |  | 1
Total |  |  |  |  |  |  | 4 | 3 | 1 | 8