Search in sources :

Example 21 with CstMethodRef

use of com.android.dx.rop.cst.CstMethodRef in project J2ME-Loader by nikita36078.

the class Form3rc method isCompatible.

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

Aggregations

CstMethodRef (com.android.dx.rop.cst.CstMethodRef)21 CstType (com.android.dx.rop.cst.CstType)19 Constant (com.android.dx.rop.cst.Constant)15 CstFieldRef (com.android.dx.rop.cst.CstFieldRef)9 RegisterSpecList (com.android.dx.rop.code.RegisterSpecList)8 CstString (com.android.dx.rop.cst.CstString)8 CstNat (com.android.dx.rop.cst.CstNat)6 CstInsn (com.android.dx.dex.code.CstInsn)4 Annotations (com.android.dx.rop.annotation.Annotations)4 RegisterSpec (com.android.dx.rop.code.RegisterSpec)4 CstInterfaceMethodRef (com.android.dx.rop.cst.CstInterfaceMethodRef)4 AttEnclosingMethod (com.android.dx.cf.attrib.AttEnclosingMethod)2 ConcreteMethod (com.android.dx.cf.code.ConcreteMethod)2 Method (com.android.dx.cf.iface.Method)2 MethodList (com.android.dx.cf.iface.MethodList)2 ParseException (com.android.dx.cf.iface.ParseException)2 DalvCode (com.android.dx.dex.code.DalvCode)2 MultiCstInsn (com.android.dx.dex.code.MultiCstInsn)2 ClassDefItem (com.android.dx.dex.file.ClassDefItem)2 EncodedMethod (com.android.dx.dex.file.EncodedMethod)2