VM_TypeReference cannonical = VM_TypeReference.findOrCreate(elementType.getClassLoader(), name); resolvedType = cannonical.resolve();
VM_TypeReference canonical = VM_TypeReference.findOrCreate(elementType.getClassLoader(), name); resolvedType = canonical.resolve();
  public final synchronized VM_Type resolve() throws ClassNotFoundException {    if (resolvedType != null) return resolvedType;    if (isClassType()) {      VM_Type ans;       if (VM.runningVM) {	Class klass = classloader.loadClass(name.classNameFromDescriptor());	ans = java.lang.JikesRVMSupport.getTypeForClass(klass);      } else {	// Use a special purpose backdoor to avoid creating java.lang.Class 	// objects when not running the VM (we get host JDK Class objects and 	// that just doesn't work).	ans = ((VM_SystemClassLoader)classloader).loadVMClass(name.classNameFromDescriptor());      }      if (VM.VerifyAssertions) VM._assert(resolvedType == null || resolvedType == ans);      resolvedType = ans;    } else if (isArrayType()) {      if (isWordArrayType()) {	// Ensure that we only create one VM_Array object for each pair of names for this type.	// Do this by resolving VM_AddressArray to [VM_Addresss	resolvedType = getArrayElementType().getArrayTypeForElementType().resolve();      } else {	VM_Type elementType = getArrayElementType().resolve();	if (elementType.getClassLoader() != classloader) {	  // We aren't the cannonical type reference because the element type	  // was loaded using a different classloader. 	  // Find the cannonical type reference and ask it to resolve itself.	  VM_TypeReference cannonical = VM_TypeReference.findOrCreate(elementType.getClassLoader(), name);	  resolvedType = cannonical.resolve();	} else {	  resolvedType = new VM_Array(this, elementType);	}      }    } else {      resolvedType = new VM_Primitive(this);    }    return resolvedType;  }