VM.intAsHexString(jtocSlot << LOG_BYTES_IN_INT) + " " +
VM.addressAsHexString(jtocOff.toWord().toAddress()) + " " +
  private static void writeAddressMap(String mapFileName) throws IOException {    if (verbose >= 1) say("writing ", mapFileName);    FileOutputStream fos = new FileOutputStream(mapFileName);    BufferedOutputStream bos = new BufferedOutputStream(fos, 128);    PrintStream out = new PrintStream(bos, false);    out.println("#! /bin/bash");    out.println("# This is a method address map, for use with the ``dbx'' debugger.");    out.println("# To sort by \"code\" address, type \"bash <name-of-this-file>\".");    out.println();    out.println("(/bin/grep 'code     0x' | /bin/sort -k 4.3,4) << EOF-EOF-EOF");    out.println();    out.println("JTOC Map");    out.println("--------");    out.println("slot  offset     category contents            details");    out.println("----  ------     -------- --------            -------");    String pad = "        ";    for (int jtocSlot = 0;         jtocSlot < VM_Statics.getNumberOfSlots();         ++jtocSlot)    {      byte   description = VM_Statics.getSlotDescription(jtocSlot);      String category = "<?>    ";      String contents = "<?>       " + pad;      String details  = "<?>";      int ival;   // temporaries       long lval;      String sval;      switch (description) {        case VM_Statics.EMPTY:          category = "unused ";          ival  = VM_Statics.getSlotContentsAsInt(jtocSlot);          contents = VM.intAsHexString(ival) + pad;          details  = "";          break;        case VM_Statics.INT_LITERAL:          category = "literal";          ival  = VM_Statics.getSlotContentsAsInt(jtocSlot);          contents = VM.intAsHexString(ival) + pad;          details  = VM_Statics.getSlotContentsAsInt(jtocSlot) + "";          break;        case VM_Statics.FLOAT_LITERAL:          category = "literal";          ival  = VM_Statics.getSlotContentsAsInt(jtocSlot);          contents = VM.intAsHexString(ival) + pad;          details  = Float.intBitsToFloat(ival) + "F";          break;        case VM_Statics.LONG_LITERAL:          category = "literal";          lval = VM_Statics.getSlotContentsAsLong(jtocSlot);          contents = VM.intAsHexString((int) (lval >> 32)) +                     VM.intAsHexString((int) (lval & 0xffffffffL)).substring(2);          details  = lval + "L";          break;        case VM_Statics.DOUBLE_LITERAL:          category = "literal";          lval = VM_Statics.getSlotContentsAsLong(jtocSlot);          contents = VM.intAsHexString((int) (lval >> 32)) +                     VM.intAsHexString((int) (lval & 0xffffffffL)).substring(2);          details  = Double.longBitsToDouble(lval) + "D";          break;        case VM_Statics.NUMERIC_FIELD:          category = "field  ";          ival  = VM_Statics.getSlotContentsAsInt(jtocSlot);          contents = VM.intAsHexString(ival) + pad;          details  = getRvmStaticFieldName(jtocSlot);          break;        case VM_Statics.WIDE_NUMERIC_FIELD:          category = "field  ";          lval  = VM_Statics.getSlotContentsAsLong(jtocSlot);          contents = VM.intAsHexString((int) (lval >> 32)) +                     VM.intAsHexString((int) (lval & 0xffffffffL)).substring(2);          details  = getRvmStaticFieldName(jtocSlot);          break;        case VM_Statics.STRING_LITERAL:           category = "literal";          contents = VM.addressAsHexString(getReferenceAddr(jtocSlot)) + pad;          details  = "\"" + ((String) BootImageMap.getObject(getIVal(jtocSlot))).replace('\n', ' ') +"\"";          break;                  case VM_Statics.REFERENCE_FIELD:          category = "field  ";          contents = VM.addressAsHexString(getReferenceAddr(jtocSlot)) + pad;          details  = getRvmStaticFieldName(jtocSlot);          break;        case VM_Statics.METHOD:          category = "code   ";          contents = VM.addressAsHexString(getReferenceAddr(jtocSlot)) + pad;          VM_CompiledMethod m = findMethodOfCode(BootImageMap.getObject(getIVal(jtocSlot)));          details = m == null ? "<?>" : m.getMethod().toString();          break;        case VM_Statics.TIB:          contents = VM.addressAsHexString(getReferenceAddr(jtocSlot)) + pad;          category = "tib    ";          VM_Type type = findTypeOfTIBSlot(jtocSlot);          details = (type == null) ? "?" : type.toString();          break;                  default:          break;      }      out.println((jtocSlot + "      ").substring(0,6) +                  VM.intAsHexString(jtocSlot << LOG_BYTES_IN_INT) + " " +                  category + "  " + contents + "  " + details);      if ((description & VM_Statics.WIDE_TAG) != 0)        jtocSlot += 1;    }    out.println();    out.println("Method Map");    out.println("----------");    out.println("                          address             method");    out.println("                          -------             ------");    out.println();    VM_CompiledMethod[] compiledMethods = VM_CompiledMethods.getCompiledMethods();    for (int i = 0; i < VM_CompiledMethods.numCompiledMethods(); ++i) {      VM_CompiledMethod compiledMethod = compiledMethods[i];      if (compiledMethod != null) {        VM_Method m = compiledMethod.getMethod();        if (m != null && compiledMethod.isCompiled()) {          VM_CodeArray instructions = compiledMethod.getInstructions();          Address code = BootImageMap.getImageAddress(bootImageAddress, instructions.getBacking());          out.println(".     .          code     " + VM.addressAsHexString(code) +                      "          " + compiledMethod.getMethod());        }      }    }    out.println();    out.println("EOF-EOF-EOF");    out.flush();    out.close();  }