Search in sources :

Example 1 with CstBaseMethodRef

use of com.taobao.android.dx.rop.cst.CstBaseMethodRef in project atlas by alibaba.

the class DalvInsnList method getOutsSize.

/**
     * Gets the size of the outgoing arguments area required by this
     * method. This is equal to the largest argument word count of any
     * method referred to by this instance.
     *
     * @return {@code >= 0;} the required outgoing arguments size
     */
public int getOutsSize() {
    int sz = size();
    int result = 0;
    for (int i = 0; i < sz; i++) {
        DalvInsn insn = (DalvInsn) get0(i);
        if (!(insn instanceof CstInsn)) {
            continue;
        }
        Constant cst = ((CstInsn) insn).getConstant();
        if (!(cst instanceof CstBaseMethodRef)) {
            continue;
        }
        boolean isStatic = (insn.getOpcode().getFamily() == Opcodes.INVOKE_STATIC);
        int count = ((CstBaseMethodRef) cst).getParameterWordCount(isStatic);
        if (count > result) {
            result = count;
        }
    }
    return result;
}
Also used : CstBaseMethodRef(com.taobao.android.dx.rop.cst.CstBaseMethodRef) Constant(com.taobao.android.dx.rop.cst.Constant)

Aggregations

Constant (com.taobao.android.dx.rop.cst.Constant)1 CstBaseMethodRef (com.taobao.android.dx.rop.cst.CstBaseMethodRef)1