private void anyArrayCheck(Class cls) {
    if (cls == boolean[].class) {
      assert debug("CHECKCAST [Z");
      mv.visitTypeInsn(CHECKCAST, "[Z");
    }
    else if (cls == int[].class) {
      assert debug("CHECKCAST [I");
      mv.visitTypeInsn(CHECKCAST, "[I");
    }
    else if (cls == float[].class) {
      assert debug("CHECKCAST [F");
      mv.visitTypeInsn(CHECKCAST, "[F");
    }
    else if (cls == double[].class) {
      assert debug("CHECKCAST [D");
      mv.visitTypeInsn(CHECKCAST, "[D");
    }
    else if (cls == short[].class) {
      assert debug("CHECKCAST [S");
      mv.visitTypeInsn(CHECKCAST, "[S");
    }
    else if (cls == long[].class) {
      assert debug("CHECKCAST [J");
      mv.visitTypeInsn(CHECKCAST, "[J");
    }
    else if (cls == byte[].class) {
      assert debug("CHECKCAST [B");
      mv.visitTypeInsn(CHECKCAST, "[B");
    }
    else if (cls == char[].class) {
      assert debug("CHECKCAST [C");
      mv.visitTypeInsn(CHECKCAST, "[C");
    }
    else {
      assert debug("CHECKCAST [Ljava/lang/Object;");
      mv.visitTypeInsn(CHECKCAST, "[Ljava/lang/Object;");
    }
  }