Class ClassFile.InstructionIndex

  • Enclosing class:
    ClassFile

    private static class ClassFile.InstructionIndex
    extends java.lang.Object
    The index of a bytecode instruction. This index is computed in toString(), from the bytecode offset of the instruction, after the whole class has been parsed. Indeed, due to forward references, the index of an instruction might not be known when its offset is used.

    Dumps use instruction indices instead of bytecode offsets in order to abstract away the low level byte code instruction representation details (e.g. an ldc vs. an ldc_w).

    • Field Detail

      • bytecodeOffset

        private final int bytecodeOffset
        An offset in bytes from the start of the bytecode of a method.
      • methodContext

        private final ClassFile.MethodContext methodContext
        The context to use to find the index from the bytecode offset.
    • Method Detail

      • getBytecodeOffset

        int getBytecodeOffset()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object