Search in sources :

Example 86 with RegisterSpecList

use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.

the class Form22b method compatibleRegs.

/**
 * {@inheritDoc}
 */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    BitSet bits = new BitSet(2);
    bits.set(0, unsignedFitsInByte(regs.get(0).getReg()));
    bits.set(1, unsignedFitsInByte(regs.get(1).getReg()));
    return bits;
}
Also used : BitSet(java.util.BitSet) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 87 with RegisterSpecList

use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.

the class Form22b method insnArgString.

/**
 * {@inheritDoc}
 */
@Override
public String insnArgString(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();
    return regs.get(0).regString() + ", " + regs.get(1).regString() + ", " + literalBitsString(value);
}
Also used : CstLiteralBits(com.android.dx.rop.cst.CstLiteralBits) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 88 with RegisterSpecList

use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.

the class Form22c method isCompatible.

/**
 * {@inheritDoc}
 */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof CstInsn) && (regs.size() == 2) && unsignedFitsInNibble(regs.get(0).getReg()) && unsignedFitsInNibble(regs.get(1).getReg()))) {
        return false;
    }
    CstInsn ci = (CstInsn) insn;
    int cpi = ci.getIndex();
    if (!unsignedFitsInShort(cpi)) {
        return false;
    }
    Constant cst = ci.getConstant();
    return (cst instanceof CstType) || (cst instanceof CstFieldRef);
}
Also used : CstInsn(com.android.dx.dex.code.CstInsn) Constant(com.android.dx.rop.cst.Constant) CstType(com.android.dx.rop.cst.CstType) CstFieldRef(com.android.dx.rop.cst.CstFieldRef) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 89 with RegisterSpecList

use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.

the class Form22s method compatibleRegs.

/**
 * {@inheritDoc}
 */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    BitSet bits = new BitSet(2);
    bits.set(0, unsignedFitsInNibble(regs.get(0).getReg()));
    bits.set(1, unsignedFitsInNibble(regs.get(1).getReg()));
    return bits;
}
Also used : BitSet(java.util.BitSet) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 90 with RegisterSpecList

use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.

the class Form22s method insnArgString.

/**
 * {@inheritDoc}
 */
@Override
public String insnArgString(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();
    return regs.get(0).regString() + ", " + regs.get(1).regString() + ", " + literalBitsString(value);
}
Also used : CstLiteralBits(com.android.dx.rop.cst.CstLiteralBits) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Aggregations

RegisterSpecList (com.android.dx.rop.code.RegisterSpecList)202 RegisterSpec (com.android.dx.rop.code.RegisterSpec)50 BitSet (java.util.BitSet)45 CstLiteralBits (com.android.dx.rop.cst.CstLiteralBits)42 Constant (com.android.dx.rop.cst.Constant)36 CstInsn (com.android.dx.dex.code.CstInsn)34 PlainInsn (com.android.dx.rop.code.PlainInsn)18 CstType (com.android.dx.rop.cst.CstType)12 TargetInsn (com.android.dx.dex.code.TargetInsn)10 Insn (com.android.dx.rop.code.Insn)10 TypedConstant (com.android.dx.rop.cst.TypedConstant)10 PlainCstInsn (com.android.dx.rop.code.PlainCstInsn)8 Rop (com.android.dx.rop.code.Rop)8 CstFieldRef (com.android.dx.rop.cst.CstFieldRef)8 CstMethodRef (com.android.dx.rop.cst.CstMethodRef)8 TypeBearer (com.android.dx.rop.type.TypeBearer)8 ThrowingCstInsn (com.android.dx.rop.code.ThrowingCstInsn)6 ThrowingInsn (com.android.dx.rop.code.ThrowingInsn)6 CstInteger (com.android.dx.rop.cst.CstInteger)6 MultiCstInsn (com.android.dx.dex.code.MultiCstInsn)4