本文整理汇总了Java中com.android.dx.dex.code.CstInsn.getIndex方法的典型用法代码示例。如果您正苦于以下问题:Java CstInsn.getIndex方法的具体用法?Java CstInsn.getIndex怎么用?Java CstInsn.getIndex使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.android.dx.dex.code.CstInsn
的用法示例。
在下文中一共展示了CstInsn.getIndex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isCompatible
import com.android.dx.dex.code.CstInsn; //导入方法依赖的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);
}
示例2: isCompatible
import com.android.dx.dex.code.CstInsn; //导入方法依赖的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);
}
示例3: isCompatible
import com.android.dx.dex.code.CstInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
if (!(insn instanceof CstInsn)) {
return false;
}
CstInsn ci = (CstInsn) insn;
int cpi = ci.getIndex();
Constant cst = ci.getConstant();
if (! unsignedFitsInShort(cpi)) {
return false;
}
if (!((cst instanceof CstMethodRef) ||
(cst instanceof CstType))) {
return false;
}
RegisterSpecList regs = ci.getRegisters();
int sz = regs.size();
return (regs.size() == 0) ||
(isRegListSequential(regs) &&
unsignedFitsInShort(regs.get(0).getReg()) &&
unsignedFitsInByte(regs.getWordCount()));
}
示例4: isCompatible
import com.android.dx.dex.code.CstInsn; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
public boolean isCompatible(DalvInsn insn) {
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();
Constant cst = ci.getConstant();
if (! unsignedFitsInShort(cpi)) {
return false;
}
return (cst instanceof CstType) ||
(cst instanceof CstFieldRef) ||
(cst instanceof CstString);
}