当前位置: 首页>>代码示例>>Java>>正文


Java SSAInstruction.getDef方法代码示例

本文整理汇总了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());
		}

	}
}
 
开发者ID:wondee,项目名称:faststring,代码行数:19,代码来源:InstructionNodeFactory.java

示例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];
  }
}
 
开发者ID:wala,项目名称:MemSAT,代码行数:8,代码来源:FieldNameSSAConversion.java

示例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));
}
 
开发者ID:wala,项目名称:MemSAT,代码行数:23,代码来源:Programs.java


注:本文中的com.ibm.wala.ssa.SSAInstruction.getDef方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。