int machineCodeOffset = compiledMethod.getInstructionOffset(callerAddress);
Offset machineCodeOffset = compiledMethod.getInstructionOffset(callerAddress);
  public void setupJSRSubroutineMap(Address frameAddress, int mapid,                                     VM_CompiledMethod compiledMethod)  {    // first clear the  maps in the jsrInfo.extraUnusualMap    int j = jsrInfo.extraUnusualMap.getReferenceMapIndex();    int k = jsrInfo.extraUnusualMap.getNonReferenceMapIndex();    int l = jsrInfo.extraUnusualMap.getReturnAddressMapIndex();    for ( int i = 0; i <  bytesPerMap(); i++) {      jsrInfo.unusualReferenceMaps[j + i] = 0;      jsrInfo.unusualReferenceMaps[k + i] = 0;      jsrInfo.unusualReferenceMaps[l + i] = 0;    }    // use the mapid to get index of the Unusual Map    //    if (VM.TraceStkMaps) {      VM.sysWriteln("VM_ReferenceMaps-setupJSRSubroutineMap- mapid = ", mapid, "   - mapid = ", - mapid);      VM.sysWriteln("  -referenceMaps[(- mapid) * bytesPerMap] = ", referenceMaps[(- mapid) * bytesPerMap()]);      VM.sysWriteln("        unusual mapid index = ", referenceMaps[(- mapid) * bytesPerMap()]&JSR_INDEX_MASK);    }    int unusualMapid = (referenceMaps[(-mapid) * bytesPerMap()] & JSR_INDEX_MASK);    // if jsr map is > 127 go search for the right one    if (unusualMapid == JSR_INDEX_MASK) {      unusualMapid = findUnusualMap(-mapid);    }    VM_UnusualMaps unusualMap = jsrInfo.unusualMaps[unusualMapid];//    unusualMapcopy(unusualMap, -mapid); // deep copy unusual map into the extra map    unusualMapcopy(unusualMap); // deep copy unusual map into the extra map    // from the unusual map and the frame - get the location of the jsr invoker    //    int jsrAddressOffset = unusualMap.getReturnAddressOffset();    Address callerAddress = frameAddress.add(jsrAddressOffset).loadAddress();    // NOTE: -4 is subtracted when the map is determined ie locateGCpoint    // from the invoker address and the code base address - get the machine    // code offset     int machineCodeOffset = compiledMethod.getInstructionOffset(callerAddress);    if (VM.TraceStkMaps) {      VM.sysWriteln("VM_ReferenceMaps-setupJSRMap- inputMapid = ", mapid);      VM.sysWriteln("       jsrReturnAddressOffset = ", jsrAddressOffset);      VM.sysWriteln("       jsr callers address = ", callerAddress);      VM.sysWriteln("       machine code offset of caller = ", machineCodeOffset);      if (machineCodeOffset <0)        VM.sysWriteln("BAD MACHINE CODE OFFSET");    }    // From the machine code offset locate the map for the JSR instruction    //    int jsrMapid = locateGCPoint(machineCodeOffset, compiledMethod.getMethod());    if (VM.TraceStkMaps) {      VM.sysWriteln("VM_ReferenceMaps-setupJSRMap- locateGCpoint returns mapid = ", jsrMapid);    }    // If the invoker was in a JSR (ie nested JSRs)- merge the delta maps of    // each JSR and compute the new total delta    //    while ( jsrMapid < 0) {      jsrMapid = -jsrMapid;      if (VM.TraceStkMaps) {        VM.sysWriteln("VM_ReferenceMaps-setupJSRsubroutineMap- outer MapIndex = ", jsrMapid, "  unusualMapIndex = ", referenceMaps[jsrMapid]);      }      // merge unusual maps- occurs in nested jsr conditions      //  merge each nested delta into the maps of the extraUnusualmap      int unusualMapIndex = JSR_INDEX_MASK & referenceMaps[ jsrMapid*bytesPerMap()];      if (unusualMapIndex == JSR_INDEX_MASK) {        unusualMapIndex = findUnusualMap(jsrMapid);      }//      jsrInfo.extraUnusualMap = combineDeltaMaps(jsrMapid, unusualMapid);      jsrInfo.extraUnusualMap = combineDeltaMaps(unusualMapIndex);      // Locate the next JSR from the current      //      VM_UnusualMaps thisMap = jsrInfo.unusualMaps[unusualMapIndex];      int thisJsrAddressOffset = thisMap.getReturnAddressOffset();      Address nextCallerAddress = frameAddress.add(thisJsrAddressOffset).loadAddress();      int nextMachineCodeOffset = compiledMethod.getInstructionOffset(nextCallerAddress);      jsrMapid = locateGCPoint(nextMachineCodeOffset, compiledMethod.getMethod());      if (VM.TraceStkMaps) {        VM.sysWriteln("VM_ReferenceMaps-setupJSRsubroutineMap- nested jsrs jsrInfo.extraUnusualMap = ");        jsrInfo.extraUnusualMap.showInfo();        VM.sysWriteln();        VM.sysWriteln("VM_ReferenceMaps-setupJSRsubroutineMap- nested jsrs thisMap = ");        thisMap.showInfo();        VM.sysWriteln();        VM.sysWriteln("     setupJSRsubroutineMap- nested jsrs end of loop- = ");        VM.sysWriteln("      next jsraddress offset = ", thisJsrAddressOffset);        VM.sysWriteln("      next callers address = ", nextCallerAddress);        VM.sysWriteln("      next machinecodeoffset = ", nextMachineCodeOffset);      }    }  // end while    // Merge the JSR (unusual) map with the base level (ie JSR instruction)    // map(s).    //  The results are stored in jsrInfo.mergedReferenceMap and mergedReturnAddresMap    //  as indices in the referenceMaps table    //    finalMergeMaps((jsrMapid * bytesPerMap()), jsrInfo.extraUnusualMap);    if (VM.TraceStkMaps) {      VM.sysWriteln("VM_ReferenceMaps-setupJSRsubroutineMap- afterfinalMerge jsrInfo.extraUnusualMap = ");      jsrInfo.extraUnusualMap.showInfo();      VM.sysWriteln();      VM.sysWriteln("     jsrInfo.mergedReferenceMap Index = ", jsrInfo.mergedReferenceMap);      VM.sysWrite("     jsrInfo.mergedReferenceMap  = ");      jsrInfo.showAnUnusualMap(jsrInfo.mergedReferenceMap, bytesPerMap());      VM.sysWriteln(jsrInfo.unusualReferenceMaps[jsrInfo.mergedReferenceMap]);      VM.sysWriteln("     jsrInfo.mergedReturnAddressMap Index = ", jsrInfo.mergedReturnAddressMap);      VM.sysWriteln("    jsrInfo.mergedReturnAddressMap  = ", jsrInfo.unusualReferenceMaps[jsrInfo.mergedReturnAddressMap]);      showInfo();      jsrInfo.showUnusualMapInfo(bytesPerMap());    }  }