Java 类soot.jimple.spark.pag.PAG 实例源码

项目:JAADAS    文件:ValidMatches.java   
public ValidMatches(PAG pag, FieldToEdgesMap fieldToStores) {
    for (Iterator iter = pag.loadSources().iterator(); iter.hasNext();) {
        FieldRefNode loadSource = (FieldRefNode) iter.next();
        SparkField field = loadSource.getField();
        VarNode loadBase = loadSource.getBase();
        ArraySet<Pair<VarNode, VarNode>> storesOnField = fieldToStores.get(field);
        for (Pair<VarNode, VarNode> store : storesOnField) {
            VarNode storeBase = store.getO2();              
            if (loadBase.getP2Set().hasNonEmptyIntersection(storeBase.getP2Set())) {
                VarNode matchSrc = store.getO1();
                Node[] loadTargets = pag.loadLookup(loadSource);
                for (int i = 0; i < loadTargets.length; i++) {
                    VarNode matchTgt = (VarNode) loadTargets[i];
                    vMatchEdges.put(matchSrc, matchTgt);
                    vMatchBarEdges.put(matchTgt, matchSrc);
                }
            }               
        }
    }
}
项目:JAADAS    文件:SootUtil.java   
public static FieldAccessMap buildStoreMap(PAG pag) {
  FieldAccessMap ret = new FieldAccessMap();
  Iterator frNodeIter = pag.storeInvSourcesIterator();
  while (frNodeIter.hasNext()) {
    FieldRefNode frNode = (FieldRefNode) frNodeIter.next();
    SparkField field = frNode.getField();
    Node[] targets = pag.storeInvLookup(frNode);
    for (int i = 0; i < targets.length; i++) {
      VarNode target = (VarNode) targets[i];
      if (target instanceof GlobalVarNode)
        continue;
      ret.put(field, new Pair<FieldRefNode, LocalVarNode>(frNode, (LocalVarNode) target));
    }
  }
  return ret;
}
项目:JAADAS    文件:SootUtil.java   
public static PointsToSetInternal constructIntersection(final PointsToSetInternal set1, final PointsToSetInternal set2, PAG pag) {
  HybridPointsToSet hybridSet1 = null, hybridSet2 = null;
  hybridSet1 = convertToHybrid(set1);
  hybridSet2 = convertToHybrid(set2);
  HybridPointsToSet intersection = HybridPointsToSet.intersection(hybridSet1, hybridSet2, pag);
  // checkSetsEqual(intersection, set1, set2, pag);
  return intersection;

}
项目:JAADAS    文件:SootUtil.java   
public static void dumpVarNodeInfo(final PAG pag) {
  PrintWriter varNodeWriter = null;
  try {
    varNodeWriter = new PrintWriter(new BufferedWriter(new FileWriter("varNodeInfo")));
  } catch (IOException e) {
    e.printStackTrace();
  }

  for (Iterator iter = pag.getVarNodeNumberer().iterator(); iter.hasNext();) {
    VarNode varNode = (VarNode) iter.next();
    varNodeWriter.println(varNode.getNumber() + " " + varNode);

  }
  varNodeWriter.flush();
  varNodeWriter.close();
}
项目:JAADAS    文件:SootUtil.java   
public static void printNodeNumberMapping(String fileName, PAG pag) {

    try {
      PrintWriter pw = new PrintWriter(new FileOutputStream(fileName));

      for (Iterator iter = pag.getVarNodeNumberer().iterator(); iter.hasNext();) {
        VarNode vn = (VarNode) iter.next();
        pw.println(vn.getNumber() + "\t" + vn);
      }

      pw.close();
    } catch (FileNotFoundException e) {

      e.printStackTrace();
    }

  }
项目:JAADAS    文件:DemandCSPointsTo.java   
public DemandCSPointsTo(ContextSensitiveInfo csInfo, PAG pag,
        int maxTraversal, int maxPasses, boolean lazy) {
    this.csInfo = csInfo;
    this.pag = pag;
    this.maxPasses = maxPasses;
    this.lazy = lazy;
    this.maxNodesPerPass = maxTraversal / maxPasses;
    this.heuristicType = HeuristicType.INCR;
    this.reachingObjectsCache = new HashMap<Local, PointsToSet>();
    this.reachingObjectsCacheNoCGRefinement = new HashMap<Local, PointsToSet>();
       this.useCache = true;
}
项目:JAADAS    文件:BitPointsToSet.java   
public static P2SetFactory getFactory() {
    return new P2SetFactory() {
        public PointsToSetInternal newSet( Type type, PAG pag ) {
            return new BitPointsToSet( type, pag );
        }
    };
}
项目:JAADAS    文件:DoublePointsToSet.java   
public static P2SetFactory getFactory( P2SetFactory newFactory,
        P2SetFactory oldFactory ) {
    G.v().newSetFactory = newFactory;
    G.v().oldSetFactory = oldFactory;
    return new P2SetFactory() {
        public PointsToSetInternal newSet( Type type, PAG pag ) {
            return new DoublePointsToSet( type, pag );
        }
    };
}
项目:JAADAS    文件:SharedListSet.java   
public final static P2SetFactory getFactory() {
    return new P2SetFactory() {
        public final PointsToSetInternal newSet(Type type, PAG pag) {
            return new SharedListSet(type, pag);
        }
    };
}
项目:JAADAS    文件:SortedArraySet.java   
public final static P2SetFactory getFactory() {
    return new P2SetFactory() {
        public final PointsToSetInternal newSet( Type type, PAG pag ) {
            return new SortedArraySet( type, pag );
        }
    };
}
项目:JAADAS    文件:SharedHybridSet.java   
public SharedHybridSet(Type type, PAG pag) {
    // I'm not sure what "type" is for, but this is the way the other set
    // representations
    // did it
    super(type);
    this.pag = pag;
    //System.out.println("Using new heintze set");
}
项目:JAADAS    文件:SharedHybridSet.java   
public final static P2SetFactory getFactory() {
    return new P2SetFactory() {
        public final PointsToSetInternal newSet(Type type, PAG pag) {
            return new SharedHybridSet(type, pag);
        }
    };
}
项目:JAADAS    文件:HybridPointsToSet.java   
public static P2SetFactory getFactory() {
    return new P2SetFactory() {
        public final PointsToSetInternal newSet( Type type, PAG pag ) {
            return new HybridPointsToSet( type, pag );
        }
    };
}
项目:JAADAS    文件:HashPointsToSet.java   
public static P2SetFactory getFactory() {
    return new P2SetFactory() {
        public PointsToSetInternal newSet( Type type, PAG pag ) {
            return new HashPointsToSet( type, pag );
        }
    };
}
项目:matos-tool    文件:MethodSpyAnalysis.java   
private AbsValue analyzeArrayRef(ArrayRef r, Unit u, Set <Unit> seen ) {
    ProgramSpy.debug("******** ARRAY REF *******");
    ArrayRef fr = (ArrayRef) r;
    Value b = fr.getBase();
    if (b instanceof Local) {
        try {
            PointsToSet ps1 = pag.reachingObjects((Local) b);
            PointsToSet ps2 = ((PAG) pag).reachingObjectsOfArrayElement(ps1); 
            return possibleStringConstantsValue(b.toString(),ps2);
        } catch (Exception e) { 
            return new UnknownValue(r.toString()); 
        }
    } else return new UnknownValue(r.toString());
}
项目:JAADAS    文件:DemandCSPointsTo.java   
public static DemandCSPointsTo makeWithBudget(int maxTraversal,
        int maxPasses, boolean lazy) {
    PAG pag = (PAG) Scene.v().getPointsToAnalysis();
    ContextSensitiveInfo csInfo = new ContextSensitiveInfo(pag);
    return new DemandCSPointsTo(csInfo, pag, maxTraversal, maxPasses, lazy);
}
项目:JAADAS    文件:DemandCSPointsTo.java   
public DemandCSPointsTo(ContextSensitiveInfo csInfo, PAG pag) {
    this(csInfo, pag, DEFAULT_MAX_TRAVERSAL, DEFAULT_MAX_PASSES, DEFAULT_LAZY);
}
项目:JAADAS    文件:DemandCSPointsTo.java   
/**
 * @return returns the (SPARK) pointer assignment graph
 */
public PAG getPAG() {
    return pag;
}
项目:JAADAS    文件:BitPointsToSet.java   
public BitPointsToSet( Type type, PAG pag ) {
    super( type );
    this.pag = pag;
    bits = new BitVector( pag.getAllocNodeNumberer().size() );
}
项目:JAADAS    文件:DoublePointsToSet.java   
public DoublePointsToSet( Type type, PAG pag ) {
    super( type );
    newSet = G.v().newSetFactory.newSet( type, pag );
    oldSet = G.v().oldSetFactory.newSet( type, pag );
    this.pag = pag;
}
项目:JAADAS    文件:SharedListSet.java   
public SharedListSet(Type type, PAG pag)
{
       super( type );
       this.pag = pag;
}
项目:JAADAS    文件:P2SetFactory.java   
/** Returns a newly-created set. */
public abstract PointsToSetInternal newSet( Type type, PAG pag );
项目:JAADAS    文件:SortedArraySet.java   
public SortedArraySet( Type type, PAG pag ) {
    super( type );
    this.pag = pag;
}
项目:JAADAS    文件:HybridPointsToSet.java   
public HybridPointsToSet( Type type, PAG pag ) {
    super( type );
    this.pag = pag;
}
项目:JAADAS    文件:HashPointsToSet.java   
public HashPointsToSet( Type type, PAG pag ) {
    super( type );
    this.pag = pag;
}
项目:JAADAS    文件:TypeManager.java   
public TypeManager( PAG pag ) {
    this.pag = pag;
}
项目:JAADAS    文件:AllocationSiteHandler.java   
/**
 * @param pag
 * @param receiverType
 * @param methodName
 * @param parameterTypes
 * @param returnType
 */
public VirtualCallHandler(PAG pag, Type receiverType, NumberedString methodStr) {
  super();
  this.pag = pag;
  this.receiverType = receiverType;
  this.methodStr = methodStr;
}
项目:matos-tool    文件:ArrayAnalysis.java   
/**
 * Constructor of the analysis. 
 * @param pag Points to analysis.
 */
public ArrayAnalysis(PointsToAnalysis pag ) {
    if (pag instanceof PAG) this.pag = (PAG) pag;
}
项目:JAADAS    文件:MergeChecker.java   
public MergeChecker( PAG pag ) { this.pag = pag; }