VM.sysWrite(", Machine Code (MC) Offset: "); VM.sysWrite(instructionOffset); VM.sysWrite("\n"); VM.sysFail("VM_OptGenericMapIterator: findGCMapIndex failed\n");
VM.sysWriteln("\nBase of its code array", VM_Magic.objectAsAddress(cm.getInstructions()).toInt()); int ra = VM_Magic.objectAsAddress(cm.getInstructions()).toInt() + instructionOffset; VM.sysWriteln("Calculated actual return address is ", ra); VM_CompiledMethod realCM = VM_CompiledMethods.findMethodForInstruction(VM_Address.fromInt(ra)); if (realCM == null) { VM.sysWriteln("Unable to find compiled method corresponding to this return address"); } else { VM.sysWrite("Found compiled method "); VM.sysWrite(realCM.getMethod()); VM.sysWriteln(" whose code contains this return address"); } VM.sysFail("VM_OptGenericMapIterator: setupIterator failed\n");
  public final void setupIterator(VM_CompiledMethod cm, 				  int instructionOffset, 				  VM_Address framePtr) {    if (DEBUG) {      VM.sysWrite("\n\t   ==========================\n");      VM.sysWrite("Reference map request made");      VM.sysWrite(" for machine code offset: ");      VM.sysWrite(instructionOffset);      VM.sysWrite("\n");      VM.sysWrite("\tframePtr: ");      VM.sysWrite(framePtr);      VM.sysWrite("\n");    }    reset();    // retrieve and save the corresponding VM_OptMachineCodeMap for    // this method and instructionOffset    compiledMethod = (VM_OptCompiledMethod)cm;    map = compiledMethod.getMCMap();    mapIndex = map.findGCMapIndex(instructionOffset);    if (mapIndex == VM_OptGCMap.ERROR) {      VM.sysWrite("VM_OptMachineCodeMap: findGCMapIndex failed\n");      VM.sysWrite("Method: ");      VM.sysWrite(compiledMethod.getMethod());      VM.sysWrite(", Machine Code (MC) Offset: ");      VM.sysWrite(instructionOffset);      VM.sysWrite("\n");      VM.sysFail("VM_OptGenericMapIterator: findGCMapIndex failed\n");    }    // save the frame pointer    this.framePtr = framePtr;    if (DEBUG) {      VM.sysWrite("\tMethod: ");      VM.sysWrite(compiledMethod.getMethod());      VM.sysWrite("\n ");      if (mapIndex == VM_OptGCMap.NO_MAP_ENTRY) {        VM.sysWrite("... empty map found\n");      } else {        VM.sysWrite("... found a map\n");      }      if (lookForMissedReferencesInSpills) {	VM.sysWrite("FramePtr: ");	VM.sysWrite(framePtr);	VM.sysWrite("\tFirst Spill: ");	VM.sysWrite(getFirstSpillLoc());	VM.sysWrite("\tLast Spill: ");	VM.sysWrite(getLastSpillLoc());	VM.sysWrite("\n");      }    }  }