Class SimpleInsn


public final class SimpleInsn extends FixedSizeInsn
Instruction which has no extra info beyond the basics provided for in the base class.
  • Constructor Details

    • SimpleInsn

      public SimpleInsn(Dop opcode, SourcePosition position, RegisterSpecList registers)
      Constructs an instance. The output address of this instance is initially unknown (-1).
      Parameters:
      opcode - the opcode; one of the constants from Dops
      position - non-null; source position
      registers - non-null; register list, including a result register if appropriate (that is, registers may be either ins or outs)
  • Method Details

    • withOpcode

      public 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
    • withRegisters

      public DalvInsn withRegisters(RegisterSpecList registers)
      Returns an instance that is just like this one, except that the register list is replaced by the given one, and its address is reset.
      Specified by:
      withRegisters in class DalvInsn
      Parameters:
      registers - non-null; new register list
      Returns:
      non-null; an appropriately-constructed instance
    • argString

      protected String argString()
      Gets the string form for any arguments to this instance. Subclasses must override this.
      Specified by:
      argString in class DalvInsn
      Returns:
      null-ok; the string version of any arguments or null if there are none