Methods Summary |
---|
public boolean | branchFits(com.android.dx.dex.code.TargetInsn insn){@inheritDoc}
int offset = insn.getTargetOffset();
// Note: A zero offset would fit, but it is prohibited by the spec.
return (offset != 0) && signedFitsInShort(offset);
|
public int | codeSize(){@inheritDoc}
return 2;
|
public java.util.BitSet | compatibleRegs(com.android.dx.dex.code.DalvInsn insn){@inheritDoc}
RegisterSpecList regs = insn.getRegisters();
BitSet bits = new BitSet(2);
bits.set(0, unsignedFitsInNibble(regs.get(0).getReg()));
bits.set(1, unsignedFitsInNibble(regs.get(1).getReg()));
return bits;
|
public java.lang.String | insnArgString(com.android.dx.dex.code.DalvInsn insn){@inheritDoc}
RegisterSpecList regs = insn.getRegisters();
return regs.get(0).regString() + ", " + regs.get(1).regString() +
", " + branchString(insn);
|
public java.lang.String | insnCommentString(com.android.dx.dex.code.DalvInsn insn, boolean noteIndices){@inheritDoc}
return branchComment(insn);
|
public boolean | isCompatible(com.android.dx.dex.code.DalvInsn insn){@inheritDoc}
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;
|
public void | writeTo(com.android.dx.util.AnnotatedOutput out, com.android.dx.dex.code.DalvInsn insn){@inheritDoc}
RegisterSpecList regs = insn.getRegisters();
int offset = ((TargetInsn) insn).getTargetOffset();
write(out,
opcodeUnit(insn,
makeByte(regs.get(0).getReg(), regs.get(1).getReg())),
(short) offset);
|