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;
}
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);
}
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);
}
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;
}
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);
}
Aggregations