private void calcDomFronts() {
    int szNodes = nodes.size();

    for (int b = 0; b < szNodes; b++) {
      SsaBasicBlock nb = nodes.get(b);
      DomInfo nbInfo = domInfos[b];
      BitSet pred = nb.getPredecessors();

      if (pred.cardinality() > 1) {
        for (int i = pred.nextSetBit(0); i >= 0; i = pred.nextSetBit(i + 1)) {

          for (int runnerIndex = i; runnerIndex != nbInfo.idom; /* empty */ ) {
            /*
             * We can stop if we hit a block we already
             * added label to, since we must be at a part
             * of the dom tree we have seen before.
             */
            if (runnerIndex == -1) break;

            DomInfo runnerInfo = domInfos[runnerIndex];

            if (runnerInfo.dominanceFrontiers.has(b)) {
              break;
            }

            // Add b to runner's dominance frontier set.
            runnerInfo.dominanceFrontiers.add(b);
            runnerIndex = runnerInfo.idom;
          }
        }
      }
    }
  }
Calculates the dominance-frontier set. from "A Simple, Fast Dominance Algorithm" by Cooper,
Harvey, and Kennedy; transliterated to Java.
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/DomFront.java