Search in sources :

Example 1 with CstMemberRef

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

the class OutputFinisher method assignIndices.

/**
     * Helper for {@link #assignIndices} which does assignment for one
     * instruction.
     *
     * @param insn {@code non-null;} the instruction
     * @param callback {@code non-null;} the callback
     */
private static void assignIndices(CstInsn insn, DalvCode.AssignIndicesCallback callback) {
    Constant cst = insn.getConstant();
    int index = callback.getIndex(cst);
    if (index >= 0) {
        insn.setIndex(index);
    }
    if (cst instanceof CstMemberRef) {
        CstMemberRef member = (CstMemberRef) cst;
        CstType definer = member.getDefiningClass();
        index = callback.getIndex(definer);
        if (index >= 0) {
            insn.setClassIndex(index);
        }
    }
}
Also used : CstMemberRef(com.taobao.android.dx.rop.cst.CstMemberRef) Constant(com.taobao.android.dx.rop.cst.Constant) CstType(com.taobao.android.dx.rop.cst.CstType)

Aggregations

Constant (com.taobao.android.dx.rop.cst.Constant)1 CstMemberRef (com.taobao.android.dx.rop.cst.CstMemberRef)1 CstType (com.taobao.android.dx.rop.cst.CstType)1