Class ZeroSizeInsn

java.lang.Object
com.android.dx.dex.code.DalvInsn
com.android.dx.dex.code.ZeroSizeInsn
Direct Known Subclasses:
CodeAddress, LocalSnapshot, LocalStart

public abstract class ZeroSizeInsn extends DalvInsn
Pseudo-instruction base class for zero-size (no code emitted) instructions, which are generally used for tracking metainformation about the code they are adjacent to.
  • Constructor Details

    • ZeroSizeInsn

      public ZeroSizeInsn(SourcePosition position)
      Constructs an instance. The output address of this instance is initially unknown (-1).
      Parameters:
      position - non-null; source position
  • Method Details

    • codeSize

      public final int codeSize()
      Gets the size of this instruction, in 16-bit code units.
      Specified by:
      codeSize in class DalvInsn
      Returns:
      >= 0; the code size of this instruction
    • writeTo

      public final void writeTo(AnnotatedOutput out)
      Writes this instance to the given output. This method should never annotate the output.
      Specified by:
      writeTo in class DalvInsn
      Parameters:
      out - non-null; where to write to
    • withOpcode

      public final DalvInsn withOpcode(Dop opcode)
      Returns an instance that is just like this one, except that its opcode is replaced by the one given, and its address is reset.
      Specified by:
      withOpcode in class DalvInsn
      Parameters:
      opcode - non-null; the new opcode
      Returns:
      non-null; an appropriately-constructed instance
    • withRegisterOffset

      public DalvInsn withRegisterOffset(int delta)
      Returns an instance that is just like this one, except that all register references have been offset by the given delta, and its address is reset.
      Specified by:
      withRegisterOffset in class DalvInsn
      Parameters:
      delta - the amount to offset register references by
      Returns:
      non-null; an appropriately-constructed instance