VM.sysWrite(" MCSites[index  ] = "); VM.sysWrite(machCodeOffset - MCSites[index  ]); VM.sysWrite("\n");
VM.sysWrite(" MCSites[index  ] = "); VM.sysWrite(machCodeOffset.sub(MCSites[index  ])); VM.sysWrite("\n");
  public int locateGCPoint(int machCodeOffset, VM_Method method)  {    machCodeOffset = machCodeOffset - (1 << VM.LG_INSTRUCTION_WIDTH);  // this assumes that machCodeOffset points    // to "next" instruction eg bal type instruction    if (VM.TraceStkMaps) {      VM.sysWrite("VM_QuickReferenceMaps-locateGCPoint for machine code offset = ");      VM.sysWrite(machCodeOffset);      VM.sysWrite("  --- in  method = ");      VM.sysWrite(method.getName());      VM.sysWrite("\n");    }    //  Scan the list of machine code addresses to find the    //  closest site offset BEFORE the input machine code index ( offset in the code)    int distance = 0;    int index = 0;    // get the first possible location    for (int i = 0; i < mapCount; i++) {      // get an initial non zero distance      distance = machCodeOffset - MCSites[i];      if (distance >= 0) {        index = i;        break;      }    }    // scan to find any better location ie closer to the site    for(int i = index+1; i < mapCount; i++) {      int dist =  machCodeOffset- MCSites[i];      if (dist < 0) continue;      if (dist <= distance) {        index = i;        distance = dist;      }    }    if (VM.TraceStkMaps) {      VM.sysWrite(" VM_QuickReferenceMaps-locateGCPoint located index  = ");      VM.sysWrite(index);      VM.sysWrite("  byte  = ");      VM.sysWrite(referenceMaps[index]);      VM.sysWrite( "\n");      if (index - 1 >= 0) {        VM.sysWrite(" MCSites[index-1] = "); VM.sysWrite(machCodeOffset - MCSites[index-1]); VM.sysWrite("\n");      }      VM.sysWrite(" MCSites[index  ] = "); VM.sysWrite(machCodeOffset - MCSites[index  ]); VM.sysWrite("\n");      if (index + 1 < MCSites.length) {        VM.sysWrite(" MCSites[index+1] = "); VM.sysWrite(machCodeOffset - MCSites[index+1]); VM.sysWrite("\n");      }    }    // test for a site within a jsr subroutine    if ((0x000000FF & (referenceMaps[index*bytesPerMap] &  JSR_MASK)) == (0x000000FF & JSR_MASK))  { // test for jsr map      index = -index;                       // indicate site within a jsr to caller      if (VM.TraceStkMaps) {        VM.sysWrite(" VM_QuickReferenceMaps-locateGCPoint jsr mapid = ");        VM.sysWrite( -index);        VM.sysWrite( "\n");      }    }    if (VM.TraceStkMaps) {      VM.sysWrite(" VM_QuickReferenceMaps-locateGCPoint  machine offset = ");      VM.sysWrite(  machCodeOffset);      VM.sysWrite("  - return map index = ");      VM.sysWrite( index);      VM.sysWrite( "\n");    }    return index;  }