types[key.id] = key;
types[-key.id] = key;
  public static synchronized VM_TypeReference findOrCreate(ClassLoader cl, VM_Atom tn)     throws IllegalArgumentException // does not need to be declared  {    VM_TypeDescriptorParsing.validateAsTypeDescriptor(tn);    // Primitives, arrays of primitives, system classes and arrays of system    // classes must use the bootstrap classloader.  Force that here so we don't    // have to worry about it anywhere else in the VM.    ClassLoader bootstrapCL = VM_BootstrapClassLoader.getBootstrapClassLoader();    if (cl == null) {      cl = bootstrapCL;    } else if (cl != bootstrapCL) {      if (tn.isClassDescriptor()) {        if (tn.isBootstrapClassDescriptor()) {          cl = bootstrapCL;        }      } else if (tn.isArrayDescriptor()) {        VM_Atom innermostElementType = tn.parseForInnermostArrayElementDescriptor();        if (innermostElementType.isClassDescriptor()) {          if (innermostElementType.isBootstrapClassDescriptor()) {            cl = bootstrapCL;          }        } else {          cl = bootstrapCL;        }      } else {        cl = bootstrapCL;      }    }    // Next actually findOrCreate the type reference using the proper classloader.    VM_TypeReference key = new VM_TypeReference(cl, tn);    VM_TypeReference val = (VM_TypeReference)dictionary.get(key);    if (val != null)  return val;    key.id = nextId++;    if (key.id == types.length) {      VM_TypeReference[] tmp = new VM_TypeReference[types.length + 500];      System.arraycopy(types, 0, tmp, 0, types.length);      types = tmp;    }    types[key.id] = key;    dictionary.put(key, key);    return key;  }