MCPcopy Create free account
hub / github.com/Youlor/unpacker / opFilledNewArray

Method opFilledNewArray

dexfixer/src/com/android/dx/rop/code/Rops.java:1873–1895  ·  view source on GitHub ↗

Returns the appropriate filled-new-array rop for the given type. The result may be a shared instance. @param arrayType non-null; type of array being created @param count count >= 0; number of elements that the array should have @return non-null; an appropriate instan

(TypeBearer arrayType, int count)

Source from the content-addressed store, hash-verified

1871 * @return {@code non-null;} an appropriate instance
1872 */
1873 public static Rop opFilledNewArray(TypeBearer arrayType, int count) {
1874 Type type = arrayType.getType();
1875 Type elementType = type.getComponentType();
1876
1877 if (elementType.isCategory2()) {
1878 return throwBadType(arrayType);
1879 }
1880
1881 if (count < 0) {
1882 throw new IllegalArgumentException("count < 0");
1883 }
1884
1885 StdTypeList sourceTypes = new StdTypeList(count);
1886
1887 for (int i = 0; i < count; i++) {
1888 sourceTypes.set(i, elementType);
1889 }
1890
1891 // Note: The resulting rop is considered call-like.
1892 return new Rop(RegOps.FILLED_NEW_ARRAY,
1893 sourceTypes,
1894 Exceptions.LIST_Error);
1895 }
1896
1897 /**
1898 * Returns the appropriate {@code get-field} rop for the given

Callers 1

runMethod · 0.95

Calls 5

getComponentTypeMethod · 0.95
isCategory2Method · 0.95
throwBadTypeMethod · 0.95
setMethod · 0.95
getTypeMethod · 0.65

Tested by

no test coverage detected