String msg = "VM_Address array element " + i; if (VM.BuildFor32Addr) bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), (int)getAddressValue(addr, msg, true)); else if (VM.BuildFor64Addr) bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), getAddressValue(addr, msg, true));
String msg = "VM_Address array element"; bootImage.setAddressWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), getAddressValue(addr, msg, true));
  private static int copyMagicArrayToBootImage(Object jdkObject, 					       VM_Array rvmArrayType,					       boolean allocOnly, 					       int overwriteOffset, 					       Object parentObject)     throws IllegalAccessException {    //    // Return object if it is already copied and not being overwritten    //    BootImageMap.Entry mapEntry = BootImageMap.findOrCreateEntry(jdkObject);    if (mapEntry.imageOffset != OBJECT_NOT_ALLOCATED && overwriteOffset == -1)      return mapEntry.imageOffset;    if (verbose >= 2) depth++;        // allocate space in image    int arrayCount       = Array.getLength(jdkObject);    int arrayImageOffset = (overwriteOffset == -1) ? bootImage.allocateArray(rvmArrayType, arrayCount) : overwriteOffset;    mapEntry.imageOffset = arrayImageOffset;    if (verbose >= 2) {      if (depth == depthCutoff) 	say(SPACES.substring(0,depth+1), "TOO DEEP: cutting off");      else if (depth < depthCutoff) {	String tab = SPACES.substring(0,depth+1);	if (depth == 0 && jtocCount >= 0)	  tab = tab + "jtoc #" + String.valueOf(jtocCount) + ": ";	int arraySize = rvmArrayType.getInstanceSize(arrayCount);	say(tab, "Copying array  ", rvmArrayType.toString(), 	    "   length=", String.valueOf(arrayCount),	    (arraySize >= LARGE_ARRAY_SIZE) ? " large object!!!" : "");      }    }    // copy array elements from host jdk address space into image    VM_Type rvmElementType = rvmArrayType.getElementType();    if (rvmElementType.equals(VM_Type.CodeType)) {      if (VM.BuildForIA32) {	byte values[] = (byte[]) jdkObject;	for (int i = 0; i < arrayCount; ++i)	  bootImage.setByte(arrayImageOffset + i, values[i]);      } else {	int values[] = (int[]) jdkObject;	for (int i = 0; i < arrayCount; ++i)	  bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_INT), values[i]);      }    } else if (rvmElementType.equals(VM_Type.AddressType)) {      VM_Address values[] = (VM_Address[]) jdkObject;      for (int i=0; i<arrayCount; i++) {	VM_Address addr = values[i];	String msg = "VM_Address array element " + i;	if (VM.BuildFor32Addr)	  bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), 				(int)getAddressValue(addr, msg, true));	else if (VM.BuildFor64Addr)	  bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), 				  getAddressValue(addr, msg, true));      }    } else if (rvmElementType.equals(VM_Type.WordType)) {      VM_Word values[] = (VM_Word[]) jdkObject;      for (int i = 0; i < arrayCount; i++)	if (VM.BuildFor32Addr)	  bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), values[i].toInt());	else if (VM.BuildFor64Addr)	  bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), values[i].toLong());    } else if (rvmElementType.equals(VM_Type.OffsetType)) {      VM_Offset values[] = (VM_Offset[]) jdkObject;      for (int i = 0; i < arrayCount; i++)	if (VM.BuildFor32Addr)	  bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), values[i].toInt());	else if (VM.BuildFor64Addr)	  bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), values[i].toLong());    } else if (rvmElementType.equals(VM_Type.ExtentType)) {      VM_Extent values[] = (VM_Extent[]) jdkObject;      for (int i = 0; i < arrayCount; i++)	if (VM.BuildFor32Addr)	  bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), values[i].toInt());	else if (VM.BuildFor64Addr)	  bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS), values[i].toLong());    } else {      fail("unexpected magic array type: " + rvmArrayType);    }    // copy object's TIB into image, if it's not there already    if (!allocOnly) {      if (verbose >= 2) traceContext.push("", jdkObject.getClass().getName(), "tib");      int tibImageOffset = copyToBootImage(rvmArrayType.getTypeInformationBlock(), allocOnly, -1, jdkObject);      if (verbose >= 2) traceContext.pop();      if (tibImageOffset == OBJECT_NOT_ALLOCATED)	fail("can't copy tib for " + jdkObject);      int tibAddress = bootImageAddress + tibImageOffset;      VM_ObjectModel.setTIB(bootImage, mapEntry.imageOffset, VM_Address.fromIntZeroExtend(tibAddress), rvmArrayType);    }    if (verbose >= 2) depth--;        return mapEntry.imageOffset;  }