}  static void scanObjectOrArray( Object objRef ) throws VM_PragmaUninterruptible { scanObjectOrArray( VM_Magic.objectAsAddress(objRef) );
  static void scanObjectOrArray(VM_Address objRef ) throws VM_PragmaUninterruptible {    // First process the TIB to relocate it.    // Necessary only if the allocator/collector moves objects    // and the object model is actually storing the TIB as a pointer.    //     if (VM_Allocator.movesObjects) {      VM_ObjectModel.gcProcessTIB(objRef);    }    Object obj = VM_Magic.addressAsObject(objRef);    Object[] tib = VM_ObjectModel.getTIB(obj);    if (VM.VerifyAssertions) {      if (tib == null || VM_ObjectModel.getObjectType(tib) != VM_Type.JavaLangObjectArrayType) {        VM.sysWrite("VM_ScanObject: tib is not Object[]\n");        VM.sysWrite("               objRef = ");        VM.sysWrite(objRef);        VM.sysWrite("               tib = ");        VM.sysWrite(VM_Magic.objectAsAddress(tib));        VM.sysWrite("\n");      }    }    VM_Type type = VM_Magic.objectAsType(tib[TIB_TYPE_INDEX]);    if (VM.VerifyAssertions) {      if (type == null) {        VM.sysWrite("VM_ScanObject: type is null\n");        VM.sysWrite("               objRef = ");        VM.sysWrite(objRef);        VM.sysWrite("\nVM_ScanObject: objRef = ");        VM.sysWrite(VM_Magic.objectAsAddress(type));        VM.sysWrite("\n");        VM.assert(type != null);      }    }    if ( type.isClassType() ) {      int[] referenceOffsets = type.asClass().getReferenceOffsets();      for(int i = 0, n=referenceOffsets.length; i < n; i++) {        VM_Allocator.processPtrField( objRef.add(referenceOffsets[i]) );      }      VM_GCStatistics.profileScan(obj, 4 * referenceOffsets.length, tib);    }    else {      if (VM.VerifyAssertions) VM.assert(type.isArrayType());      VM_Type elementType = type.asArray().getElementType();      if (elementType.isReferenceType()) {        int num_elements = VM_Magic.getArrayLength(obj);        int numBytes = num_elements * WORDSIZE;        VM_Address location = objRef;    // for arrays = address of [0] entry        VM_Address end      = objRef.add(numBytes);        while ( location.LT(end) ) {          VM_Allocator.processPtrField( location );          location = location.add(WORDSIZE);  // is this size_of_pointer ?        }        VM_GCStatistics.profileScan(obj, numBytes, tib);      }    }  }   static void scanObjectOrArray( Object objRef ) throws VM_PragmaUninterruptible {    scanObjectOrArray( VM_Magic.objectAsAddress(objRef) );  }