| 6662 | } |
| 6663 | |
| 6664 | void BeMCContext::InitializedPassHelper(BeMCBlock* mcBlock, BeVTrackingGenContext* genCtx, bool& modifiedBlockBefore, bool& modifiedBlockAfter) |
| 6665 | { |
| 6666 | modifiedBlockBefore = false; |
| 6667 | modifiedBlockAfter = false; |
| 6668 | |
| 6669 | genCtx->mBlocks[mcBlock->mBlockIdx].mGenerateCount++; |
| 6670 | genCtx->mCalls++; |
| 6671 | |
| 6672 | genCtx->mHandledCalls++; |
| 6673 | |
| 6674 | BeMDNode* curDbgScope = NULL; |
| 6675 | |
| 6676 | BeVTrackingList* vregsInitialized = mcBlock->mPredVRegsInitialized; |
| 6677 | |
| 6678 | //OutputDebugStrF("InitializedPassHelper %@\n", vregsInitialized.mList); |
| 6679 | |
| 6680 | mActiveBlock = mcBlock; |
| 6681 | for (int instIdx = 0; instIdx < (int)mcBlock->mInstructions.size(); instIdx++) |
| 6682 | { |
| 6683 | genCtx->mInstructions++; |
| 6684 | |
| 6685 | mInsertInstIdxRef = &instIdx; |
| 6686 | auto inst = mcBlock->mInstructions[instIdx]; |
| 6687 | |
| 6688 | inst->mVRegsInitialized = vregsInitialized; |
| 6689 | |
| 6690 | bool deepSet = false; |
| 6691 | |
| 6692 | if (inst->mKind == BeMCInstKind_LifetimeStart) |
| 6693 | continue; |
| 6694 | |
| 6695 | SizedArray<int, 16> removeVec; |
| 6696 | SizedArray<int, 16> addVec; |
| 6697 | SizedArray<int, 16> filteredRemoveVec; |
| 6698 | SizedArray<int, 16> filteredAddVec; |
| 6699 | |
| 6700 | // |
| 6701 | { |
| 6702 | auto checkLastUseRecord = inst->mVRegLastUseRecord; |
| 6703 | while (checkLastUseRecord != NULL) |
| 6704 | { |
| 6705 | removeVec.Add(checkLastUseRecord->mVRegIdx); |
| 6706 | checkLastUseRecord = checkLastUseRecord->mNext; |
| 6707 | } |
| 6708 | } |
| 6709 | |
| 6710 | if ((inst->mKind == BeMCInstKind_ValueScopeSoftEnd) || (inst->mKind == BeMCInstKind_ValueScopeHardEnd)) |
| 6711 | { |
| 6712 | bool isSoft = inst->mKind == BeMCInstKind_ValueScopeSoftEnd; |
| 6713 | |
| 6714 | int startVRegIdx = (int)inst->mArg0.mImmediate; |
| 6715 | int endVRegIdx = (int)inst->mArg1.mImmediate; |
| 6716 | |
| 6717 | int listIdx = mVRegInitializedContext.FindIndex(vregsInitialized, startVRegIdx); |
| 6718 | if (listIdx < 0) |
| 6719 | listIdx = ~listIdx; |
| 6720 | for (; listIdx < vregsInitialized->mSize; listIdx++) |
| 6721 | { |
nothing calls this directly
no test coverage detected