Methods Summary |
---|
public int | codeSize(){@inheritDoc}
return 2;
|
public java.lang.String | insnArgString(com.android.dexgen.dex.code.DalvInsn insn){@inheritDoc}
RegisterSpecList regs = insn.getRegisters();
return regs.get(0).regString() + ", " + cstString(insn);
|
public java.lang.String | insnCommentString(com.android.dexgen.dex.code.DalvInsn insn, boolean noteIndices){@inheritDoc}
if (noteIndices) {
return cstComment(insn);
} else {
return "";
}
|
public boolean | isCompatible(com.android.dexgen.dex.code.DalvInsn insn){@inheritDoc}
if (!(insn instanceof CstInsn)) {
return false;
}
RegisterSpecList regs = insn.getRegisters();
RegisterSpec reg;
switch (regs.size()) {
case 1: {
reg = regs.get(0);
break;
}
case 2: {
/*
* This format is allowed for ops that are effectively
* 2-arg but where the two args are identical.
*/
reg = regs.get(0);
if (reg.getReg() != regs.get(1).getReg()) {
return false;
}
break;
}
default: {
return false;
}
}
if (!unsignedFitsInByte(reg.getReg())) {
return false;
}
CstInsn ci = (CstInsn) insn;
int cpi = ci.getIndex();
if (! unsignedFitsInShort(cpi)) {
return false;
}
Constant cst = ci.getConstant();
return (cst instanceof CstType) ||
(cst instanceof CstFieldRef) ||
(cst instanceof CstString);
|
public com.android.dexgen.dex.code.InsnFormat | nextUp(){@inheritDoc}
return Form31c.THE_ONE;
|
public void | writeTo(com.android.dexgen.util.AnnotatedOutput out, com.android.dexgen.dex.code.DalvInsn insn){@inheritDoc}
RegisterSpecList regs = insn.getRegisters();
int cpi = ((CstInsn) insn).getIndex();
write(out,
opcodeUnit(insn, regs.get(0).getReg()),
(short) cpi);
|