Пример #1
0
 private void computeCaches() {
   cacheAllRegions = new ArrayList<RegionVar>();
   cacheI2R = new HashMap<Integer, RegionVar>();
   for (Node n : nodes) getRegionsHelper(n.getRep(), null, cacheAllRegions);
   for (RegionVar r : cacheAllRegions) {
     r.setIndex(++numRegions);
     cacheI2R.put(r.getIndex(), r);
   }
   numRegions++;
 }
Пример #2
0
  protected void addRegionsFrom(
      Node node, Map<RegionVar, Set<Field>> dead, IBitVector<RegionVar> marked) {
    RegionVar reg = node.getRegion();
    if (reg.isHeap() || marked.get(reg)) return;

    marked.set(reg);
    if (secondary_index[6]) {
      for (Field f : node.getRep().outfields.keySet()) {
        FieldEdge fe = node.getRep().outfields.get(f);
        assert (fe.src == node);
        if (dead == null || dead.get(reg) == null || !dead.get(reg).contains(fe.field))
          addRegionsFrom(fe.dst.getRep(), dead, marked);
      }
    } else {
      for (Field f : fedges.keySet())
        for (FieldEdge fe : fedges.get(f)) {
          if (fe.src == node) {
            if (dead == null || dead.get(reg) == null || !dead.get(reg).contains(fe.field))
              addRegionsFrom(fe.dst, dead, marked);
          }
        }
    }
  }