Package soot

Examples of soot.EquivalentValue


      for (ValueBox useBox : useBoxes) {
        Value val = useBox.getValue();
        if(val instanceof FieldRef) {
          FieldRef fieldRef = (FieldRef) val;
          if(fieldRef.getType() instanceof RefLikeType)
            usedFieldRefs.add(new EquivalentValue(fieldRef));           
        }
      }
    }
       
        //prune all fields that are written to
        if(!usedFieldRefs.isEmpty()) {
     
        if(!Scene.v().hasCallGraph()) {
          throw new IllegalStateException("No call graph found!");
        }
             
      CallGraph cg = Scene.v().getCallGraph();
      ReachableMethods reachableMethods = new ReachableMethods(cg,Collections.<MethodOrMethodContext>singletonList(container));
      reachableMethods.update();
      for (Iterator<MethodOrMethodContext> iterator = reachableMethods.listener(); iterator.hasNext();) {
        SootMethod m = (SootMethod) iterator.next();
        if(m.hasActiveBody() &&
        //exclude static initializer of same class (assume that it has already been executed)
         !(m.getName().equals(SootMethod.staticInitializerName) && m.getDeclaringClass().equals(container.getDeclaringClass()))) {       
          for (Unit u : m.getActiveBody().getUnits()) {
            List<ValueBox> defBoxes = u.getDefBoxes();
            for (ValueBox defBox : defBoxes) {
              Value value = defBox.getValue();
              if(value instanceof FieldRef) {
                usedFieldRefs.remove(new EquivalentValue(value));
              }
            }
          }
        }
      }
View Full Code Here


        CastExpr castExpr = (CastExpr) rhs;
              rhs = castExpr.getOp();
            }
           
            if ((lhs instanceof Local
                || (lhs instanceof FieldRef && this.localsAndFieldRefs.contains(new EquivalentValue(lhs))))
              && lhs.getType() instanceof RefLikeType) {
                if (rhs instanceof Local) {
                  //local-assignment - must be aliased...
                    out.put(lhs, in.get(rhs));
                } else if(rhs instanceof ThisRef) {
View Full Code Here

          assert s.getDefBoxes().isEmpty();
        }
    }

    private Object numberOfRhs(Value rhs) {
       EquivalentValue equivValue = new EquivalentValue(rhs);
       if(localsAndFieldRefs.contains(equivValue)){
         rhs = equivValue;
       }
        Integer num = rhsToNumber.get(rhs);
        if(num==null) {
View Full Code Here

                    {
                      G.v().out.println("[DeadlockDetector] DEADLOCK HAS BEEN DETECTED while inspecting " + lock1Num + " ("+lock1+") and " + lock2Num + " ("+lock2+") ");
                 
                    // Create a deadlock avoidance edge
                    DeadlockAvoidanceEdge dae = new DeadlockAvoidanceEdge(tn1.method.getDeclaringClass());
                    EquivalentValue daeEqVal = new EquivalentValue(dae);
                   
                    // Register it as a static lock
                    Integer daeNum = new Integer(-lockPTSets.size()); // negative indicates a static lock
                    permanentOrder.addNode(daeNum);
                    lockToLockNum.put(dae, daeNum);
View Full Code Here

          Value lockToInsert = lockEqVal.getValue();
          Integer lockNumToInsert = lockToLockNum.get(lockToInsert);
          int i = 0;
          while( i < newLockset.size() )
          {
            EquivalentValue existingLockEqVal = newLockset.get(i);
            Value existingLock = existingLockEqVal.getValue();
            Integer existingLockNum = lockToLockNum.get(existingLock);
            if( visibleOrder.containsEdge(lockNumToInsert, existingLockNum) ||
              lockNumToInsert < existingLockNum )
//              !visibleOrder.containsEdge(existingLockNum, lockNumToInsert) ) // if(! existing before toinsert )
              break;
View Full Code Here

TOP

Related Classes of soot.EquivalentValue

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.