Search in sources :

Example 1 with TargetInsn

use of com.android.dx.dex.code.TargetInsn in project buck by facebook.

the class Form21t method isCompatible.

/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof TargetInsn) && (regs.size() == 1) && unsignedFitsInByte(regs.get(0).getReg()))) {
        return false;
    }
    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
Also used : TargetInsn(com.android.dx.dex.code.TargetInsn) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 2 with TargetInsn

use of com.android.dx.dex.code.TargetInsn in project buck by facebook.

the class Form21t method writeTo.

/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();
    write(out, opcodeUnit(insn, regs.get(0).getReg()), (short) offset);
}
Also used : TargetInsn(com.android.dx.dex.code.TargetInsn) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 3 with TargetInsn

use of com.android.dx.dex.code.TargetInsn in project buck by facebook.

the class Form22t method writeTo.

/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();
    write(out, opcodeUnit(insn, makeByte(regs.get(0).getReg(), regs.get(1).getReg())), (short) offset);
}
Also used : TargetInsn(com.android.dx.dex.code.TargetInsn) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 4 with TargetInsn

use of com.android.dx.dex.code.TargetInsn in project buck by facebook.

the class Form22t method isCompatible.

/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    if (!((insn instanceof TargetInsn) && (regs.size() == 2) && unsignedFitsInNibble(regs.get(0).getReg()) && unsignedFitsInNibble(regs.get(1).getReg()))) {
        return false;
    }
    TargetInsn ti = (TargetInsn) insn;
    return ti.hasTargetOffset() ? branchFits(ti) : true;
}
Also used : TargetInsn(com.android.dx.dex.code.TargetInsn) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Example 5 with TargetInsn

use of com.android.dx.dex.code.TargetInsn in project buck by facebook.

the class Form31t method writeTo.

/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
    RegisterSpecList regs = insn.getRegisters();
    int offset = ((TargetInsn) insn).getTargetOffset();
    write(out, opcodeUnit(insn, regs.get(0).getReg()), offset);
}
Also used : TargetInsn(com.android.dx.dex.code.TargetInsn) RegisterSpecList(com.android.dx.rop.code.RegisterSpecList)

Aggregations

TargetInsn (com.android.dx.dex.code.TargetInsn)5 RegisterSpecList (com.android.dx.rop.code.RegisterSpecList)5