Class DisassemblyOptions


  • public final class DisassemblyOptions
    extends Object
    Immutable flag set selecting which enrichments CodePrinter adds to a method disassembly, built from terse() or verbose() and refined with the with* copies.
    • Method Detail

      • isHeader

        public boolean isHeader()
        Returns:
        whether a max_stack/max_locals header line is emitted
      • isLineNumbers

        public boolean isLineNumbers()
        Returns:
        whether // line N comments from the LineNumberTable are interleaved
      • isLocalVariables

        public boolean isLocalVariables()
        Returns:
        whether local-slot operands are annotated with // name: descriptor from the LocalVariableTable
      • isExceptionTable

        public boolean isExceptionTable()
        Returns:
        whether the method's exception table is emitted
      • isStackMapFrames

        public boolean isStackMapFrames()
        Returns:
        whether stack-map frame markers from the StackMapTable are interleaved
      • isResolveBootstraps

        public boolean isResolveBootstraps()
        Returns:
        whether each invokedynamic's bootstrap method handle and static arguments are resolved
      • withHeader

        public DisassemblyOptions withHeader​(boolean header)
        Derives a copy with the header flag replaced.
        Parameters:
        header - whether to emit the max_stack/max_locals header line
        Returns:
        the derived options
      • withLineNumbers

        public DisassemblyOptions withLineNumbers​(boolean lineNumbers)
        Derives a copy with the line-number flag replaced.
        Parameters:
        lineNumbers - whether to interleave // line N comments
        Returns:
        the derived options
      • withLocalVariables

        public DisassemblyOptions withLocalVariables​(boolean localVariables)
        Derives a copy with the local-variable flag replaced.
        Parameters:
        localVariables - whether to annotate local-slot operands from the LocalVariableTable
        Returns:
        the derived options
      • withExceptionTable

        public DisassemblyOptions withExceptionTable​(boolean exceptionTable)
        Derives a copy with the exception-table flag replaced.
        Parameters:
        exceptionTable - whether to emit the method's exception table
        Returns:
        the derived options
      • withStackMapFrames

        public DisassemblyOptions withStackMapFrames​(boolean stackMapFrames)
        Derives a copy with the stack-map-frame flag replaced.
        Parameters:
        stackMapFrames - whether to interleave stack-map frame markers
        Returns:
        the derived options
      • withResolveBootstraps

        public DisassemblyOptions withResolveBootstraps​(boolean resolveBootstraps)
        Derives a copy with the bootstrap-resolution flag replaced.
        Parameters:
        resolveBootstraps - whether to resolve each invokedynamic's bootstrap handle and static arguments
        Returns:
        the derived options
      • terse

        public static DisassemblyOptions terse()
        Creates options with every enrichment disabled.
        Returns:
        the bare instruction-listing options
      • verbose

        public static DisassemblyOptions verbose()
        Creates options with every enrichment enabled.
        Returns:
        the fully enriched options