本文整理汇总了Java中com.ibm.wala.ssa.SSAGetInstruction类的典型用法代码示例。如果您正苦于以下问题:Java SSAGetInstruction类的具体用法?Java SSAGetInstruction怎么用?Java SSAGetInstruction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SSAGetInstruction类属于com.ibm.wala.ssa包,在下文中一共展示了SSAGetInstruction类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleGet
import com.ibm.wala.ssa.SSAGetInstruction; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see com.ibm.wala.memsat.translation.MemoryInstructionHandler#handleGet(int, com.ibm.wala.ssa.SSAGetInstruction, kodkod.ast.Formula, com.ibm.wala.memsat.translation.Environment)
*/
public void handleGet(int instIdx, SSAGetInstruction inst, Formula guard, Environment env) {
final Expression ref = inst.isStatic() ? null : env.refUse(inst.getRef());
final InlinedInstruction action = action(instIdx, env);
if (action==null) {
final int fieldUse = env.top().callInfo().fieldSSA().getUse(inst, 0);
final FieldExpression<?> field = env.fieldUse(fieldUse);
env.localDef(inst.getDef(), field.read(ref));
} else {
env.localDef(inst.getDef(), value(action));
guards.put(action, guard);
locations.put(action, ref==null ? factory.fieldOf(action) : ref.union(factory.fieldOf(action)));
}
}
示例2: handleGet
import com.ibm.wala.ssa.SSAGetInstruction; //导入依赖的package包/类
/**
* {@inheritDoc}
* @see com.ibm.wala.memsat.translation.MemoryInstructionHandler#handleGet(com.ibm.wala.ssa.SSAGetInstruction, com.ibm.wala.memsat.translation.Environment)
*/
public void handleGet(int instIdx, SSAGetInstruction inst, Formula guard, Environment env) {
final int[] uses = env.top().callInfo().fieldSSA().getUses(inst);
if (inst.isStatic()) {
assert uses.length==1;
env.localDef(inst.getDef(), env.fieldUse(uses[0]).read(null));
} else {
final PhiExpression<Object> reads = env.factory().valuePhi(IRType.convert(inst.getDeclaredFieldType()));
for(int use : uses) {
final FieldExpression<Object> field = env.fieldUse(use);
final Expression ref = env.refUse(inst.getRef());
reads.add( Formula.TRUE, field.read(ref) );
}
env.localDef(inst.getDef(), reads.value());
}
// final int fieldUse = env.top().callInfo().fieldSSA().getUse(inst, 0);
// final FieldExpression<?> field = env.fieldUse(fieldUse);
// final Expression ref = inst.isStatic() ? null : env.refUse(inst.getRef());
// env.localDef(inst.getDef(), field.read(ref));
}
示例3: valueFor
import com.ibm.wala.ssa.SSAGetInstruction; //导入依赖的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));
}
示例4: visitGet
import com.ibm.wala.ssa.SSAGetInstruction; //导入依赖的package包/类
/** @effects calls this.memoryHandler.handleGet(inst, env) */
public final void visitGet(SSAGetInstruction inst) {
memoryHandler.handleGet(instIdx, inst, guardHandler.absoluteEntryGuard(inst), env);
}
示例5: visitGet
import com.ibm.wala.ssa.SSAGetInstruction; //导入依赖的package包/类
/** Calls {@linkplain #visitFieldAccess(SSAFieldAccessInstruction)}. */
public void visitGet(SSAGetInstruction instruction) {
visitFieldAccess(instruction); }
示例6: visitGet
import com.ibm.wala.ssa.SSAGetInstruction; //导入依赖的package包/类
@Override
public void visitGet(SSAGetInstruction instruction) {
res = new GetNode(instruction.getDef());
}
示例7: handleGet
import com.ibm.wala.ssa.SSAGetInstruction; //导入依赖的package包/类
/**
* Updates env.top.localEnv[inst.getDef()] with the result of translating
* the given get instruction.
* @requires inst in env.top.cfg().getInstructions()
* @requires env.top.callInfo.cgNode.getIR().getInstructions()[instIdx] = inst
* @effects updates env.top.localEnv[inst.getDef()] with the result of translating
* the given get instruction.
*/
public abstract void handleGet(int instIdx, SSAGetInstruction inst, Formula guard, Environment env);