Example #1
0
 private static void checkWatchList(
     ArrayList<FloatingReadNode> watchList,
     LocationIdentity identity,
     Block b,
     ArrayList<Node> result,
     NodeMap<Block> nodeMap,
     NodeBitMap unprocessed) {
   assert identity.isMutable();
   if (identity.isAny()) {
     for (FloatingReadNode r : watchList) {
       if (unprocessed.isMarked(r)) {
         sortIntoList(r, b, result, nodeMap, unprocessed, null);
       }
     }
     watchList.clear();
   } else {
     int index = 0;
     while (index < watchList.size()) {
       FloatingReadNode r = watchList.get(index);
       LocationIdentity locationIdentity = r.getLocationIdentity();
       assert locationIdentity.isMutable();
       if (unprocessed.isMarked(r)) {
         if (identity.overlaps(locationIdentity)) {
           sortIntoList(r, b, result, nodeMap, unprocessed, null);
         } else {
           ++index;
           continue;
         }
       }
       int lastIndex = watchList.size() - 1;
       watchList.set(index, watchList.get(lastIndex));
       watchList.remove(lastIndex);
     }
   }
 }