Program: 149956
Project: 149956
Buggy source:
/** 
 * Create (in host jdk address space) the rvm objects that will be needed at run time to execute enough of the virtual machine to dynamically load and compile the remainder of itself. Side effect: rvm objects are created in host jdk address space VM_Statics is populated "bootImageTypes" dictionary is populated with name/type pairs
 * @param typeNames names of rvm classes whose static fields will containthe objects comprising the virtual machine bootimage
 */
public static void createBootImageObjects(Vector typeNames,String bootImageTypeNamesFile) throws IllegalAccessException, ClassNotFoundException {
  VM_Callbacks.notifyBootImage(typeNames.elements());
  long startTime=0;
  long stopTime=0;
  if (verbose >= 1)   say("String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  for (Enumeration e=typeNames.elements(); e.hasMoreElements(); ) {
    String typeName=(String)e.nextElement();
    if (verbose >= 4)     say("String_Node_Str",typeName);
    VM_Type type;
    try {
      VM_TypeReference tRef=VM_TypeReference.findOrCreate(typeName);
      type=tRef.resolve();
    }
 catch (    NoClassDefFoundError ncdf) {
      ncdf.printStackTrace();
      fail(bootImageTypeNamesFile + "String_Node_Str" + typeName+ "String_Node_Str"+ ncdf);
      return;
    }
catch (    IllegalArgumentException ila) {
      ila.printStackTrace();
      fail(bootImageTypeNamesFile + "String_Node_Str" + typeName+ "String_Node_Str"+ ila);
      return;
    }
    type.markAsBootImageClass();
    typeName=typeName.replace('/','.');
    if (typeName.startsWith("String_Node_Str"))     typeName=typeName.substring(1,typeName.length() - 1);
    bootImageTypes.put(typeName,type);
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  if (verbose >= 1)   say(String.valueOf(bootImageTypes.size()),"String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  if (verbose >= 1)   say("String_Node_Str");
  for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
    VM_Type type=(VM_Type)e.nextElement();
    if (verbose >= 2)     say("String_Node_Str" + type);
    type.resolve();
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  VM_BootRecord bootRecord=VM_BootRecord.the_boot_record;
  VM_Class rvmBRType=getRvmType(bootRecord.getClass()).asClass();
  VM_Array intArrayType=VM_Array.getPrimitiveArrayType(10);
  Address brAddress=bootImage.allocateDataStorage(rvmBRType.getInstanceSize(),VM_ObjectModel.getAlignment(rvmBRType),VM_ObjectModel.getOffsetForAlignment(rvmBRType));
  Address jtocAddress=bootImage.allocateDataStorage(intArrayType.getInstanceSize(0),VM_ObjectModel.getAlignment(intArrayType),VM_ObjectModel.getOffsetForAlignment(intArrayType));
  bootImage.resetAllocator();
  bootRecord.tocRegister=jtocAddress.plus(intArrayType.getInstanceSize(VM_Statics.middleOfTable));
  if (profile)   startTime=System.currentTimeMillis();
  if (verbose >= 1)   say("String_Node_Str");
  if (numThreads == 1) {
    int count=0;
    for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
      VM_Type type=(VM_Type)e.nextElement();
      count++;
      long start2=System.currentTimeMillis();
      if (verbose >= 1)       say(startTime + "String_Node_Str" + count+ "String_Node_Str"+ type);
      type.instantiate();
      long stop2=System.currentTimeMillis();
      if (verbose >= 1)       say(stop2 + "String_Node_Str" + count+ "String_Node_Str"+ type+ "String_Node_Str"+ (stop2 - start2)+ "String_Node_Str");
      if (profile && stop2 - start2 > classCompileThreshold)       System.out.println("String_Node_Str" + type + "String_Node_Str"+ ((stop2 - start2 + 500) / 1000)+ "String_Node_Str");
    }
  }
 else {
    say("String_Node_Str" + numThreads + "String_Node_Str");
    BootImageWorker.startup(bootImageTypes.elements());
    BootImageWorker[] workers=new BootImageWorker[numThreads];
    for (int i=0; i < workers.length; i++) {
      workers[i]=new BootImageWorker();
      workers[i].id=i;
      workers[i].setName("String_Node_Str" + i);
      workers[i].start();
    }
    try {
      for (int i=0; i < workers.length; i++) {
        workers[i].join();
      }
    }
 catch (    InterruptedException ie) {
      say("String_Node_Str");
    }
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  VM_Statics.bootImageInstantiationFinished();
  VM_CodeArray[] functionTable=BuildJNIFunctionTable.buildTable();
  VM_JNIEnvironment.initFunctionTable(functionTable);
  if (verbose >= 1)   say("String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  bootImageTypeFields=new HashMap(bootImageTypes.size());
  for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
    VM_Type rvmType=(VM_Type)e.nextElement();
    FieldInfo fieldInfo;
    if (!rvmType.isClassType())     continue;
    Class jdkType=getJdkType(rvmType);
    if (jdkType == null)     continue;
    Key key=new Key(jdkType);
    fieldInfo=(FieldInfo)bootImageTypeFields.get(key);
    if (fieldInfo != null) {
      fieldInfo.rvmType=rvmType;
    }
 else {
      if (verbose >= 1)       say("String_Node_Str" + rvmType);
      fieldInfo=new FieldInfo(jdkType,rvmType);
      bootImageTypeFields.put(key,fieldInfo);
      for (Class cls=jdkType.getSuperclass(); cls != null; cls=cls.getSuperclass()) {
        key=new Key(cls);
        fieldInfo=(FieldInfo)bootImageTypeFields.get(key);
        if (fieldInfo != null) {
          break;
        }
 else {
          if (verbose >= 1)           say("String_Node_Str" + jdkType);
          fieldInfo=new FieldInfo(cls,null);
          bootImageTypeFields.put(key,fieldInfo);
        }
      }
    }
  }
  for (Iterator iter=bootImageTypeFields.values().iterator(); iter.hasNext(); ) {
    FieldInfo fieldInfo=(FieldInfo)iter.next();
    VM_Type rvmType=fieldInfo.rvmType;
    if (rvmType == null) {
      if (verbose >= 1)       say("String_Node_Str" + fieldInfo.jdkType);
      continue;
    }
    Class jdkType=fieldInfo.jdkType;
    if (verbose >= 1)     say("String_Node_Str" + rvmType);
    VM_Field rvmFields[]=rvmType.getStaticFields();
    fieldInfo.jdkStaticFields=new Field[rvmFields.length];
    for (int j=0; j < rvmFields.length; j++) {
      String rvmName=rvmFields[j].getName().toString();
      for (int k=0; k < fieldInfo.jdkFields.length; k++) {
        Field f=fieldInfo.jdkFields[k];
        if (f.getName().equals(rvmName)) {
          fieldInfo.jdkStaticFields[j]=f;
          f.setAccessible(true);
          break;
        }
      }
    }
    rvmFields=rvmType.getInstanceFields();
    fieldInfo.jdkInstanceFields=new Field[rvmFields.length];
    for (int j=0; j < rvmFields.length; j++) {
      String rvmName=rvmFields[j].getName().toString();
      jdkType=getJdkType(rvmFields[j].getDeclaringClass());
      if (jdkType == null)       continue;
      FieldInfo jdkFieldInfo=(FieldInfo)bootImageTypeFields.get(new Key(jdkType));
      if (jdkFieldInfo == null)       continue;
      Field[] jdkFields=jdkFieldInfo.jdkFields;
      for (int k=0; k < jdkFields.length; k++) {
        Field f=jdkFields[k];
        if (f.getName().equals(rvmName)) {
          fieldInfo.jdkInstanceFields[j]=f;
          f.setAccessible(true);
          break;
        }
      }
    }
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  int initProc=VM_Scheduler.PRIMORDIAL_PROCESSOR_ID;
  VM_Thread startupThread=new VM_Thread(new byte[STACK_SIZE_BOOT],null,"String_Node_Str");
  VM_Scheduler.processors[initProc].activeThread=startupThread;
  int idx=startupThread.stack.length - 1;
  if (VM.LittleEndian) {
    startupThread.stack[idx--]=(byte)0xde;
    startupThread.stack[idx--]=(byte)0xad;
    startupThread.stack[idx--]=(byte)0xba;
    startupThread.stack[idx--]=(byte)0xbe;
  }
 else {
    startupThread.stack[idx--]=(byte)0xbe;
    startupThread.stack[idx--]=(byte)0xba;
    startupThread.stack[idx--]=(byte)0xad;
    startupThread.stack[idx--]=(byte)0xde;
  }
  VM_BootstrapClassLoader.setBootstrapRepositories(bootImageRepositoriesAtExecutionTime);
  if (verbose >= 1)   say("String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
    VM_Type rvmType=(VM_Type)e.nextElement();
    if (verbose >= 1)     say("String_Node_Str",rvmType.toString());
    if (!rvmType.isClassType())     continue;
    Class jdkType=getJdkType(rvmType);
    if (jdkType == null && verbose >= 1) {
      say("String_Node_Str" + rvmType + "String_Node_Str");
    }
    VM_Field rvmFields[]=rvmType.getStaticFields();
    for (int j=0; j < rvmFields.length; ++j) {
      VM_Field rvmField=rvmFields[j];
      VM_TypeReference rvmFieldType=rvmField.getType();
      Offset rvmFieldOffset=rvmField.getOffset();
      String rvmFieldName=rvmField.getName().toString();
      Field jdkFieldAcc=null;
      if (jdkType != null)       jdkFieldAcc=getJdkFieldAccessor(jdkType,j,STATIC_FIELD);
      if (jdkFieldAcc == null) {
        if (jdkType != null) {
          if (!copyKnownClasspathStaticField(jdkType,rvmFieldName,rvmFieldType,rvmFieldOffset)) {
            if (verbose >= 2) {
              traceContext.push(rvmFieldType.toString(),jdkType.getName(),rvmFieldName);
              traceContext.traceFieldNotInHostJdk();
              traceContext.pop();
            }
            VM_Statics.setSlotContents(rvmFieldOffset,0);
            if (!VM.runningTool)             bootImage.countNulledReference();
          }
        }
 else {
          if (verbose >= 2) {
            traceContext.push(rvmFieldType.toString(),rvmFieldType.toString(),rvmFieldName);
            traceContext.traceFieldNotInHostJdk();
            traceContext.pop();
          }
          VM_Statics.setSlotContents(rvmFieldOffset,0);
          if (!VM.runningTool)           bootImage.countNulledReference();
        }
        continue;
      }
      if (!Modifier.isStatic(jdkFieldAcc.getModifiers())) {
        if (verbose >= 2)         traceContext.push(rvmFieldType.toString(),jdkType.getName(),rvmFieldName);
        if (verbose >= 2)         traceContext.traceFieldNotStaticInHostJdk();
        if (verbose >= 2)         traceContext.pop();
        VM_Statics.setSlotContents(rvmFieldOffset,0);
        if (!VM.runningTool)         bootImage.countNulledReference();
        continue;
      }
      if (verbose >= 2)       say("String_Node_Str",String.valueOf(VM_Statics.offsetAsSlot(rvmFieldOffset)),"String_Node_Str",rvmField.toString());
      if (rvmFieldType.isPrimitiveType()) {
        if (rvmFieldType.isBooleanType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getBoolean(null) ? 1 : 0);
        }
 else         if (rvmFieldType.isByteType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getByte(null));
        }
 else         if (rvmFieldType.isCharType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getChar(null));
        }
 else         if (rvmFieldType.isShortType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getShort(null));
        }
 else         if (rvmFieldType.isIntType()) {
          try {
            VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getInt(null));
          }
 catch (          IllegalArgumentException ex) {
            System.err.println("String_Node_Str" + rvmType + "String_Node_Str"+ rvmField);
            throw ex;
          }
        }
 else         if (rvmFieldType.isLongType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getLong(null));
        }
 else         if (rvmFieldType.isFloatType()) {
          float f=jdkFieldAcc.getFloat(null);
          VM_Statics.setSlotContents(rvmFieldOffset,Float.floatToIntBits(f));
        }
 else         if (rvmFieldType.isDoubleType()) {
          double d=jdkFieldAcc.getDouble(null);
          VM_Statics.setSlotContents(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(null);
          String msg="String_Node_Str" + rvmField.toString();
          boolean warn=rvmFieldType.equals(VM_TypeReference.Address);
          VM_Statics.setSlotContents(rvmFieldOffset,getWordValue(o,msg,warn));
        }
 else {
          fail("String_Node_Str" + rvmFieldType);
        }
      }
 else {
        if (jdkFieldAcc == null)         fail("String_Node_Str");
        int modifs=jdkFieldAcc.getModifiers();
        if (!Modifier.isStatic(modifs))         fail("String_Node_Str" + jdkFieldAcc.toString());
        Object o;
        try {
          o=jdkFieldAcc.get(null);
        }
 catch (        NullPointerException npe) {
          fail("String_Node_Str" + jdkFieldAcc.toString() + "String_Node_Str"+ npe.toString());
          o=null;
        }
        if (verbose >= 3)         say("String_Node_Str",VM.addressAsHexString(VM_Magic.objectAsAddress(o)));
        VM_Statics.setSlotContents(rvmFieldOffset,o);
      }
    }
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Create (in host jdk address space) the rvm objects that will be needed at run time to execute enough of the virtual machine to dynamically load and compile the remainder of itself. Side effect: rvm objects are created in host jdk address space VM_Statics is populated "bootImageTypes" dictionary is populated with name/type pairs
 * @param typeNames names of rvm classes whose static fields will containthe objects comprising the virtual machine bootimage
 */
public static void createBootImageObjects(Vector typeNames,String bootImageTypeNamesFile) throws IllegalAccessException, ClassNotFoundException {
  VM_Callbacks.notifyBootImage(typeNames.elements());
  long startTime=0;
  long stopTime=0;
  if (verbose >= 1)   say("String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  for (Enumeration e=typeNames.elements(); e.hasMoreElements(); ) {
    String typeName=(String)e.nextElement();
    if (verbose >= 4)     say("String_Node_Str",typeName);
    VM_Type type;
    try {
      VM_TypeReference tRef=VM_TypeReference.findOrCreate(typeName);
      type=tRef.resolve();
    }
 catch (    NoClassDefFoundError ncdf) {
      ncdf.printStackTrace();
      fail(bootImageTypeNamesFile + "String_Node_Str" + typeName+ "String_Node_Str"+ ncdf);
      return;
    }
catch (    IllegalArgumentException ila) {
      ila.printStackTrace();
      fail(bootImageTypeNamesFile + "String_Node_Str" + typeName+ "String_Node_Str"+ ila);
      return;
    }
    type.markAsBootImageClass();
    typeName=typeName.replace('/','.');
    if (typeName.startsWith("String_Node_Str"))     typeName=typeName.substring(1,typeName.length() - 1);
    bootImageTypes.put(typeName,type);
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  if (verbose >= 1)   say(String.valueOf(bootImageTypes.size()),"String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  if (verbose >= 1)   say("String_Node_Str");
  for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
    VM_Type type=(VM_Type)e.nextElement();
    if (verbose >= 2)     say("String_Node_Str" + type);
    type.resolve();
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  VM_BootRecord bootRecord=VM_BootRecord.the_boot_record;
  VM_Class rvmBRType=getRvmType(bootRecord.getClass()).asClass();
  VM_Array intArrayType=VM_Array.getPrimitiveArrayType(10);
  bootImage.allocateDataStorage(rvmBRType.getInstanceSize(),VM_ObjectModel.getAlignment(rvmBRType),VM_ObjectModel.getOffsetForAlignment(rvmBRType));
  Address jtocAddress=bootImage.allocateDataStorage(intArrayType.getInstanceSize(0),VM_ObjectModel.getAlignment(intArrayType),VM_ObjectModel.getOffsetForAlignment(intArrayType));
  bootImage.resetAllocator();
  bootRecord.tocRegister=jtocAddress.plus(intArrayType.getInstanceSize(VM_Statics.middleOfTable));
  if (profile)   startTime=System.currentTimeMillis();
  if (verbose >= 1)   say("String_Node_Str");
  if (numThreads == 1) {
    int count=0;
    for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
      VM_Type type=(VM_Type)e.nextElement();
      count++;
      long start2=System.currentTimeMillis();
      if (verbose >= 1)       say(startTime + "String_Node_Str" + count+ "String_Node_Str"+ type);
      type.instantiate();
      long stop2=System.currentTimeMillis();
      if (verbose >= 1)       say(stop2 + "String_Node_Str" + count+ "String_Node_Str"+ type+ "String_Node_Str"+ (stop2 - start2)+ "String_Node_Str");
      if (profile && stop2 - start2 > classCompileThreshold)       System.out.println("String_Node_Str" + type + "String_Node_Str"+ ((stop2 - start2 + 500) / 1000)+ "String_Node_Str");
    }
  }
 else {
    say("String_Node_Str" + numThreads + "String_Node_Str");
    BootImageWorker.startup(bootImageTypes.elements());
    BootImageWorker[] workers=new BootImageWorker[numThreads];
    for (int i=0; i < workers.length; i++) {
      workers[i]=new BootImageWorker();
      workers[i].id=i;
      workers[i].setName("String_Node_Str" + i);
      workers[i].start();
    }
    try {
      for (int i=0; i < workers.length; i++) {
        workers[i].join();
      }
    }
 catch (    InterruptedException ie) {
      say("String_Node_Str");
    }
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  VM_Statics.bootImageInstantiationFinished();
  VM_CodeArray[] functionTable=BuildJNIFunctionTable.buildTable();
  VM_JNIEnvironment.initFunctionTable(functionTable);
  if (verbose >= 1)   say("String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  bootImageTypeFields=new HashMap(bootImageTypes.size());
  for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
    VM_Type rvmType=(VM_Type)e.nextElement();
    FieldInfo fieldInfo;
    if (!rvmType.isClassType())     continue;
    Class jdkType=getJdkType(rvmType);
    if (jdkType == null)     continue;
    Key key=new Key(jdkType);
    fieldInfo=(FieldInfo)bootImageTypeFields.get(key);
    if (fieldInfo != null) {
      fieldInfo.rvmType=rvmType;
    }
 else {
      if (verbose >= 1)       say("String_Node_Str" + rvmType);
      fieldInfo=new FieldInfo(jdkType,rvmType);
      bootImageTypeFields.put(key,fieldInfo);
      for (Class cls=jdkType.getSuperclass(); cls != null; cls=cls.getSuperclass()) {
        key=new Key(cls);
        fieldInfo=(FieldInfo)bootImageTypeFields.get(key);
        if (fieldInfo != null) {
          break;
        }
 else {
          if (verbose >= 1)           say("String_Node_Str" + jdkType);
          fieldInfo=new FieldInfo(cls,null);
          bootImageTypeFields.put(key,fieldInfo);
        }
      }
    }
  }
  for (Iterator iter=bootImageTypeFields.values().iterator(); iter.hasNext(); ) {
    FieldInfo fieldInfo=(FieldInfo)iter.next();
    VM_Type rvmType=fieldInfo.rvmType;
    if (rvmType == null) {
      if (verbose >= 1)       say("String_Node_Str" + fieldInfo.jdkType);
      continue;
    }
    Class jdkType=fieldInfo.jdkType;
    if (verbose >= 1)     say("String_Node_Str" + rvmType);
    VM_Field rvmFields[]=rvmType.getStaticFields();
    fieldInfo.jdkStaticFields=new Field[rvmFields.length];
    for (int j=0; j < rvmFields.length; j++) {
      String rvmName=rvmFields[j].getName().toString();
      for (int k=0; k < fieldInfo.jdkFields.length; k++) {
        Field f=fieldInfo.jdkFields[k];
        if (f.getName().equals(rvmName)) {
          fieldInfo.jdkStaticFields[j]=f;
          f.setAccessible(true);
          break;
        }
      }
    }
    rvmFields=rvmType.getInstanceFields();
    fieldInfo.jdkInstanceFields=new Field[rvmFields.length];
    for (int j=0; j < rvmFields.length; j++) {
      String rvmName=rvmFields[j].getName().toString();
      jdkType=getJdkType(rvmFields[j].getDeclaringClass());
      if (jdkType == null)       continue;
      FieldInfo jdkFieldInfo=(FieldInfo)bootImageTypeFields.get(new Key(jdkType));
      if (jdkFieldInfo == null)       continue;
      Field[] jdkFields=jdkFieldInfo.jdkFields;
      for (int k=0; k < jdkFields.length; k++) {
        Field f=jdkFields[k];
        if (f.getName().equals(rvmName)) {
          fieldInfo.jdkInstanceFields[j]=f;
          f.setAccessible(true);
          break;
        }
      }
    }
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
  int initProc=VM_Scheduler.PRIMORDIAL_PROCESSOR_ID;
  VM_Thread startupThread=new VM_Thread(new byte[STACK_SIZE_BOOT],null,"String_Node_Str");
  VM_Scheduler.processors[initProc].activeThread=startupThread;
  int idx=startupThread.stack.length - 1;
  if (VM.LittleEndian) {
    startupThread.stack[idx--]=(byte)0xde;
    startupThread.stack[idx--]=(byte)0xad;
    startupThread.stack[idx--]=(byte)0xba;
    startupThread.stack[idx--]=(byte)0xbe;
  }
 else {
    startupThread.stack[idx--]=(byte)0xbe;
    startupThread.stack[idx--]=(byte)0xba;
    startupThread.stack[idx--]=(byte)0xad;
    startupThread.stack[idx--]=(byte)0xde;
  }
  VM_BootstrapClassLoader.setBootstrapRepositories(bootImageRepositoriesAtExecutionTime);
  if (verbose >= 1)   say("String_Node_Str");
  if (profile)   startTime=System.currentTimeMillis();
  for (Enumeration e=bootImageTypes.elements(); e.hasMoreElements(); ) {
    VM_Type rvmType=(VM_Type)e.nextElement();
    if (verbose >= 1)     say("String_Node_Str",rvmType.toString());
    if (!rvmType.isClassType())     continue;
    Class jdkType=getJdkType(rvmType);
    if (jdkType == null && verbose >= 1) {
      say("String_Node_Str" + rvmType + "String_Node_Str");
    }
    VM_Field rvmFields[]=rvmType.getStaticFields();
    for (int j=0; j < rvmFields.length; ++j) {
      VM_Field rvmField=rvmFields[j];
      VM_TypeReference rvmFieldType=rvmField.getType();
      Offset rvmFieldOffset=rvmField.getOffset();
      String rvmFieldName=rvmField.getName().toString();
      Field jdkFieldAcc=null;
      if (jdkType != null)       jdkFieldAcc=getJdkFieldAccessor(jdkType,j,STATIC_FIELD);
      if (jdkFieldAcc == null) {
        if (jdkType != null) {
          if (!copyKnownClasspathStaticField(jdkType,rvmFieldName,rvmFieldType,rvmFieldOffset)) {
            if (verbose >= 2) {
              traceContext.push(rvmFieldType.toString(),jdkType.getName(),rvmFieldName);
              traceContext.traceFieldNotInHostJdk();
              traceContext.pop();
            }
            VM_Statics.setSlotContents(rvmFieldOffset,0);
            if (!VM.runningTool)             bootImage.countNulledReference();
          }
        }
 else {
          if (verbose >= 2) {
            traceContext.push(rvmFieldType.toString(),rvmFieldType.toString(),rvmFieldName);
            traceContext.traceFieldNotInHostJdk();
            traceContext.pop();
          }
          VM_Statics.setSlotContents(rvmFieldOffset,0);
          if (!VM.runningTool)           bootImage.countNulledReference();
        }
        continue;
      }
      if (!Modifier.isStatic(jdkFieldAcc.getModifiers())) {
        if (verbose >= 2)         traceContext.push(rvmFieldType.toString(),jdkType.getName(),rvmFieldName);
        if (verbose >= 2)         traceContext.traceFieldNotStaticInHostJdk();
        if (verbose >= 2)         traceContext.pop();
        VM_Statics.setSlotContents(rvmFieldOffset,0);
        if (!VM.runningTool)         bootImage.countNulledReference();
        continue;
      }
      if (verbose >= 2)       say("String_Node_Str",String.valueOf(VM_Statics.offsetAsSlot(rvmFieldOffset)),"String_Node_Str",rvmField.toString());
      if (rvmFieldType.isPrimitiveType()) {
        if (rvmFieldType.isBooleanType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getBoolean(null) ? 1 : 0);
        }
 else         if (rvmFieldType.isByteType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getByte(null));
        }
 else         if (rvmFieldType.isCharType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getChar(null));
        }
 else         if (rvmFieldType.isShortType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getShort(null));
        }
 else         if (rvmFieldType.isIntType()) {
          try {
            VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getInt(null));
          }
 catch (          IllegalArgumentException ex) {
            System.err.println("String_Node_Str" + rvmType + "String_Node_Str"+ rvmField);
            throw ex;
          }
        }
 else         if (rvmFieldType.isLongType()) {
          VM_Statics.setSlotContents(rvmFieldOffset,jdkFieldAcc.getLong(null));
        }
 else         if (rvmFieldType.isFloatType()) {
          float f=jdkFieldAcc.getFloat(null);
          VM_Statics.setSlotContents(rvmFieldOffset,Float.floatToIntBits(f));
        }
 else         if (rvmFieldType.isDoubleType()) {
          double d=jdkFieldAcc.getDouble(null);
          VM_Statics.setSlotContents(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(null);
          String msg="String_Node_Str" + rvmField.toString();
          boolean warn=rvmFieldType.equals(VM_TypeReference.Address);
          VM_Statics.setSlotContents(rvmFieldOffset,getWordValue(o,msg,warn));
        }
 else {
          fail("String_Node_Str" + rvmFieldType);
        }
      }
 else {
        if (jdkFieldAcc == null)         fail("String_Node_Str");
        int modifs=jdkFieldAcc.getModifiers();
        if (!Modifier.isStatic(modifs))         fail("String_Node_Str" + jdkFieldAcc.toString());
        Object o;
        try {
          o=jdkFieldAcc.get(null);
        }
 catch (        NullPointerException npe) {
          fail("String_Node_Str" + jdkFieldAcc.toString() + "String_Node_Str"+ npe.toString());
          o=null;
        }
        if (verbose >= 3)         say("String_Node_Str",VM.addressAsHexString(VM_Magic.objectAsAddress(o)));
        VM_Statics.setSlotContents(rvmFieldOffset,o);
      }
    }
  }
  if (profile) {
    stopTime=System.currentTimeMillis();
    System.out.println("String_Node_Str" + (stopTime - startTime) + "String_Node_Str");
  }
}