public void recordStkMap(int byteindex, byte[] byteMap, int BBLastPtr, boolean replacemap) {
public void recordStkMap(int byteindex, byte[] byteMap, int BBLastPtr, boolean replacemap) throws VM_PragmaInterruptible {
  public void recordStkMap(int byteindex, byte[] byteMap, int BBLastPtr, boolean replacemap) {    int mapNum = 0, mapslot = 0, word;    if (VM.TraceStkMaps){      VM.sysWrite(" VM_ReferenceMaps-recordStkMap bytecode offset = ");      VM.sysWrite(byteindex);      VM.sysWrite("\n");      VM.sysWrite(" input byte map = ");      for ( int j = 0; j <= BBLastPtr; j++)        VM.sysWrite(byteMap[j]);      VM.sysWrite("\n");      if ( replacemap) {        VM.sysWrite(" VM_ReferenceMaps-recordStkMap- replacing map at byteindex = ");        VM.sysWrite(byteindex);        VM.sysWrite("\n");      }    }    if ( replacemap)   // replace a map that already exists in the table    {      //  locate the site      for( mapNum = 0; mapNum < mapCount; mapNum++) {        if (MCSites[mapNum] == byteindex) {          // location found -clear out old map          int start = mapNum * bytesPerMap;  // get starting byte in map          for ( int i = start; i < start + bytesPerMap; i++)            referenceMaps[i] = 0;          if (VM.TraceStkMaps){            VM.sysWrite(" VM_ReferenceMaps-recordStkMap replacing map number = ");            VM.sysWrite(mapNum);            VM.sysWrite("  for machineecode index = ");            VM.sysWrite(MCSites[mapNum]);            VM.sysWrite("\n");          }          break;        }      }    }    // end replacemap if clause    else {      // add a map to the table - its a new site      //  allocate a new site      mapNum = mapCount++;      // fill in basic information      MCSites[mapNum] = byteindex; // gen and save bytecode offset      if (BBLastPtr == -1)  return;   // empty map for this gc point    }    if (VM.TraceStkMaps){      VM.sysWrite(" VM_ReferenceMaps-recordStkMap map id  = ");      VM.sysWrite(mapNum);      VM.sysWrite("\n");    }    // convert Boolean array into array of bits ie create the map    mapslot  = mapNum * bytesPerMap;    int len    = (BBLastPtr + 1);      // get last ptr in map    int offset = 0;              // offset from origin    int convertLength;                             //to start in the map    word = mapslot;    // convert first byte of map    // get correct length for first map byte - smaller of bits in first byte or size of map    if (len < (BITS_PER_MAP_ELEMENT -1))      convertLength = len;    else      convertLength = BITS_PER_MAP_ELEMENT -1;    byte firstByte = convertMapElement(byteMap, offset, convertLength, VM_BuildReferenceMaps.REFERENCE);    referenceMaps[word] = (byte)((0x000000ff & firstByte) >>>1); // shift for jsr bit ie set it to 0    if (VM.TraceStkMaps) {      VM.sysWrite(" VM_ReferenceMaps-recordStkMap convert first map bytes- byte number = ");      VM.sysWrite(word);      VM.sysWrite(" byte value in map = ");      VM.sysWrite(referenceMaps[word]);      VM.sysWrite(" - before shift = "); VM.sysWrite(firstByte);       VM.sysWrite("\n");    }    // update indexes for additional bytes    word++;                                // next byte in bit map    len    -= (BITS_PER_MAP_ELEMENT -1);   // remaining count    offset += (BITS_PER_MAP_ELEMENT -1);   // offset into input array    // convert remaining byte array to bit array -    while ( len > 0 ) {      // map takes multiple bytes -convert 1  at a time      if (len <= (BITS_PER_MAP_ELEMENT -1))        convertLength = len;      else        convertLength = BITS_PER_MAP_ELEMENT;      // map takes multiple bytes -convert 1  at a time      referenceMaps[word] = convertMapElement(byteMap, offset, convertLength, VM_BuildReferenceMaps.REFERENCE);      if (VM.TraceStkMaps)      {        VM.sysWrite(" VM_ReferenceMaps-recordStkMap convert another map byte- byte number = ");        VM.sysWrite(word);        VM.sysWrite(" byte value = ");        VM.sysWrite(referenceMaps[word]);        VM.sysWrite("\n");      }      len    -= BITS_PER_MAP_ELEMENT;                // update remaining words      offset += BITS_PER_MAP_ELEMENT;                // and offset      word++;    }  // end of while    // update stats    if (VM.ReferenceMapsStatistics) {      if (!replacemap) {        if (BBLastPtr < 8)          numMapsLE8++;        if (BBLastPtr <16)          numMapsLE16++;        if (BBLastPtr >  maxbytesPerMap)          maxbytesPerMap=BBLastPtr;      }    }    return;  }