本文整理汇总了Java中soot.jimple.InstanceFieldRef.getField方法的典型用法代码示例。如果您正苦于以下问题:Java InstanceFieldRef.getField方法的具体用法?Java InstanceFieldRef.getField怎么用?Java InstanceFieldRef.getField使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类soot.jimple.InstanceFieldRef
的用法示例。
在下文中一共展示了InstanceFieldRef.getField方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hasPrefix
import soot.jimple.InstanceFieldRef; //导入方法依赖的package包/类
public boolean hasPrefix(Value v) { // if this has prefix v
if (v instanceof Local) {
if (local == null)
return false;
else
return (local.equals(v));
} else if (v instanceof InstanceFieldRef) {
InstanceFieldRef ifr = (InstanceFieldRef) v;
if (local == null) {
if (ifr.getBase() != null)
return false;
} else if (!local.equals(ifr.getBase()))
return false;
if (fields.length > 0 && ifr.getField() == fields[0])
return true;
return false;
} else if (v instanceof StaticFieldRef) {
StaticFieldRef sfr = (StaticFieldRef) v;
if (local != null)
return false;
if (fields.length > 0 && sfr.getField() == fields[0])
return true;
return false;
} else if (v instanceof ArrayRef) {
ArrayRef ar = (ArrayRef) v;
if (local == null)
return false;
else
return (local.equals(ar.getBase()));
} else if (v instanceof Constant) {
return false;
} else
throw new RuntimeException("Unexpected left side " + v.getClass());
}
示例2: buildInstanceFieldPutInsn
import soot.jimple.InstanceFieldRef; //导入方法依赖的package包/类
private Insn buildInstanceFieldPutInsn(InstanceFieldRef destRef, Value source) {
SootField destSootField = destRef.getField();
BuilderFieldReference destField = DexPrinter.toFieldReference(destSootField, belongingFile);
Value instance = destRef.getBase();
Register instanceReg = regAlloc.asLocal(instance);
Register sourceReg = regAlloc.asImmediate(source, constantV);
Opcode opc = getPutGetOpcodeWithTypeSuffix("iput", destField.getType());
return new Insn22c(opc, sourceReg, instanceReg, destField);
}
示例3: buildInstanceFieldGetInsn
import soot.jimple.InstanceFieldRef; //导入方法依赖的package包/类
private Insn buildInstanceFieldGetInsn(Register destinationReg, InstanceFieldRef sourceRef) {
Value instance = sourceRef.getBase();
Register instanceReg = regAlloc.asLocal(instance);
SootField sourceSootField = sourceRef.getField();
BuilderFieldReference sourceField = DexPrinter.toFieldReference(sourceSootField, belongingFile);
Opcode opc = getPutGetOpcodeWithTypeSuffix("iget", sourceField.getType());
return new Insn22c(opc, destinationReg, instanceReg, sourceField);
}
示例4: str
import soot.jimple.InstanceFieldRef; //导入方法依赖的package包/类
/**
* gives back a representation of the field
* @param fr an instance field
* @return
*/
static String str(InstanceFieldRef fr) {
SootField sf = fr.getField ();
return (fr.getBase ()).toString () + "." + (sf.getDeclaringClass ()).getName () + "." + sf.getName () ;
}