Search in sources :

Example 16 with CstInsn

use of com.taobao.android.dx.dex.code.CstInsn in project atlas by alibaba.

the class Form3rc method writeTo.

/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int cpi = ((CstInsn) insn).getIndex();
    int firstReg = (regs.size() == 0) ? 0 : regs.get(0).getReg();
    int count = regs.getWordCount();
    write(out, opcodeUnit(insn, count), (short) cpi, (short) firstReg);
}
Also used : CstInsn(com.taobao.android.dx.dex.code.CstInsn) RegisterSpecList(com.taobao.android.dx.rop.code.RegisterSpecList)

Example 17 with CstInsn

use of com.taobao.android.dx.dex.code.CstInsn in project atlas by alibaba.

the class Form51l method isCompatible.

/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof CstInsn) && (regs.size() == 1) && unsignedFitsInByte(regs.get(0).getReg()))) {
        return false;
    }
    CstInsn ci = (CstInsn) insn;
    Constant cst = ci.getConstant();
    return (cst instanceof CstLiteral64);
}
Also used : CstInsn(com.taobao.android.dx.dex.code.CstInsn) Constant(com.taobao.android.dx.rop.cst.Constant) CstLiteral64(com.taobao.android.dx.rop.cst.CstLiteral64) RegisterSpecList(com.taobao.android.dx.rop.code.RegisterSpecList)

Aggregations

CstInsn (com.taobao.android.dx.dex.code.CstInsn)17 RegisterSpecList (com.taobao.android.dx.rop.code.RegisterSpecList)17 Constant (com.taobao.android.dx.rop.cst.Constant)12 CstLiteralBits (com.taobao.android.dx.rop.cst.CstLiteralBits)6 CstType (com.taobao.android.dx.rop.cst.CstType)5 CstFieldRef (com.taobao.android.dx.rop.cst.CstFieldRef)3 RegisterSpec (com.taobao.android.dx.rop.code.RegisterSpec)2 CstMethodRef (com.taobao.android.dx.rop.cst.CstMethodRef)2 CstString (com.taobao.android.dx.rop.cst.CstString)2 CstLiteral64 (com.taobao.android.dx.rop.cst.CstLiteral64)1