本文整理汇总了Java中com.android.dx.dex.code.DalvInsn.getRegisters方法的典型用法代码示例。如果您正苦于以下问题:Java DalvInsn.getRegisters方法的具体用法?Java DalvInsn.getRegisters怎么用?Java DalvInsn.getRegisters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.dx.dex.code.DalvInsn
的用法示例。
在下文中一共展示了DalvInsn.getRegisters方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeTo
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
CstLiteralBits cb = (CstLiteralBits) ((CstInsn) insn).getConstant();
short bits;
// Where the high bits are depends on the category of the target.
if (regs.get(0).getCategory() == 1) {
bits = (short) (cb.getIntBits() >>> 16);
} else {
bits = (short) (cb.getLongBits() >>> 48);
}
write(out, opcodeUnit(insn, regs.get(0).getReg()), bits);
}
示例2: isCompatible
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
if (!((insn instanceof CstInsn) &&
(regs.size() == 1) &&
unsignedFitsInNibble(regs.get(0).getReg()))) {
return false;
}
CstInsn ci = (CstInsn) insn;
Constant cst = ci.getConstant();
if (!(cst instanceof CstLiteralBits)) {
return false;
}
CstLiteralBits cb = (CstLiteralBits) cst;
return cb.fitsInInt() && signedFitsInNibble(cb.getIntBits());
}
示例3: compatibleRegs
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
int sz = regs.size();
BitSet bits = new BitSet(sz);
for (int i = 0; i < sz; i++) {
RegisterSpec reg = regs.get(i);
/*
* The check below adds (category - 1) to the register, to
* account for the fact that the second half of a
* category-2 register has to be represented explicitly in
* the result.
*/
bits.set(i, unsignedFitsInNibble(reg.getReg() +
reg.getCategory() - 1));
}
return bits;
}
示例4: isCompatible
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@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;
int cpi = ci.getIndex();
if (! unsignedFitsInShort(cpi)) {
return false;
}
Constant cst = ci.getConstant();
return (cst instanceof CstType) ||
(cst instanceof CstFieldRef);
}
示例5: writeTo
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@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()),
(short) cpi);
}
示例6: compatibleRegs
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
BitSet bits = new BitSet(2);
int r0 = regs.get(0).getReg();
int r1 = regs.get(1).getReg();
switch (regs.size()) {
case 2: {
bits.set(0, unsignedFitsInNibble(r0));
bits.set(1, unsignedFitsInNibble(r1));
break;
}
case 3: {
if (r0 != r1) {
bits.set(0, false);
bits.set(1, false);
} else {
boolean dstRegComp = unsignedFitsInNibble(r1);
bits.set(0, dstRegComp);
bits.set(1, dstRegComp);
}
bits.set(2, unsignedFitsInNibble(regs.get(2).getReg()));
break;
}
default: {
throw new AssertionError();
}
}
return bits;
}
示例7: compatibleRegs
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
BitSet bits = new BitSet(1);
bits.set(0, unsignedFitsInByte(regs.get(0).getReg()));
return bits;
}
示例8: isCompatible
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
return (insn instanceof SimpleInsn) &&
(regs.size() == 1) &&
unsignedFitsInByte(regs.get(0).getReg());
}
示例9: compatibleRegs
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
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;
}
示例10: isCompatible
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
return (insn instanceof SimpleInsn) &&
(regs.size() == 3) &&
unsignedFitsInByte(regs.get(0).getReg()) &&
unsignedFitsInByte(regs.get(1).getReg()) &&
unsignedFitsInByte(regs.get(2).getReg());
}
示例11: writeTo
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@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(), value & 0xf)));
}
示例12: writeTo
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@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);
}
示例13: insnArgString
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public String insnArgString(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();
return regs.get(0).regString() + ", " + literalBitsString(value);
}
示例14: writeTo
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
long value =
((CstLiteral64) ((CstInsn) insn).getConstant()).getLongBits();
write(out, opcodeUnit(insn, regs.get(0).getReg()), value);
}
示例15: insnArgString
import com.android.dx.dex.code.DalvInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public String insnArgString(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
return regs.get(0).regString() + ", " + branchString(insn);
}