本文整理汇总了Java中com.ibm.wala.util.intset.OrdinalSetMapping类的典型用法代码示例。如果您正苦于以下问题:Java OrdinalSetMapping类的具体用法?Java OrdinalSetMapping怎么用?Java OrdinalSetMapping使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OrdinalSetMapping类属于com.ibm.wala.util.intset包,在下文中一共展示了OrdinalSetMapping类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: numberPutStatics
import com.ibm.wala.util.intset.OrdinalSetMapping; //导入依赖的package包/类
/**
* generate a numbering of the putstatic instructions
*/
private OrdinalSetMapping<Integer> numberPutStatics() {
ArrayList<Integer> putInstrs = new ArrayList<Integer>();
IR ir = ecfg.getIR();
SSAInstruction[] instructions = ir.getInstructions();
for (int i = 0; i < instructions.length; i++) {
SSAInstruction instruction = instructions[i];
if (instruction instanceof SSAPutInstruction && ((SSAPutInstruction) instruction).isStatic()) {
SSAPutInstruction putInstr = (SSAPutInstruction) instruction;
// instrNum is the number that will be assigned to this putstatic
int instrNum = putInstrs.size();
putInstrs.add(i);
// also update the mapping of static fields to def'ing statements
IField field = cha.resolveField(putInstr.getDeclaredField());
assert field != null;
BitVector bv = staticField2DefStatements.get(field);
if (bv == null) {
bv = new BitVector();
staticField2DefStatements.put(field, bv);
}
bv.set(instrNum);
}
}
return new ObjectArrayMapping<Integer>(putInstrs.toArray(new Integer[putInstrs.size()]));
}
示例2: numberPutStatics
import com.ibm.wala.util.intset.OrdinalSetMapping; //导入依赖的package包/类
/**
* generate a numbering of the putstatic instructions
*/
@SuppressWarnings("unchecked")
private OrdinalSetMapping<Pair<CGNode, Integer>> numberPutStatics() {
ArrayList<Pair<CGNode, Integer>> putInstrs = new ArrayList<Pair<CGNode, Integer>>();
for (CGNode node : icfg.getCallGraph()) {
IR ir = node.getIR();
if (ir == null) {
continue;
}
SSAInstruction[] instructions = ir.getInstructions();
for (int i = 0; i < instructions.length; i++) {
SSAInstruction instruction = instructions[i];
if (instruction instanceof SSAPutInstruction && ((SSAPutInstruction) instruction).isStatic()) {
SSAPutInstruction putInstr = (SSAPutInstruction) instruction;
// instrNum is the number that will be assigned to this putstatic
int instrNum = putInstrs.size();
putInstrs.add(Pair.make(node, i));
// also update the mapping of static fields to def'ing statements
IField field = cha.resolveField(putInstr.getDeclaredField());
assert field != null;
BitVector bv = staticField2DefStatements.get(field);
if (bv == null) {
bv = new BitVector();
staticField2DefStatements.put(field, bv);
}
bv.set(instrNum);
}
}
}
return new ObjectArrayMapping<Pair<CGNode, Integer>>(putInstrs.toArray(new Pair[putInstrs.size()]));
}