public static Rop opNewArray(TypeBearer arrayType) {
    Type type = arrayType.getType();
    Type elementType = type.getComponentType();

    switch (elementType.getBasicType()) {
      case Type.BT_INT:
        return NEW_ARRAY_INT;
      case Type.BT_LONG:
        return NEW_ARRAY_LONG;
      case Type.BT_FLOAT:
        return NEW_ARRAY_FLOAT;
      case Type.BT_DOUBLE:
        return NEW_ARRAY_DOUBLE;
      case Type.BT_BOOLEAN:
        return NEW_ARRAY_BOOLEAN;
      case Type.BT_BYTE:
        return NEW_ARRAY_BYTE;
      case Type.BT_CHAR:
        return NEW_ARRAY_CHAR;
      case Type.BT_SHORT:
        return NEW_ARRAY_SHORT;
      case Type.BT_OBJECT:
        {
          return new Rop(
              RegOps.NEW_ARRAY,
              type,
              StdTypeList.INT,
              Exceptions.LIST_Error_NegativeArraySizeException,
              "new-array-object");
        }
    }

    return throwBadType(type);
  }
Returns the appropriate {@code new-array} rop for the given type. The result is a shared
instance.

@param arrayType {@code non-null;} array type of array being created
@return {@code non-null;} an appropriate instance
android/android_framework/dex-maker/src/main/java/com/android/dx/rop/code/Rops.java