Program: 150271
Project: 150271
Buggy source:
/** 
 * Copy an object (and, recursively, any of its fields or elements that are references) from host jdk address space into image.
 * @param jdkObject object to be copied
 * @param if allocOnly is true, the TIB and other reference fields are not recursively copied
 * @param if overwriteOffset is > 0, then copy object to given address
 * @return offset of copied object within image, in bytes(OBJECT_NOT_PRESENT --> object not copied: it's not part of bootimage)
 */
private static int copyToBootImage(Object jdkObject,boolean allocOnly,int overwriteOffset,Object parentObject) throws IllegalAccessException {
  BootImageMap.Entry mapEntry=BootImageMap.findOrCreateEntry(jdkObject);
  if (mapEntry.imageOffset != OBJECT_NOT_ALLOCATED && overwriteOffset == -1)   return mapEntry.imageOffset;
  if (verbose >= 2)   depth++;
  Class jdkType=jdkObject.getClass();
  VM_Type rvmType=getRvmType(jdkType);
  if (rvmType == null) {
    if (verbose >= 2)     traverseObject(jdkObject);
    if (verbose >= 2)     depth--;
    return OBJECT_NOT_PRESENT;
  }
  if (jdkType.isArray()) {
    VM_Array rvmArrayType=rvmType.asArray();
    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),"String_Node_Str");
 else       if (depth < depthCutoff) {
        String tab=SPACES.substring(0,depth + 1);
        if (depth == 0 && jtocCount >= 0)         tab=tab + "String_Node_Str" + String.valueOf(jtocCount)+ "String_Node_Str";
        int arraySize=rvmArrayType.getInstanceSize(arrayCount);
        say(tab,"String_Node_Str",jdkType.getName(),"String_Node_Str",String.valueOf(arrayCount),(arraySize >= LARGE_ARRAY_SIZE) ? "String_Node_Str" : "String_Node_Str");
      }
    }
    VM_Type rvmElementType=rvmArrayType.getElementType();
    if (false && rvmElementType.equals(VM_Type.IntType)) {
      if (parentObject != null) {
        Class parentObjectType=parentObject.getClass();
        VM.sysWrite("String_Node_Str",4 * ((int[])jdkObject).length);
        VM.sysWriteln("String_Node_Str",parentObjectType.toString());
      }
 else {
        VM.sysWriteln("String_Node_Str");
      }
    }
    if (rvmElementType.isPrimitiveType()) {
      if (rvmElementType.equals(VM_Type.BooleanType)) {
        boolean values[]=(boolean[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setByte(arrayImageOffset + i,values[i] ? 1 : 0);
      }
 else       if (rvmElementType.equals(VM_Type.ByteType)) {
        byte values[]=(byte[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setByte(arrayImageOffset + i,values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.CharType)) {
        char values[]=(char[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setHalfWord(arrayImageOffset + (i << LOG_BYTES_IN_CHAR),values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.ShortType)) {
        short values[]=(short[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setHalfWord(arrayImageOffset + (i << LOG_BYTES_IN_SHORT),values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.IntType)) {
        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.LongType)) {
        long values[]=(long[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_LONG),values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.FloatType)) {
        float values[]=(float[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_FLOAT),Float.floatToIntBits(values[i]));
      }
 else       if (rvmElementType.equals(VM_Type.DoubleType)) {
        double values[]=(double[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_DOUBLE),Double.doubleToLongBits(values[i]));
      }
 else       fail("String_Node_Str" + rvmArrayType);
    }
 else {
      Object values[]=(Object[])jdkObject;
      Class jdkClass=jdkObject.getClass();
      if (!allocOnly) {
        for (int i=0; i < arrayCount; ++i) {
          if (values[i] != null) {
            if (verbose >= 2)             traceContext.push(values[i].getClass().getName(),jdkClass.getName(),i);
            int imageOffset=copyToBootImage(values[i],allocOnly,-1,jdkObject);
            if (imageOffset == OBJECT_NOT_PRESENT) {
              if (verbose >= 2)               traceContext.traceObjectNotInBootImage();
              bootImage.setNullAddressWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS));
            }
 else {
              bootImage.setAddressWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS),bootImageAddress + imageOffset);
            }
            if (verbose >= 2)             traceContext.pop();
          }
        }
      }
    }
  }
 else {
    if (rvmType == VM_Type.AddressArrayType) {
      if (verbose >= 2)       depth--;
      VM_AddressArray addrArray=(VM_AddressArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.OffsetArrayType) {
      if (verbose >= 2)       depth--;
      VM_OffsetArray addrArray=(VM_OffsetArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.WordArrayType) {
      if (verbose >= 2)       depth--;
      VM_WordArray addrArray=(VM_WordArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.ExtentArrayType) {
      if (verbose >= 2)       depth--;
      VM_ExtentArray addrArray=(VM_ExtentArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.CodeArrayType) {
      if (verbose >= 2)       depth--;
      VM_CodeArray codeArray=(VM_CodeArray)jdkObject;
      Object backing=codeArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType.isMagicType()) {
      VM.sysWriteln("String_Node_Str" + rvmType.getDescriptor().toString());
      VM.sysFail("String_Node_Str");
    }
    VM_Class rvmScalarType=rvmType.asClass();
    int scalarImageOffset=(overwriteOffset == -1) ? bootImage.allocateScalar(rvmScalarType) : overwriteOffset;
    mapEntry.imageOffset=scalarImageOffset;
    if (verbose >= 2) {
      if (depth == depthCutoff)       say(SPACES.substring(0,depth + 1),"String_Node_Str");
 else       if (depth < depthCutoff) {
        String tab=SPACES.substring(0,depth + 1);
        if (depth == 0 && jtocCount >= 0)         tab=tab + "String_Node_Str" + String.valueOf(jtocCount)+ "String_Node_Str";
        int scalarSize=rvmScalarType.getInstanceSize();
        say(tab,"String_Node_Str",jdkType.getName(),"String_Node_Str",String.valueOf(scalarSize),(scalarSize >= LARGE_SCALAR_SIZE) ? "String_Node_Str" : "String_Node_Str");
      }
    }
    VM_Field[] rvmFields=rvmScalarType.getInstanceFields();
    for (int i=0, n=rvmFields.length; i < n; ++i) {
      VM_Field rvmField=rvmFields[i];
      VM_TypeReference rvmFieldType=rvmField.getType();
      int rvmFieldOffset=scalarImageOffset + rvmField.getOffset();
      String rvmFieldName=rvmField.getName().toString();
      Field jdkFieldAcc=getJdkFieldAccessor(jdkType,i,INSTANCE_FIELD);
      if (jdkFieldAcc == null) {
        if (verbose >= 2)         traceContext.push(rvmFieldType.toString(),jdkType.getName(),rvmFieldName);
        if (verbose >= 2)         traceContext.traceFieldNotInHostJdk();
        if (verbose >= 2)         traceContext.pop();
        if (rvmFieldType.isPrimitiveType()) switch (rvmField.getType().getSize()) {
case 4:
          bootImage.setFullWord(rvmFieldOffset,0);
        break;
case 8:
      bootImage.setDoubleWord(rvmFieldOffset,0L);
    break;
default :
  fail("String_Node_Str" + rvmFieldType);
break;
}
 else bootImage.setNullAddressWord(rvmFieldOffset);
continue;
}
if (rvmFieldType.isPrimitiveType()) {
if (rvmFieldType.isBooleanType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getBoolean(jdkObject) ? 1 : 0);
}
 else if (rvmFieldType.isByteType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getByte(jdkObject));
}
 else if (rvmFieldType.isCharType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getChar(jdkObject));
}
 else if (rvmFieldType.isShortType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getShort(jdkObject));
}
 else if (rvmFieldType.isIntType()) {
try {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getInt(jdkObject));
}
 catch (IllegalArgumentException ex) {
System.err.println("String_Node_Str" + rvmScalarType + "String_Node_Str"+ rvmField);
throw ex;
}
}
 else if (rvmFieldType.isLongType()) {
bootImage.setDoubleWord(rvmFieldOffset,jdkFieldAcc.getLong(jdkObject));
}
 else if (rvmFieldType.isFloatType()) {
float f=jdkFieldAcc.getFloat(jdkObject);
bootImage.setFullWord(rvmFieldOffset,Float.floatToIntBits(f));
}
 else if (rvmFieldType.isDoubleType()) {
double d=jdkFieldAcc.getDouble(jdkObject);
bootImage.setDoubleWord(rvmFieldOffset,Double.doubleToLongBits(d));
}
 else if (rvmFieldType.equals(VM_TypeReference.Address)) {
Object o=jdkFieldAcc.get(jdkObject);
VM_Address addr=(VM_Address)o;
String msg="String_Node_Str" + rvmField.toString();
bootImage.setAddressWord(rvmFieldOffset,getAddressValue(addr,msg,true));
}
 else if (rvmFieldType.equals(VM_TypeReference.Word)) {
VM_Word w=(VM_Word)jdkFieldAcc.get(jdkObject);
int val=w == null ? 0 : w.toInt();
VM_Statics.setSlotContents(rvmFieldOffset,val);
}
 else if (rvmFieldType.equals(VM_TypeReference.Offset)) {
VM_Offset o=(VM_Offset)jdkFieldAcc.get(jdkObject);
int val=o == null ? 0 : o.toInt();
VM_Statics.setSlotContents(rvmFieldOffset,val);
}
 else if (rvmFieldType.equals(VM_TypeReference.Extent)) {
VM_Extent e=(VM_Extent)jdkFieldAcc.get(jdkObject);
int val=e == null ? 0 : e.toInt();
VM_Statics.setSlotContents(rvmFieldOffset,val);
}
 else {
fail("String_Node_Str" + rvmFieldType);
}
}
 else {
Object value=jdkFieldAcc.get(jdkObject);
if (!allocOnly && value != null) {
Class jdkClass=jdkFieldAcc.getDeclaringClass();
if (verbose >= 2) traceContext.push(value.getClass().getName(),jdkClass.getName(),jdkFieldAcc.getName());
int imageOffset=copyToBootImage(value,allocOnly,-1,jdkObject);
if (imageOffset == OBJECT_NOT_PRESENT) {
if (verbose >= 2) traceContext.traceObjectNotInBootImage();
bootImage.setNullAddressWord(rvmFieldOffset);
}
 else bootImage.setAddressWord(rvmFieldOffset,bootImageAddress + imageOffset);
if (verbose >= 2) traceContext.pop();
}
}
}
}
if (!allocOnly) {
if (verbose >= 2) traceContext.push("String_Node_Str",jdkObject.getClass().getName(),"String_Node_Str");
int tibImageOffset=copyToBootImage(rvmType.getTypeInformationBlock(),allocOnly,-1,jdkObject);
if (verbose >= 2) traceContext.pop();
if (tibImageOffset == OBJECT_NOT_ALLOCATED) fail("String_Node_Str" + jdkObject);
int tibAddress=bootImageAddress + tibImageOffset;
VM_ObjectModel.setTIB(bootImage,mapEntry.imageOffset,VM_Address.fromIntZeroExtend(tibAddress),rvmType);
}
if (verbose >= 2) depth--;
return mapEntry.imageOffset;
}

Fixed version (ground truth):
/** 
 * Copy an object (and, recursively, any of its fields or elements that are references) from host jdk address space into image.
 * @param jdkObject object to be copied
 * @param if allocOnly is true, the TIB and other reference fields are not recursively copied
 * @param if overwriteOffset is > 0, then copy object to given address
 * @return offset of copied object within image, in bytes(OBJECT_NOT_PRESENT --> object not copied: it's not part of bootimage)
 */
private static int copyToBootImage(Object jdkObject,boolean allocOnly,int overwriteOffset,Object parentObject) throws IllegalAccessException {
  BootImageMap.Entry mapEntry=BootImageMap.findOrCreateEntry(jdkObject);
  if (mapEntry.imageOffset != OBJECT_NOT_ALLOCATED && overwriteOffset == -1)   return mapEntry.imageOffset;
  if (verbose >= 2)   depth++;
  Class jdkType=jdkObject.getClass();
  VM_Type rvmType=getRvmType(jdkType);
  if (rvmType == null) {
    if (verbose >= 2)     traverseObject(jdkObject);
    if (verbose >= 2)     depth--;
    return OBJECT_NOT_PRESENT;
  }
  if (jdkType.isArray()) {
    VM_Array rvmArrayType=rvmType.asArray();
    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),"String_Node_Str");
 else       if (depth < depthCutoff) {
        String tab=SPACES.substring(0,depth + 1);
        if (depth == 0 && jtocCount >= 0)         tab=tab + "String_Node_Str" + String.valueOf(jtocCount)+ "String_Node_Str";
        int arraySize=rvmArrayType.getInstanceSize(arrayCount);
        say(tab,"String_Node_Str",jdkType.getName(),"String_Node_Str",String.valueOf(arrayCount),(arraySize >= LARGE_ARRAY_SIZE) ? "String_Node_Str" : "String_Node_Str");
      }
    }
    VM_Type rvmElementType=rvmArrayType.getElementType();
    if (false && rvmElementType.equals(VM_Type.IntType)) {
      if (parentObject != null) {
        Class parentObjectType=parentObject.getClass();
        VM.sysWrite("String_Node_Str",4 * ((int[])jdkObject).length);
        VM.sysWriteln("String_Node_Str",parentObjectType.toString());
      }
 else {
        VM.sysWriteln("String_Node_Str");
      }
    }
    if (rvmElementType.isPrimitiveType()) {
      if (rvmElementType.equals(VM_Type.BooleanType)) {
        boolean values[]=(boolean[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setByte(arrayImageOffset + i,values[i] ? 1 : 0);
      }
 else       if (rvmElementType.equals(VM_Type.ByteType)) {
        byte values[]=(byte[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setByte(arrayImageOffset + i,values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.CharType)) {
        char values[]=(char[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setHalfWord(arrayImageOffset + (i << LOG_BYTES_IN_CHAR),values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.ShortType)) {
        short values[]=(short[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setHalfWord(arrayImageOffset + (i << LOG_BYTES_IN_SHORT),values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.IntType)) {
        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.LongType)) {
        long values[]=(long[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_LONG),values[i]);
      }
 else       if (rvmElementType.equals(VM_Type.FloatType)) {
        float values[]=(float[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setFullWord(arrayImageOffset + (i << LOG_BYTES_IN_FLOAT),Float.floatToIntBits(values[i]));
      }
 else       if (rvmElementType.equals(VM_Type.DoubleType)) {
        double values[]=(double[])jdkObject;
        for (int i=0; i < arrayCount; ++i)         bootImage.setDoubleWord(arrayImageOffset + (i << LOG_BYTES_IN_DOUBLE),Double.doubleToLongBits(values[i]));
      }
 else       fail("String_Node_Str" + rvmArrayType);
    }
 else {
      Object values[]=(Object[])jdkObject;
      Class jdkClass=jdkObject.getClass();
      if (!allocOnly) {
        for (int i=0; i < arrayCount; ++i) {
          if (values[i] != null) {
            if (verbose >= 2)             traceContext.push(values[i].getClass().getName(),jdkClass.getName(),i);
            int imageOffset=copyToBootImage(values[i],allocOnly,-1,jdkObject);
            if (imageOffset == OBJECT_NOT_PRESENT) {
              if (verbose >= 2)               traceContext.traceObjectNotInBootImage();
              bootImage.setNullAddressWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS));
            }
 else {
              bootImage.setAddressWord(arrayImageOffset + (i << LOG_BYTES_IN_ADDRESS),bootImageAddress + imageOffset);
            }
            if (verbose >= 2)             traceContext.pop();
          }
        }
      }
    }
  }
 else {
    if (rvmType == VM_Type.AddressArrayType) {
      if (verbose >= 2)       depth--;
      VM_AddressArray addrArray=(VM_AddressArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.OffsetArrayType) {
      if (verbose >= 2)       depth--;
      VM_OffsetArray addrArray=(VM_OffsetArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.WordArrayType) {
      if (verbose >= 2)       depth--;
      VM_WordArray addrArray=(VM_WordArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.ExtentArrayType) {
      if (verbose >= 2)       depth--;
      VM_ExtentArray addrArray=(VM_ExtentArray)jdkObject;
      Object backing=addrArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType == VM_Type.CodeArrayType) {
      if (verbose >= 2)       depth--;
      VM_CodeArray codeArray=(VM_CodeArray)jdkObject;
      Object backing=codeArray.getBacking();
      return copyMagicArrayToBootImage(backing,rvmType.asArray(),allocOnly,overwriteOffset,parentObject);
    }
    if (rvmType.isMagicType()) {
      VM.sysWriteln("String_Node_Str" + rvmType.getDescriptor().toString());
      VM.sysFail("String_Node_Str");
    }
    VM_Class rvmScalarType=rvmType.asClass();
    int scalarImageOffset=(overwriteOffset == -1) ? bootImage.allocateScalar(rvmScalarType) : overwriteOffset;
    mapEntry.imageOffset=scalarImageOffset;
    if (verbose >= 2) {
      if (depth == depthCutoff)       say(SPACES.substring(0,depth + 1),"String_Node_Str");
 else       if (depth < depthCutoff) {
        String tab=SPACES.substring(0,depth + 1);
        if (depth == 0 && jtocCount >= 0)         tab=tab + "String_Node_Str" + String.valueOf(jtocCount)+ "String_Node_Str";
        int scalarSize=rvmScalarType.getInstanceSize();
        say(tab,"String_Node_Str",jdkType.getName(),"String_Node_Str",String.valueOf(scalarSize),(scalarSize >= LARGE_SCALAR_SIZE) ? "String_Node_Str" : "String_Node_Str");
      }
    }
    VM_Field[] rvmFields=rvmScalarType.getInstanceFields();
    for (int i=0, n=rvmFields.length; i < n; ++i) {
      VM_Field rvmField=rvmFields[i];
      VM_TypeReference rvmFieldType=rvmField.getType();
      int rvmFieldOffset=scalarImageOffset + rvmField.getOffset();
      String rvmFieldName=rvmField.getName().toString();
      Field jdkFieldAcc=getJdkFieldAccessor(jdkType,i,INSTANCE_FIELD);
      if (jdkFieldAcc == null) {
        if (verbose >= 2)         traceContext.push(rvmFieldType.toString(),jdkType.getName(),rvmFieldName);
        if (verbose >= 2)         traceContext.traceFieldNotInHostJdk();
        if (verbose >= 2)         traceContext.pop();
        if (rvmFieldType.isPrimitiveType()) switch (rvmField.getType().getSize()) {
case 4:
          bootImage.setFullWord(rvmFieldOffset,0);
        break;
case 8:
      bootImage.setDoubleWord(rvmFieldOffset,0L);
    break;
default :
  fail("String_Node_Str" + rvmFieldType);
break;
}
 else bootImage.setNullAddressWord(rvmFieldOffset);
continue;
}
if (rvmFieldType.isPrimitiveType()) {
if (rvmFieldType.isBooleanType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getBoolean(jdkObject) ? 1 : 0);
}
 else if (rvmFieldType.isByteType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getByte(jdkObject));
}
 else if (rvmFieldType.isCharType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getChar(jdkObject));
}
 else if (rvmFieldType.isShortType()) {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getShort(jdkObject));
}
 else if (rvmFieldType.isIntType()) {
try {
bootImage.setFullWord(rvmFieldOffset,jdkFieldAcc.getInt(jdkObject));
}
 catch (IllegalArgumentException ex) {
System.err.println("String_Node_Str" + rvmScalarType + "String_Node_Str"+ rvmField);
throw ex;
}
}
 else if (rvmFieldType.isLongType()) {
bootImage.setDoubleWord(rvmFieldOffset,jdkFieldAcc.getLong(jdkObject));
}
 else if (rvmFieldType.isFloatType()) {
float f=jdkFieldAcc.getFloat(jdkObject);
bootImage.setFullWord(rvmFieldOffset,Float.floatToIntBits(f));
}
 else if (rvmFieldType.isDoubleType()) {
double d=jdkFieldAcc.getDouble(jdkObject);
bootImage.setDoubleWord(rvmFieldOffset,Double.doubleToLongBits(d));
}
 else if (rvmFieldType.equals(VM_TypeReference.Address) || rvmFieldType.equals(VM_TypeReference.Word) || rvmFieldType.equals(VM_TypeReference.Extent)|| rvmFieldType.equals(VM_TypeReference.Offset)) {
Object o=jdkFieldAcc.get(jdkObject);
String msg="String_Node_Str" + rvmField.toString();
boolean warn=rvmFieldType.equals(VM_TypeReference.Address);
bootImage.setAddressWord(rvmFieldOffset,getAddressValue(o,msg,warn));
}
 else {
fail("String_Node_Str" + rvmFieldType);
}
}
 else {
Object value=jdkFieldAcc.get(jdkObject);
if (!allocOnly && value != null) {
Class jdkClass=jdkFieldAcc.getDeclaringClass();
if (verbose >= 2) traceContext.push(value.getClass().getName(),jdkClass.getName(),jdkFieldAcc.getName());
int imageOffset=copyToBootImage(value,allocOnly,-1,jdkObject);
if (imageOffset == OBJECT_NOT_PRESENT) {
if (verbose >= 2) traceContext.traceObjectNotInBootImage();
bootImage.setNullAddressWord(rvmFieldOffset);
}
 else bootImage.setAddressWord(rvmFieldOffset,bootImageAddress + imageOffset);
if (verbose >= 2) traceContext.pop();
}
}
}
}
if (!allocOnly) {
if (verbose >= 2) traceContext.push("String_Node_Str",jdkObject.getClass().getName(),"String_Node_Str");
int tibImageOffset=copyToBootImage(rvmType.getTypeInformationBlock(),allocOnly,-1,jdkObject);
if (verbose >= 2) traceContext.pop();
if (tibImageOffset == OBJECT_NOT_ALLOCATED) fail("String_Node_Str" + jdkObject);
int tibAddress=bootImageAddress + tibImageOffset;
VM_ObjectModel.setTIB(bootImage,mapEntry.imageOffset,VM_Address.fromIntZeroExtend(tibAddress),rvmType);
}
if (verbose >= 2) depth--;
return mapEntry.imageOffset;
}