本文整理汇总了Java中com.android.dx.dex.code.DalvInsn类的典型用法代码示例。如果您正苦于以下问题:Java DalvInsn类的具体用法?Java DalvInsn怎么用?Java DalvInsn使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DalvInsn类属于com.android.dx.dex.code包,在下文中一共展示了DalvInsn类的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() == 2) &&
unsignedFitsInByte(regs.get(0).getReg()) &&
unsignedFitsInByte(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() && signedFitsInByte(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() == 1) &&
unsignedFitsInByte(regs.get(0).getReg()))) {
return false;
}
CstInsn ci = (CstInsn) insn;
Constant cst = ci.getConstant();
if (!(cst instanceof CstLiteralBits)) {
return false;
}
return ((CstLiteralBits) cst).fitsInInt();
}
示例5: 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());
}
示例6: 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;
Constant cst = ci.getConstant();
if (!(cst instanceof CstLiteralBits)) {
return false;
}
CstLiteralBits cb = (CstLiteralBits) cst;
return cb.fitsInInt() && signedFitsInShort(cb.getIntBits());
}
示例7: 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);
boolean compat = unsignedFitsInByte(regs.get(0).getReg());
if (sz == 1) {
bits.set(0, compat);
} else {
if (regs.get(0).getReg() == regs.get(1).getReg()) {
bits.set(0, compat);
bits.set(1, compat);
}
}
return bits;
}
示例8: 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);
}
示例9: isCompatible
import com.android.dx.dex.code.DalvInsn; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
if (!(insn instanceof CstInsn)) {
return false;
}
CstInsn ci = (CstInsn) insn;
int cpi = ci.getIndex();
if (! unsignedFitsInShort(cpi)) {
return false;
}
Constant cst = ci.getConstant();
if (!((cst instanceof CstMethodRef) ||
(cst instanceof CstType))) {
return false;
}
RegisterSpecList regs = ci.getRegisters();
return (wordCount(regs) >= 0);
}
示例10: 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, unsignedFitsInNibble(regs.get(0).getReg()));
return bits;
}
示例11: 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;
}
示例12: writeTo
import com.android.dx.dex.code.DalvInsn; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
write(out,
opcodeUnit(insn, regs.get(0).getReg()),
(short) regs.get(1).getReg());
}
示例13: 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() + ", " + regs.get(1).regString() +
", " + branchString(insn);
}
示例14: 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);
}
示例15: isCompatible
import com.android.dx.dex.code.DalvInsn; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
if (!((insn instanceof TargetInsn) &&
(insn.getRegisters().size() == 0))) {
return false;
}
TargetInsn ti = (TargetInsn) insn;
return ti.hasTargetOffset() ? branchFits(ti) : true;
}