本文整理汇总了Java中com.ibm.wala.ssa.SSAInstruction.getDef方法的典型用法代码示例。如果您正苦于以下问题:Java SSAInstruction.getDef方法的具体用法?Java SSAInstruction.getDef怎么用?Java SSAInstruction.getDef使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.wala.ssa.SSAInstruction
的用法示例。
在下文中一共展示了SSAInstruction.getDef方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkLocalsForDef
import com.ibm.wala.ssa.SSAInstruction; //导入方法依赖的package包/类
private void checkLocalsForDef(SSAInstruction instruction, InstructionNode result, Integer index) {
if (instruction.hasDef()) {
int def = instruction.getDef();
result.addLocalVariableIndices(def, method.getLocalForDef(index, def));
LOG.debug("determine store instruction for v={} at {}", def, instruction);
LocalInfo store = method.getStoreFor(0, 1, (instruction instanceof SSAPhiInstruction) && index > 0 ? index - 1 : index);
if (store != null) {
if (store.local() != -1) {
result.addLocalVariableIndices(def, Arrays.asList(store.local()));
}
result.setStore(store.local(), store.bcIndex());
}
}
}
示例2: getDef
import com.ibm.wala.ssa.SSAInstruction; //导入方法依赖的package包/类
protected int getDef(SSAInstruction inst, int index) {
if (fieldPhiSet.contains(inst)) {
return inst.getDef(index);
} else {
return ((int[])valueNumbers.get(Pair.make(inst, DEFS)))[index];
}
}
示例3: valueFor
import com.ibm.wala.ssa.SSAInstruction; //导入方法依赖的package包/类
/**
* Returns a set of instance keys that represent the value that is read or written by the given instruction
* or the empty set if the value is a primitive.
* @requires some n : info.threads | info.concurrentInformation(n).actions().contains(inst)
* @requires inst.action in NORMAL_READ + VOLATILE_READ + NORMAL_WRITE + VOLATILE_WRITE
* @return set of instance keys that represent the value that is read or written by the given instruction
* or the empty set if the value is a primitive.
*/
public static Set<InstanceKey> valueFor(WalaInformation info, InlinedInstruction inst) {
final int use;
final SSAInstruction obj = inst.instruction();
if (obj instanceof SSAGetInstruction || obj instanceof SSAArrayLoadInstruction) {
use = obj.getDef();
} else if (obj instanceof SSAPutInstruction) {
use = ((SSAPutInstruction)obj).getVal();
} else if (obj instanceof SSAArrayStoreInstruction) {
use = ((SSAArrayStoreInstruction)obj).getValue();
} else {
throw new IllegalArgumentException(inst + " is not a read or write instruction.");
}
return info.pointsTo(info.cgNodeInformation(inst.cgNode()).pointerKeyFor(use));
}