Class InstructionSequenceReplacer.Label

  • Enclosing class:
    InstructionSequenceReplacer

    public static class InstructionSequenceReplacer.Label
    extends Instruction
    This pseudo-instruction represents a label that marks an instruction offset, for use in the context of the sequence replacer only.
    • Field Detail

      • identifier

        protected final int identifier
    • Method Detail

      • offset

        public int offset()
        Returns the offset that can then be used as a branch target in other replacement instructions.
      • shrink

        public Instruction shrink()
        Description copied from class: Instruction
        Shrinks this instruction to its shortest possible form.
        Specified by:
        shrink in class Instruction
        Returns:
        this instruction.
      • write

        public void write​(byte[] code,
                          int offset)
        Description copied from class: Instruction
        Writes the Instruction at the given offset in the given code array.
        Overrides:
        write in class Instruction
      • readInfo

        protected void readInfo​(byte[] code,
                                int offset)
        Description copied from class: Instruction
        Reads the data following the instruction opcode.
        Specified by:
        readInfo in class Instruction
      • writeInfo

        protected void writeInfo​(byte[] code,
                                 int offset)
        Description copied from class: Instruction
        Writes data following the instruction opcode.
        Specified by:
        writeInfo in class Instruction
      • length

        public int length​(int offset)
        Description copied from class: Instruction
        Returns the length in bytes of the instruction.
        Specified by:
        length in class Instruction
      • toString

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

        public boolean equals​(java.lang.Object o)
        Specified by:
        equals in class Instruction