jsrSiteMap.getNonReferenceMapIndex());
jsrSiteMap.getNonReferenceMapIndex(), true);
  recordJSRSubroutineMap(int byteindex, byte[] currReferenceMap, int BBLastPtr,                         int returnAddrIndex, boolean replacemap)  {    int mapNum = 0;    int unusualMapIndex = 0;    int returnOffset;    VM_UnusualMaps jsrSiteMap;    if ( replacemap)      // update an already existing map    {      //  locate existing site  in table      jsrSiteMap = null;      for( mapNum = 0; mapNum < mapCount; mapNum++)      {        if ( MCSites[mapNum] == byteindex)        {	    // gc site found - get index in unusual map table and the unusual Map	    unusualMapIndex = JSR_INDEX_MASK & referenceMaps[ mapNum*bytesPerMap];            returnOffset = convertBitNumToOffset(returnAddrIndex);            if (unusualMapIndex == JSR_INDEX_MASK)	      {		// greater than 127 unusualMaps- sequential scan of locate others unusual map               for (  unusualMapIndex = JSR_INDEX_MASK; unusualMapIndex < numberUnusualMaps; unusualMapIndex++)		 {                   if (unusualMaps[unusualMapIndex].getReturnAddressOffset() == returnOffset)                       jsrSiteMap = unusualMaps[unusualMapIndex];                   break;		 }               VM.sysFail(" can't find unusual map !!!!!!! - should never occur"); 	      }            else               jsrSiteMap = unusualMaps[unusualMapIndex];	    break;	}      }    }    else    {        // new map, add to end of table         mapNum = mapCount++;          // get slot and update count         MCSites[mapNum] = byteindex;  // gen and save bytecode offset        // generate an UnusualMap for the site        jsrSiteMap = new VM_UnusualMaps();        // add unusual map to UnusualMap table (table may need to be expanded)        unusualMapIndex = addUnusualMap(jsrSiteMap);       // set back pointer ie pointer from unusual maps back into referencemaps        jsrSiteMap.setNormalMapIndex( mapNum);        // setup index in reference maps        if (unusualMapIndex > JSR_INDEX_MASK)                        unusualMapIndex = JSR_INDEX_MASK;        referenceMaps[mapNum*bytesPerMap] = (byte)((byte)unusualMapIndex | JSR_MASK);        // setup new unusual Map        int retOffset = convertBitNumToOffset(returnAddrIndex + 2 ); // +2  to convert to our index         jsrSiteMap.setReturnAddressOffset(retOffset);         if (VM.TraceStkMaps)         {           VM.sysWrite("VM_ReferenceMaps-recordJSRSubroutineMap- input map = ");	   for(int i = 0; i < BBLastPtr + 1; i++) {	       VM.sysWrite( currReferenceMap[i]);	   }	   VM.sysWrite( "\n");           VM.sysWrite("VM_ReferenceMaps-recordJSRSubroutineMap- mapNum = ");           VM.sysWrite( mapNum);           VM.sysWrite(" - byteindex = ");           VM.sysWrite( byteindex);           VM.sysWrite(" - return address offset = ");           VM.sysWrite( retOffset);           VM.sysWrite(" - reference map byte = ");           VM.sysWrite( referenceMaps[mapNum*bytesPerMap]);           VM.sysWrite( "\n");	 }     }	 // end else clause - add new map    // for new maps, setup maps in UnusualMap, for existing map replace them    // setup Reference Map     int refindex = scanByteArray(currReferenceMap, BBLastPtr, VM_BuildReferenceMaps.SET_TO_REFERENCE,                                                             jsrSiteMap.getReferenceMapIndex());     jsrSiteMap.setReferenceMapIndex( refindex);         if (VM.TraceStkMaps)         {           VM.sysWrite("                 - reference map index = ");           VM.sysWrite( refindex);           VM.sysWrite(" - reference map  = ");           for (int i = refindex; i < refindex+bytesPerMap; i++)               VM.sysWrite( unusualReferenceMaps[i]);           VM.sysWrite( "\n");	 }     // setup NONReference Map     int nonrefindex = scanByteArray(currReferenceMap, BBLastPtr, VM_BuildReferenceMaps.SET_TO_NONREFERENCE,                                                                      jsrSiteMap.getNonReferenceMapIndex());     jsrSiteMap.setNonReferenceMapIndex( nonrefindex);         if (VM.TraceStkMaps)         {           VM.sysWrite("                 - NONreference map index = ");           VM.sysWrite( nonrefindex);           VM.sysWrite(" - NON reference map  = ");           for (int i = nonrefindex; i < nonrefindex+bytesPerMap; i++)               VM.sysWrite( unusualReferenceMaps[i]);           VM.sysWrite( "\n");	 }  // setup returnAddress Map   int addrindex = scanByteArray(currReferenceMap, BBLastPtr, VM_BuildReferenceMaps.RETURN_ADDRESS,                                                               jsrSiteMap.getReturnAddressMapIndex());   jsrSiteMap.setReturnAddressMapIndex( addrindex);         if (VM.TraceStkMaps)         {           VM.sysWrite("                 - returnAddress map index = ");           VM.sysWrite( addrindex);           VM.sysWrite(" - return Address map  = ");           for (int i = addrindex; i < addrindex+bytesPerMap; i++)               VM.sysWrite( unusualReferenceMaps[i]);           VM.sysWrite( "\n");	 }         if (VM.TraceStkMaps)         {           VM.sysWrite("VM_ReferenceMaps-recordJSRSubroutineMap- unusualmap index = ");           VM.sysWrite( unusualMapIndex);           VM.sysWrite( "\n");	 }   // update stats   if (VM.ReferenceMapsStatistics)       {         if (!replacemap)         {	   if (BBLastPtr < 8)             numMapsLE8++;	   if (BBLastPtr <16)	     numMapsLE16++;	   if (BBLastPtr > maxbytesPerMap)	     maxbytesPerMap=BBLastPtr;         }       }    return;  }