private void insertThrowingInsnBefore(
      SsaInsn insn,
      RegisterSpecList newSources,
      RegisterSpec newResult,
      int newOpcode,
      Constant cst) {

    Insn origRopInsn = insn.getOriginalRopInsn();
    Rop newRop = Rops.ropFor(newOpcode, newResult, newSources, cst);
    Insn newRopInsn;
    if (cst == null) {
      newRopInsn =
          new ThrowingInsn(newRop, origRopInsn.getPosition(), newSources, StdTypeList.EMPTY);
    } else {
      newRopInsn =
          new ThrowingCstInsn(
              newRop, origRopInsn.getPosition(), newSources, StdTypeList.EMPTY, cst);
    }

    NormalSsaInsn newInsn = new NormalSsaInsn(newRopInsn, insn.getBlock());
    List<SsaInsn> insns = insn.getBlock().getInsns();

    insns.add(insns.lastIndexOf(insn), newInsn);
    ssaMeth.onInsnAdded(newInsn);
  }
Inserts a new ThrowingInsn before the given instruction. TODO: move this somewhere more
appropriate

@param insn {@code non-null;} instruction to insert before
@param newSources {@code non-null;} sources of new instruction
@param newResult {@code non-null;} result of new instruction
@param newOpcode opcode of new instruction
@param cst {@code null-ok;} constant for new instruction, if any
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/EscapeAnalysis.java