Package soot

Examples of soot.ValueBox


  }
 
  @Override
  public void caseAssignStmt(AssignStmt stmt) {
    Value lvalue = stmt.getLeftOp();
    ValueBox rbox = stmt.getRightOpBox();
    if (lvalue instanceof JInstanceFieldRef) {
      JInstanceFieldRef ref = (JInstanceFieldRef)lvalue;
      SootField field = ref.getField();
      if (fieldAutomatonMap.containsKey(field)) {
        Automaton automaton = fieldAutomatonMap.get(field);
View Full Code Here


  }
 
  @Override
  public void caseIdentityStmt(IdentityStmt stmt) {
    Value rvalue = stmt.getRightOp();
    ValueBox rbox = stmt.getRightOpBox();
    if (rvalue instanceof ParameterRef) {
      ParameterRef parameter = (ParameterRef)rvalue;
      int index = parameter.getIndex();
      Map<Integer,Automaton> pMap = parameterAutomatonMap.get(currentMethod);
      if (pMap != null && pMap.containsKey(index)) {
View Full Code Here

  }
 
  @Override
  public void caseReturnStmt(ReturnStmt stmt) {
    if (returnAutomatonMap.containsKey(currentMethod)) {
      ValueBox box = stmt.getOpBox();
      Automaton automaton = returnAutomatonMap.get(currentMethod);
      createHotspot(stmt, box, automaton);
    }
  }
View Full Code Here

      ArrayConstantInfo info = src.get(local);
      if (info.contents == null) {
          dead.add(local);
        continue;
      }
      ValueBox allowedBox = null; // the only place the statement is allowed to reference an array without breaking it
      boolean affected = false;
      if (stmt instanceof DefinitionStmt) {
        DefinitionStmt def = (DefinitionStmt)stmt;
        if (def.getLeftOp() instanceof ArrayRef) {
          ArrayRef array = (ArrayRef)def.getLeftOp();
View Full Code Here

        XMLGraphBuilder xmlGraphs = analysis.buildXMLGraphs(graph);

        int counter = 0;
        for (Map.Entry<ValueBox, AnalyzeStm> en : result.getHotspots()
                .entrySet()) {
            ValueBox value = en.getKey();
            AnalyzeStm stm = en.getValue();
            XMLGraph g = xmlGraphs.getIn(stm, stm.getBase());
            List<Automaton> findInputNameValues = findInputNameValues(g);
            for (Automaton automaton : findInputNameValues) {
                System.out.println(automaton.getFiniteStrings());
View Full Code Here

                    while (si.hasNext()) {
                        Stmt stmt = (Stmt) si.next();
                        if (stmt.containsInvokeExpr()) {
                            InvokeExpr expr = stmt.getInvokeExpr();
                            if (expr.getMethodRef().getSignature().equals(sig)) {
                                ValueBox box = expr.getArgBox(argnum);
                                list.add(box);
                            }
                        }
                    }
                }
View Full Code Here

        }
        return false;
    }

    private void registerHotspot(HotspotInfo hotspot) {
        ValueBox box = hotspot.getBox();
        trans_map.put(box, hotspot.getStatement());
        sourcefile_map.put(box, hotspot.getSourcefile());
        class_map.put(box, hotspot.getClassName());
        method_map.put(box, hotspot.getMethodName());
        line_map.put(box, hotspot.getLineNumber());
View Full Code Here

                    for (Unit unit : sm.getActiveBody().getUnits()) {
                        Stmt stmt = (Stmt) unit;
                        if (stmt.containsInvokeExpr()) {
                            InvokeExpr expr = stmt.getInvokeExpr();
                            if (expr.getMethod().getSignature().equals("<dk.brics.string.runtime.Strings: java.lang.String analyze(java.lang.String,java.lang.String)>")) {
                                ValueBox spot = expr.getArgBox(0);
                                Automaton expected = getRegExp(expr).toAutomaton(bindings);
                                hotspots.add(new RuntimeHotspot(spot, expected, HotspotKind.ANALYZE));
                            } else
                            if (expr.getMethod().getSignature().equals("<dk.brics.string.runtime.Strings: java.lang.String analyze(java.lang.String,java.net.URL)>")) {
                                ValueBox spot = expr.getArgBox(0);
                                Automaton expected = bindings.getFromURL(bindings.getConstantURL(expr.getArg(1)));
                                hotspots.add(new RuntimeHotspot(spot, expected, HotspotKind.ANALYZE));
                            } else
                            if (expr.getMethod().getSignature().equals("<dk.brics.string.runtime.Strings: java.lang.String check(java.lang.String,java.lang.String)>")) {
                                ValueBox spot = expr.getArgBox(0);
                                Automaton expected = getRegExp(expr).toAutomaton(bindings);
                                hotspots.add(new RuntimeHotspot(spot, expected, HotspotKind.CHECK));
                            } else
                            if (expr.getMethod().getSignature().equals("<dk.brics.string.runtime.Strings: java.lang.String check(java.lang.String,java.net.URL)>")) {
                                ValueBox spot = expr.getArgBox(0);
                                Automaton expected = bindings.getFromURL(bindings.getConstantURL(expr.getArg(1)));
                                hotspots.add(new RuntimeHotspot(spot, expected, HotspotKind.CHECK));
                            }
                        }
                    }
View Full Code Here

        for (SootMethod method : xmlReturners) {
            Body body = method.retrieveActiveBody();
            for (Unit unit : body.getUnits()) {
                if (unit instanceof ReturnStmt) {
                    ReturnStmt stmt = (ReturnStmt) unit;
                    final ValueBox box = stmt.getOpBox();
                    returnLocations.put(stmt, new MethodStatementContainer(
                            method, stmt));
                    stmt2box.put(stmt, box);
                }
            }
        }

        // add the plug statements
        for (Plugging plugging : pluggings) {
            final AssignStmt stmt = plugging.getStmt();
            final ValueBox box = stmt.getInvokeExprBox();
            stmt2box.put(stmt, box);
        }
        return stmt2box;
    }
View Full Code Here

                            if (invokedSignature.equals(targetSignature)) {
                                // we have found an invocation of our target

                                // fetch the argument of the invocation to
                                // analyze
                                ValueBox box = expr.getArgBox(argnum);
                                list.add(box);
                            }
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of soot.ValueBox

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.