com.android.dx.dex.code.SimpleInsn Java Examples

The following examples show how to use com.android.dx.dex.code.SimpleInsn. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Form32x.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInShort(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #2
Source File: Form12x.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!(insn instanceof SimpleInsn)) {
        return false;
    }

    RegisterSpecList regs = insn.getRegisters();
    RegisterSpec rs1;
    RegisterSpec rs2;

    switch (regs.size()) {
        case 2: {
            rs1 = regs.get(0);
            rs2 = regs.get(1);
            break;
        }
        case 3: {
            /*
             * This format is allowed for ops that are effectively
             * 3-arg but where the first two args are identical.
             */
            rs1 = regs.get(1);
            rs2 = regs.get(2);
            if (rs1.getReg() != regs.get(0).getReg()) {
                return false;
            }
            break;
        }
        default: {
            return false;
        }
    }

    return unsignedFitsInNibble(rs1.getReg()) &&
        unsignedFitsInNibble(rs2.getReg());
}
 
Example #3
Source File: Form23x.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 3) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInByte(regs.get(1).getReg()) &&
        unsignedFitsInByte(regs.get(2).getReg());
}
 
Example #4
Source File: Form22x.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #5
Source File: Form11x.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 1) &&
        unsignedFitsInByte(regs.get(0).getReg());
}
 
Example #6
Source File: Form32x.java    From buck with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInShort(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #7
Source File: Form12x.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!(insn instanceof SimpleInsn)) {
        return false;
    }

    RegisterSpecList regs = insn.getRegisters();
    RegisterSpec rs1;
    RegisterSpec rs2;

    switch (regs.size()) {
        case 2: {
            rs1 = regs.get(0);
            rs2 = regs.get(1);
            break;
        }
        case 3: {
            /*
             * This format is allowed for ops that are effectively
             * 3-arg but where the first two args are identical.
             */
            rs1 = regs.get(1);
            rs2 = regs.get(2);
            if (rs1.getReg() != regs.get(0).getReg()) {
                return false;
            }
            break;
        }
        default: {
            return false;
        }
    }

    return unsignedFitsInNibble(rs1.getReg()) &&
        unsignedFitsInNibble(rs2.getReg());
}
 
Example #8
Source File: Form23x.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 3) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInByte(regs.get(1).getReg()) &&
        unsignedFitsInByte(regs.get(2).getReg());
}
 
Example #9
Source File: Form22x.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #10
Source File: Form11x.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 1) &&
        unsignedFitsInByte(regs.get(0).getReg());
}
 
Example #11
Source File: Form32x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInShort(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #12
Source File: Form12x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!(insn instanceof SimpleInsn)) {
        return false;
    }

    RegisterSpecList regs = insn.getRegisters();
    RegisterSpec rs1;
    RegisterSpec rs2;

    switch (regs.size()) {
        case 2: {
            rs1 = regs.get(0);
            rs2 = regs.get(1);
            break;
        }
        case 3: {
            /*
             * This format is allowed for ops that are effectively
             * 3-arg but where the first two args are identical.
             */
            rs1 = regs.get(1);
            rs2 = regs.get(2);
            if (rs1.getReg() != regs.get(0).getReg()) {
                return false;
            }
            break;
        }
        default: {
            return false;
        }
    }

    return unsignedFitsInNibble(rs1.getReg()) &&
        unsignedFitsInNibble(rs2.getReg());
}
 
Example #13
Source File: Form23x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 3) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInByte(regs.get(1).getReg()) &&
        unsignedFitsInByte(regs.get(2).getReg());
}
 
Example #14
Source File: Form22x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #15
Source File: Form11x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 1) &&
        unsignedFitsInByte(regs.get(0).getReg());
}
 
Example #16
Source File: Form32x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInShort(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #17
Source File: Form12x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    if (!(insn instanceof SimpleInsn)) {
        return false;
    }

    RegisterSpecList regs = insn.getRegisters();
    RegisterSpec rs1;
    RegisterSpec rs2;

    switch (regs.size()) {
        case 2: {
            rs1 = regs.get(0);
            rs2 = regs.get(1);
            break;
        }
        case 3: {
            /*
             * This format is allowed for ops that are effectively
             * 3-arg but where the first two args are identical.
             */
            rs1 = regs.get(1);
            rs2 = regs.get(2);
            if (rs1.getReg() != regs.get(0).getReg()) {
                return false;
            }
            break;
        }
        default: {
            return false;
        }
    }

    return unsignedFitsInNibble(rs1.getReg()) &&
        unsignedFitsInNibble(rs2.getReg());
}
 
Example #18
Source File: Form23x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 3) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInByte(regs.get(1).getReg()) &&
        unsignedFitsInByte(regs.get(2).getReg());
}
 
Example #19
Source File: Form22x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();

    return (insn instanceof SimpleInsn) &&
        (regs.size() == 2) &&
        unsignedFitsInByte(regs.get(0).getReg()) &&
        unsignedFitsInShort(regs.get(1).getReg());
}
 
Example #20
Source File: Form11x.java    From Box with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    return (insn instanceof SimpleInsn) &&
        (regs.size() == 1) &&
        unsignedFitsInByte(regs.get(0).getReg());
}
 
Example #21
Source File: Form10x.java    From J2ME-Loader with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    return (insn instanceof SimpleInsn) &&
        (insn.getRegisters().size() == 0);
}
 
Example #22
Source File: Form10x.java    From Box with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    return (insn instanceof SimpleInsn) &&
        (insn.getRegisters().size() == 0);
}
 
Example #23
Source File: Form10x.java    From buck with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    return (insn instanceof SimpleInsn) &&
        (insn.getRegisters().size() == 0);
}
 
Example #24
Source File: Form10x.java    From Box with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    return (insn instanceof SimpleInsn) &&
        (insn.getRegisters().size() == 0);
}