bci = map.getBytecodeIndexForMCOffset(ipOffset.toInt());
bci = map.getBytecodeIndexForMCOffset(ipOffset);
  public static final Address skipOwnFramesAndDump(ObjectReference typeRef)    throws NoInlinePragma {    Object[] tib = VM_Magic.addressAsObjectArray(typeRef.toAddress());    VM_Method m = null;    int bci = -1;    int compiledMethodID = 0;    Offset ipOffset = Offset.zero();    Address fp = VM_Magic.getFramePointer();    Address ip = VM_Magic.getReturnAddress(fp);    fp = VM_Magic.getCallerFramePointer(fp);    // This code borrows heavily from VM_Scheduler.dumpStack    while (VM_Magic.getCallerFramePointer(fp).NE(STACKFRAME_SENTINEL_FP)) {      compiledMethodID = VM_Magic.getCompiledMethodID(fp);      if (compiledMethodID != INVISIBLE_METHOD_ID) {        // normal java frame(s)        VM_CompiledMethod compiledMethod =           VM_CompiledMethods.getCompiledMethod(compiledMethodID);        if (compiledMethod.getCompilerType() != VM_CompiledMethod.TRAP) {          ipOffset = (ip.diff(VM_Magic.objectAsAddress(compiledMethod.getInstructions())));          m = compiledMethod.getMethod();          //-#if RVM_WITH_OPT_COMPILER          if (compiledMethod.getCompilerType() == VM_CompiledMethod.OPT) {            VM_OptCompiledMethod optInfo = (VM_OptCompiledMethod)compiledMethod;            /* Opt stack frames may contain multiple inlined methods. */            VM_OptMachineCodeMap map = optInfo.getMCMap();            int iei = map.getInlineEncodingForMCOffset(ipOffset.toInt());            if (iei >= 0) {              int[] inlineEncoding = map.inlineEncoding;              boolean allocCall = true;              bci = map.getBytecodeIndexForMCOffset(ipOffset.toInt());              for (int j = iei; j >= 0 && allocCall;                    j = VM_OptEncodedCallSiteTree.getParent(j,inlineEncoding)) {                int mid = VM_OptEncodedCallSiteTree.getMethodID(j, inlineEncoding);                m = VM_MemberReference.getMemberRef(mid).asMethodReference().getResolvedMember();                if (!isAllocCall(m.getName().getBytes()))                  allocCall = false;                if (j > 0)                  bci = VM_OptEncodedCallSiteTree.getByteCodeOffset(j,                                                                  inlineEncoding);              }              if (!allocCall)                break;            }          } else           //-#endif          {            if (!isAllocCall(m.getName().getBytes())) {              VM_BaselineCompiledMethod baseInfo =                 (VM_BaselineCompiledMethod)compiledMethod;              bci = baseInfo.findBytecodeIndexForInstruction(ipOffset.toInt());              break;            }          }        }      }      ip = VM_Magic.getReturnAddress(fp);      fp = VM_Magic.getCallerFramePointer(fp);    }    if (m != null) {      int allocid = (((compiledMethodID & 0x0000ffff) << 15) ^                     ((compiledMethodID & 0xffff0000) >> 16) ^                      ipOffset.toInt()) & ~0x80000000;          /* Now print the location string. */      VM.write('\n');      VM.writeHex(allocid);      VM.write('-');      VM.write('>');      VM.write('[');      VM.writeHex(compiledMethodID);      VM.write(']');      m.getDeclaringClass().getDescriptor().sysWrite();      VM.write(':');      m.getName().sysWrite();      m.getDescriptor().sysWrite();      VM.write(':');      VM.writeHex(bci);      VM.write('\t');      VM_Type type = VM_Magic.objectAsType(tib[TIB_TYPE_INDEX]);      type.getDescriptor().sysWrite();      VM.write('\n');    }    return fp;  }