Java Code Examples for com.android.dx.rop.cst.CstType#LONG_ARRAY

The following examples show how to use com.android.dx.rop.cst.CstType#LONG_ARRAY . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ArrayData.java    From Box with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs an instance. The output address of this instance is initially
 * unknown ({@code -1}).
 *
 * @param position {@code non-null;} source position
 * @param user {@code non-null;} address representing the instruction that
 * uses this instance
 * @param values {@code non-null;} initial values to be filled into an array
 */
public ArrayData(SourcePosition position, CodeAddress user,
                 ArrayList<Constant> values,
                 Constant arrayType) {
    super(position, RegisterSpecList.EMPTY);

    if (user == null) {
        throw new NullPointerException("user == null");
    }

    if (values == null) {
        throw new NullPointerException("values == null");
    }

    int sz = values.size();

    if (sz <= 0) {
        throw new IllegalArgumentException("Illegal number of init values");
    }

    this.arrayType = arrayType;

    if (arrayType == CstType.BYTE_ARRAY ||
            arrayType == CstType.BOOLEAN_ARRAY) {
        elemWidth = 1;
    } else if (arrayType == CstType.SHORT_ARRAY ||
            arrayType == CstType.CHAR_ARRAY) {
        elemWidth = 2;
    } else if (arrayType == CstType.INT_ARRAY ||
            arrayType == CstType.FLOAT_ARRAY) {
        elemWidth = 4;
    } else if (arrayType == CstType.LONG_ARRAY ||
            arrayType == CstType.DOUBLE_ARRAY) {
        elemWidth = 8;
    } else {
        throw new IllegalArgumentException("Unexpected constant type");
    }
    this.user = user;
    this.values = values;
    initLength = values.size();
}
 
Example 2
Source File: ArrayData.java    From Box with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs an instance. The output address of this instance is initially
 * unknown ({@code -1}).
 *
 * @param position {@code non-null;} source position
 * @param user {@code non-null;} address representing the instruction that
 * uses this instance
 * @param values {@code non-null;} initial values to be filled into an array
 */
public ArrayData(SourcePosition position, CodeAddress user,
                 ArrayList<Constant> values,
                 Constant arrayType) {
    super(position, RegisterSpecList.EMPTY);

    if (user == null) {
        throw new NullPointerException("user == null");
    }

    if (values == null) {
        throw new NullPointerException("values == null");
    }

    int sz = values.size();

    if (sz <= 0) {
        throw new IllegalArgumentException("Illegal number of init values");
    }

    this.arrayType = arrayType;

    if (arrayType == CstType.BYTE_ARRAY ||
            arrayType == CstType.BOOLEAN_ARRAY) {
        elemWidth = 1;
    } else if (arrayType == CstType.SHORT_ARRAY ||
            arrayType == CstType.CHAR_ARRAY) {
        elemWidth = 2;
    } else if (arrayType == CstType.INT_ARRAY ||
            arrayType == CstType.FLOAT_ARRAY) {
        elemWidth = 4;
    } else if (arrayType == CstType.LONG_ARRAY ||
            arrayType == CstType.DOUBLE_ARRAY) {
        elemWidth = 8;
    } else {
        throw new IllegalArgumentException("Unexpected constant type");
    }
    this.user = user;
    this.values = values;
    initLength = values.size();
}
 
Example 3
Source File: ArrayData.java    From J2ME-Loader with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs an instance. The output address of this instance is initially
 * unknown ({@code -1}).
 *
 * @param position {@code non-null;} source position
 * @param user {@code non-null;} address representing the instruction that
 * uses this instance
 * @param values {@code non-null;} initial values to be filled into an array
 */
public ArrayData(SourcePosition position, CodeAddress user,
                 ArrayList<Constant> values,
                 Constant arrayType) {
    super(position, RegisterSpecList.EMPTY);

    if (user == null) {
        throw new NullPointerException("user == null");
    }

    if (values == null) {
        throw new NullPointerException("values == null");
    }

    int sz = values.size();

    if (sz <= 0) {
        throw new IllegalArgumentException("Illegal number of init values");
    }

    this.arrayType = arrayType;

    if (arrayType == CstType.BYTE_ARRAY ||
            arrayType == CstType.BOOLEAN_ARRAY) {
        elemWidth = 1;
    } else if (arrayType == CstType.SHORT_ARRAY ||
            arrayType == CstType.CHAR_ARRAY) {
        elemWidth = 2;
    } else if (arrayType == CstType.INT_ARRAY ||
            arrayType == CstType.FLOAT_ARRAY) {
        elemWidth = 4;
    } else if (arrayType == CstType.LONG_ARRAY ||
            arrayType == CstType.DOUBLE_ARRAY) {
        elemWidth = 8;
    } else {
        throw new IllegalArgumentException("Unexpected constant type");
    }
    this.user = user;
    this.values = values;
    initLength = values.size();
}
 
Example 4
Source File: ArrayData.java    From buck with Apache License 2.0 4 votes vote down vote up
/**
 * Constructs an instance. The output address of this instance is initially
 * unknown ({@code -1}).
 *
 * @param position {@code non-null;} source position
 * @param user {@code non-null;} address representing the instruction that
 * uses this instance
 * @param values {@code non-null;} initial values to be filled into an array
 */
public ArrayData(SourcePosition position, CodeAddress user,
                 ArrayList<Constant> values,
                 Constant arrayType) {
    super(position, RegisterSpecList.EMPTY);

    if (user == null) {
        throw new NullPointerException("user == null");
    }

    if (values == null) {
        throw new NullPointerException("values == null");
    }

    int sz = values.size();

    if (sz <= 0) {
        throw new IllegalArgumentException("Illegal number of init values");
    }

    this.arrayType = arrayType;

    if (arrayType == CstType.BYTE_ARRAY ||
            arrayType == CstType.BOOLEAN_ARRAY) {
        elemWidth = 1;
    } else if (arrayType == CstType.SHORT_ARRAY ||
            arrayType == CstType.CHAR_ARRAY) {
        elemWidth = 2;
    } else if (arrayType == CstType.INT_ARRAY ||
            arrayType == CstType.FLOAT_ARRAY) {
        elemWidth = 4;
    } else if (arrayType == CstType.LONG_ARRAY ||
            arrayType == CstType.DOUBLE_ARRAY) {
        elemWidth = 8;
    } else {
        throw new IllegalArgumentException("Unexpected constant type");
    }
    this.user = user;
    this.values = values;
    initLength = values.size();
}