Module java.base
Package java.lang.classfile

# Enum ClassFile.DeadCodeOption

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

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

Enclosing interface:
  `ClassFile`

public static enum ClassFile.DeadCodeOption extends Enum<ClassFile.DeadCodeOption> implements ClassFile.Option
Option The option describing whether to patch out unreachable code . Default for stack map generation. The default is `Moved to a link with destination #PATCH_DEAD_CODE.PATCH_DEAD_CODE` Moved to a link with destination #PATCH_DEAD_CODE. to automatically patch out unreachable code with NOPs.

Since:
  24

and generate a valid stack map entry for the patched code.

The stack map generation process may fail when it encounters unreachable code and `KEEP_DEAD_CODE` is set. In such cases, users should set `ClassFile.StackMapsOption.DROP_STACK_MAPS` and provide their own stack maps that passes verification (JVMS 4.10.1).

See Java Virtual Machine Specification:
  4.10.1 Verification by Type Checking
Since:
  24
See Also:
  - `ClassFile.StackMapsOption`

## Enum Constants

- ≠
  KEEP_DEAD_CODE
  Comparing master and cf

  ### KEEP_DEAD_CODE

  public static final ClassFile.DeadCodeOption KEEP_DEAD_CODE
  Keep the unreachable code for the accuracy of the generated `class` file. Users should set `ClassFile.StackMapsOption.DROP_STACK_MAPS` to prevent stack map generation from running and provide their own `StackMapTableAttribute` to a `CodeBuilder` .
- ≠
  PATCH_DEAD_CODE
  Comparing master and cf

  ### PATCH_DEAD_CODE

  public static final ClassFile.DeadCodeOption PATCH_DEAD_CODE
  Patch unreachable code with dummy code, and generate valid dummy stack map entries. This ensures the generated code can pass verification (JVMS 4.10.1).

## Methods

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

## Summary

Differences
| Elements | Comments | Descriptions | Total
Added | Changed | Removed | Added | Changed | Removed | Added | Changed | Removed
--- | --- | --- | --- | --- | --- | --- | --- | ---
ClassFile.DeadCodeOption |  |  |  |  |  |  | 3 | 4 | 4 | 11
KEEP_DEAD_CODE |  |  |  |  |  |  | 5 |  |  | 5
PATCH_DEAD_CODE |  |  |  |  |  |  | 2 |  |  | 2
Total |  |  |  |  |  |  | 10 | 4 | 4 | 18