@Override
    public void encode(DecodedInstruction insn, CodeOutput out) {
      InvokePolymorphicDecodedInstruction polyInsn = (InvokePolymorphicDecodedInstruction) insn;
      out.write(
          codeUnit(polyInsn.getOpcode(), makeByte(polyInsn.getG(), polyInsn.getRegisterCount())),
          polyInsn.getIndexUnit(),
          codeUnit(polyInsn.getC(), polyInsn.getD(), polyInsn.getE(), polyInsn.getF()),
          polyInsn.getProtoIndex());
    }
Representation of an instruction format, which knows how to decode into and encode from instances
of {@link DecodedInstruction}.
android/android_framework/dex-maker/src/main/java/com/android/dx/io/instructions/InstructionCodec.java