use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.
the class Form22s 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;
Constant cst = ci.getConstant();
if (!(cst instanceof CstLiteralBits)) {
return false;
}
CstLiteralBits cb = (CstLiteralBits) cst;
return cb.fitsInInt() && signedFitsInShort(cb.getIntBits());
}
use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.
the class Form22s method writeTo.
/**
* {@inheritDoc}
*/
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
int value = ((CstLiteralBits) ((CstInsn) insn).getConstant()).getIntBits();
write(out, opcodeUnit(insn, makeByte(regs.get(0).getReg(), regs.get(1).getReg())), (short) value);
}
use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.
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.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.
the class Form22x 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, unsignedFitsInShort(regs.get(1).getReg()));
return bits;
}
use of com.android.dx.rop.code.RegisterSpecList in project J2ME-Loader by nikita36078.
the class Form31c method writeTo.
/**
* {@inheritDoc}
*/
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
int cpi = ((CstInsn) insn).getIndex();
write(out, opcodeUnit(insn, regs.get(0).getReg()), cpi);
}
Aggregations