if (!Space.isMappedObject(ref)) {
if (!Space.isMappedObject(ObjectReference.fromObject(tib))) {
  public static boolean validRef(ObjectReference ref)    throws UninterruptiblePragma {    if (ref.isNull()) return true;    if (!Space.isMappedObject(ref)) {      VM.sysWrite("validRef: REF outside heap, ref = ");      VM.sysWrite(ref); VM.sysWrite("\n");      Space.printVMMap();      return false;    }    if (MM_Interface.MOVES_OBJECTS) {        /*      TODO: Work out how to check if forwarded      if (Plan.isForwardedOrBeingForwarded(ref)) {        // TODO: actually follow forwarding pointer        // (need to bound recursion when things are broken!!)        return true;       }      */    }        Object[] tib = VM_ObjectModel.getTIB(ref);    Address tibAddr = VM_Magic.objectAsAddress(tib);    if (!Space.isMappedObject(ref)) {      VM.sysWrite("validRef: TIB outside heap, ref = "); VM.sysWrite(ref);      VM.sysWrite(" tib = ");VM.sysWrite(tibAddr);      VM.sysWrite("\n");      return false;    }    if (tibAddr.isZero()) {      VM.sysWrite("validRef: TIB is Zero! "); VM.sysWrite(ref);      VM.sysWrite("\n");      return false;    }    if (tib.length == 0) {      VM.sysWrite("validRef: TIB length zero, ref = "); VM.sysWrite(ref);      VM.sysWrite(" tib = ");VM.sysWrite(tibAddr);      VM.sysWrite("\n");      return false;    }    ObjectReference type = ObjectReference.fromObject(tib[0]);    if (!validType(type)) {      VM.sysWrite("validRef: invalid TYPE, ref = "); VM.sysWrite(ref);      VM.sysWrite(" tib = ");      VM.sysWrite(VM_Magic.objectAsAddress(tib));      VM.sysWrite(" type = ");VM.sysWrite(type); VM.sysWrite("\n");      return false;    }    return true;  }  // validRef