| 562 | } |
| 563 | |
| 564 | CeEmitEntry* CeFunction::FindEmitEntry(int instIdx, int* entryIdx) |
| 565 | { |
| 566 | int i = 0; |
| 567 | CeEmitEntry* emitEntry = NULL; |
| 568 | |
| 569 | if (!mCode.IsEmpty()) |
| 570 | { |
| 571 | int lo = 0; |
| 572 | int hi = mEmitTable.size() - 1; |
| 573 | while (lo <= hi) |
| 574 | { |
| 575 | i = (lo + hi) / 2; |
| 576 | emitEntry = &mEmitTable.mVals[i]; |
| 577 | //int c = midVal <=> value; |
| 578 | if (emitEntry->mCodePos == instIdx) break; |
| 579 | if (emitEntry->mCodePos < instIdx) |
| 580 | lo = i + 1; |
| 581 | else |
| 582 | hi = i - 1; |
| 583 | } |
| 584 | if ((emitEntry != NULL) && (emitEntry->mCodePos > instIdx) && (i > 0)) |
| 585 | { |
| 586 | emitEntry = &mEmitTable.mVals[i - 1]; |
| 587 | if (entryIdx != NULL) |
| 588 | *entryIdx = i - 1; |
| 589 | } |
| 590 | else if (entryIdx != NULL) |
| 591 | *entryIdx = i; |
| 592 | } |
| 593 | |
| 594 | return emitEntry; |
| 595 | } |
| 596 | |
| 597 | // This is for "safe" retrieval from within CeDebugger |
| 598 | int CeFunction::SafeGetId() |
no test coverage detected