soot.Body.getLocalCount()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(206)

本文整理了Java中soot.Body.getLocalCount()方法的一些代码示例,展示了Body.getLocalCount()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Body.getLocalCount()方法的具体详情如下:
包路径:soot.Body
类名称:Body
方法名:getLocalCount

Body.getLocalCount介绍

[英]Returns the number of locals declared in this body.
[中]返回在此正文中声明的局部数。

代码示例

代码示例来源:origin: Sable/soot

localToDefsBits = new BitSet[body.getLocalCount()];
localToUsesBits = new BitSet[body.getLocalCount()];

代码示例来源:origin: Sable/soot

/**
 * Reassigns the local numbers such that a dense bit set can be created over them
 */
public void pack() {
 int n = body.getLocalCount();
 locals = new Local[n];
 oldNumbers = new int[n];
 n = 0;
 for (Local local : body.getLocals()) {
  locals[n] = local;
  oldNumbers[n] = local.getNumber();
  local.setNumber(n++);
 }
}

代码示例来源:origin: Sable/soot

Map<Type, List<Local>> typeToLocals = new DeterministicHashMap(OrigBody.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: Sable/soot

localToLocals = new HashMap<Local, Set<Local>>(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: Sable/soot

localToGroup = new HashMap<Local, Object>(body.getLocalCount() * 2 + 1, 0.7f);
groupToColorCount = new HashMap<Object, Integer>(body.getLocalCount() * 2 + 1, 0.7f);
localToColor = new HashMap<Local, Integer>(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: Sable/soot

Map<Type, List<Local>> typeToLocals = new DeterministicHashMap<Type, List<Local>>(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: Sable/soot

protected void handleClass(PrintWriter out, SootClass c) {
  for (SootMethod m : c.getMethods()) {
   if (!m.isConcrete()) {
    continue;
   }
   Body b = m.retrieveActiveBody();

   Local[] sortedLocals = b.getLocals().toArray(new Local[b.getLocalCount()]);
   Arrays.sort(sortedLocals, new StringComparator<Local>());

   for (Local l : sortedLocals) {
    out.println("V " + m + l);
    if (l.getType() instanceof RefLikeType) {
     Set<Type> types = pa.reachingObjects(l).possibleTypes();

     Type[] sortedTypes = types.toArray(new Type[types.size()]);
     Arrays.sort(sortedTypes, new StringComparator<Type>());

     for (Type type : sortedTypes) {
      out.println("T " + type);
     }
    }
   }
  }
 }
}

代码示例来源:origin: Sable/soot

Map<Local, Object> localToGroup = new DeterministicHashMap<Local, Object>(body.getLocalCount() * 2 + 1, 0.7f);
Map<Object, Integer> groupToColorCount = new HashMap<Object, Integer>(body.getLocalCount() * 2 + 1, 0.7f);
Map<Local, Integer> localToColor = new HashMap<Local, Integer>(body.getLocalCount() * 2 + 1, 0.7f);
Map<Local, Local> localToNewLocal;
 localToNewLocal = new HashMap<Local, Local>(body.getLocalCount() * 2 + 1, 0.7f);
 Map<GroupIntPair, Local> groupIntToLocal = new HashMap<GroupIntPair, Local>(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: Sable/soot

Local newArrL = new JimpleLocal("$u" + (b.getLocalCount() + 1), ArrayType.v(rf, 1));
b.getLocals().add(newArrL);
JAssignStmt newArr = new JAssignStmt(newArrL, new JNewArrayExpr(rf, IntConstant.v(parms.size())));

代码示例来源:origin: Sable/soot

Local newLocal = Jimple.v().newLocal("sc" + body.getLocalCount(), constant.getType());
body.getLocals().add(newLocal);
body.getUnits().insertBefore(Jimple.v().newAssignStmt(newLocal, constant), u);

代码示例来源:origin: Sable/soot

List<Local> keep = new ArrayList<Local>(body.getLocalCount());
for (Local local : locals) {
 int lno = local.getNumber();

代码示例来源:origin: secure-software-engineering/FlowDroid

@Override
  public Local[] load(SootMethod method) throws Exception {
    if (!method.isConcrete() || !method.hasActiveBody())
      return new Local[0];
    List<Local> lcs = new ArrayList<Local>(method.getActiveBody().getLocalCount());
    for (Unit u : method.getActiveBody().getUnits())
      if (u instanceof AssignStmt) {
        AssignStmt assignStmt = (AssignStmt) u;
        if (assignStmt.getLeftOp() instanceof Local)
          lcs.add((Local) assignStmt.getLeftOp());
      }
    return lcs.toArray(new Local[lcs.size()]);
  }
});

代码示例来源:origin: com.bugvm/bugvm-soot

localToLocals = new HashMap<Local, ArraySet>(body.getLocalCount() * 2 + 1, 
              0.7f);

代码示例来源:origin: ibinti/bugvm

localToLocals = new HashMap<Local, ArraySet>(body.getLocalCount() * 2 + 1, 
              0.7f);

代码示例来源:origin: com.bugvm/bugvm-soot

new DeterministicHashMap(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: ibinti/bugvm

new DeterministicHashMap(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: ibinti/bugvm

G.v().out.println("[" + body.getMethod().getName() + "] Packing locals...");
Map<Local, Object> localToGroup = new DeterministicHashMap(body.getLocalCount() * 2 + 1, 0.7f);
Map<Object, Integer> groupToColorCount = new HashMap<Object, Integer>(body.getLocalCount() * 2 + 1, 0.7f);
Map<Local, Integer> localToColor = new HashMap<Local, Integer>(body.getLocalCount() * 2 + 1, 0.7f);
Map localToNewLocal;
  localToNewLocal = new HashMap(body.getLocalCount() * 2 + 1, 0.7f);
  Map groupIntToLocal = new HashMap(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: com.bugvm/bugvm-soot

G.v().out.println("[" + body.getMethod().getName() + "] Packing locals...");
Map<Local, Object> localToGroup = new DeterministicHashMap(body.getLocalCount() * 2 + 1, 0.7f);
Map<Object, Integer> groupToColorCount = new HashMap<Object, Integer>(body.getLocalCount() * 2 + 1, 0.7f);
Map<Local, Integer> localToColor = new HashMap<Local, Integer>(body.getLocalCount() * 2 + 1, 0.7f);
Map localToNewLocal;
  localToNewLocal = new HashMap(body.getLocalCount() * 2 + 1, 0.7f);
  Map groupIntToLocal = new HashMap(body.getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: ibinti/bugvm

Map<Local, ArrayList> localToDefList = new HashMap<Local, ArrayList>(g.getBody().getLocalCount() * 2 + 1, 0.7f);
  localToIntPair = new HashMap<Local, IntPair>(g.getBody().getLocalCount() * 2 + 1, 0.7f);
Map<Local, FlowSet> localToKillSet = new HashMap<Local, FlowSet>(g.getBody().getLocalCount() * 2 + 1, 0.7f);
localToPreserveSet = new HashMap<Local, BoundedFlowSet>(g.getBody().getLocalCount() * 2 + 1, 0.7f);

代码示例来源:origin: com.bugvm/bugvm-soot

Map<Local, ArrayList> localToDefList = new HashMap<Local, ArrayList>(g.getBody().getLocalCount() * 2 + 1, 0.7f);
  localToIntPair = new HashMap<Local, IntPair>(g.getBody().getLocalCount() * 2 + 1, 0.7f);
Map<Local, FlowSet> localToKillSet = new HashMap<Local, FlowSet>(g.getBody().getLocalCount() * 2 + 1, 0.7f);
localToPreserveSet = new HashMap<Local, BoundedFlowSet>(g.getBody().getLocalCount() * 2 + 1, 0.7f);

相关文章