case PUTSTATIC_opcode:case PUTSTATIC_UNRESOLVED_opcode:
case PUTSTATIC_opcode:
  final public static Set getCandidates(OPT_IR ir) {    OPT_GlobalValueNumberState valueNumbers = ir.HIRInfo.valueNumbers;    // which types have we seen loads for?    HashSet seenLoad = new HashSet(10);    // which static fields have we seen stores for?    HashSet seenStore = new HashSet(10);    HashSet resultSet = new HashSet(10);    // for each type T, indices(T) gives the set of value number (pairs)    // that identify the indices seen in memory accesses to type T.    HashMap indices = new HashMap(10);    for (Enumeration be = ir.getBasicBlocks(); be.hasMoreElements(); ) {      OPT_BasicBlock bb = (OPT_BasicBlock)be.nextElement();      if (!ir.options.FREQ_FOCUS_EFFORT || !bb.getInfrequent()) {        for (OPT_InstructionEnumeration e = bb.forwardInstrEnumerator(); e.hasMoreElements();) {          OPT_Instruction s = e.next();          switch (s.operator().opcode) {            case GETFIELD_opcode:case GETFIELD_UNRESOLVED_opcode:              {                OPT_Operand ref = GetField.getRef(s);                VM_Field f = GetField.getLocation(s).field;                HashSet numbers = findOrCreateIndexSet(indices,f);                int v = valueNumbers.getValueNumber(ref);                Integer V = new Integer(v);                if (numbers.contains(V)) {                  resultSet.add(f);                } else {                  numbers.add(V);                }                seenLoad.add(f);              }              break;            case PUTFIELD_opcode:case PUTFIELD_UNRESOLVED_opcode:              {                OPT_Operand ref = PutField.getRef(s);                VM_Field f = PutField.getLocation(s).field;                HashSet numbers = findOrCreateIndexSet(indices,f);                int v = valueNumbers.getValueNumber(ref);                Integer V = new Integer(v);                if (numbers.contains(V)) {                  if (seenLoad.contains(f)) {                    resultSet.add(f);                  }                } else {                  numbers.add(V);                }              }              break;            case GETSTATIC_opcode:case GETSTATIC_UNRESOLVED_opcode:              {                VM_Field f = GetStatic.getLocation(s).field;                if (seenLoad.contains(f) || seenStore.contains(f)) {                  resultSet.add(f);                }                seenLoad.add(f);              }              break;            case PUTSTATIC_opcode:case PUTSTATIC_UNRESOLVED_opcode:              {                VM_Field f = PutStatic.getLocation(s).field;                if (seenLoad.contains(f)) {                  resultSet.add(f);                }                seenStore.add(f);              }              break;            case INT_ALOAD_opcode:case LONG_ALOAD_opcode:case FLOAT_ALOAD_opcode:            case DOUBLE_ALOAD_opcode:case REF_ALOAD_opcode:case BYTE_ALOAD_opcode:            case UBYTE_ALOAD_opcode:case USHORT_ALOAD_opcode:case SHORT_ALOAD_opcode:              {                OPT_Operand ref = ALoad.getArray(s);                VM_Type type = ref.getType();                if (type.isArrayType()) {                  if (!type.asArray().getElementType().isPrimitiveType()) {                    type = OPT_ClassLoaderProxy.JavaLangObjectArrayType;                  }                }                OPT_Operand index = ALoad.getIndex(s);                HashSet numbers = findOrCreateIndexSet(indices,type);                int v1 = valueNumbers.getValueNumber(ref);                int v2 = valueNumbers.getValueNumber(index);                OPT_ValueNumberPair V = new OPT_ValueNumberPair(v1,v2);                if (numbers.contains(V)) {                  resultSet.add(type);                } else {                  numbers.add(V);                }                seenLoad.add(type);              }              break;            case INT_ASTORE_opcode:case LONG_ASTORE_opcode:            case FLOAT_ASTORE_opcode:case DOUBLE_ASTORE_opcode:            case REF_ASTORE_opcode:case BYTE_ASTORE_opcode:            case SHORT_ASTORE_opcode:              {                OPT_Operand ref = AStore.getArray(s);                VM_Type type = ref.getType();                if (type.isArrayType()) {                  if (!type.asArray().getElementType().isPrimitiveType()) {                    type = OPT_ClassLoaderProxy.JavaLangObjectArrayType;                  }                }                OPT_Operand index = AStore.getIndex(s);                HashSet numbers = findOrCreateIndexSet(indices,type);                int v1 = valueNumbers.getValueNumber(ref);                int v2 = valueNumbers.getValueNumber(index);                OPT_ValueNumberPair V = new OPT_ValueNumberPair(v1,v2);                if (numbers.contains(V)) {                  if (seenLoad.contains(type)) {                    resultSet.add(type);                  }                } else {                  numbers.add(V);                }              }              break;            default:              break;          }        }      }    }    return  resultSet;  }