private int findSetIndex(RegisterSpec reg) {
    int i;
    for (i = 0; i < latticeValues.size(); i++) {
      EscapeSet e = latticeValues.get(i);
      if (e.regSet.get(reg.getReg())) {
        return i;
      }
    }
    return i;
  }
Finds the index in the lattice for a particular register. Returns the size of the lattice if
the register wasn't found.

@param reg {@code non-null;} register being looked up
@return index of the register or size of the lattice if it wasn't found.
android/android_framework/dex-maker/src/main/java/com/android/dx/ssa/EscapeAnalysis.java