| 4276 | } |
| 4277 | |
| 4278 | void BeMCContext::MarkLive(BeVTrackingList* liveRegs, SizedArrayImpl<int>& newRegs, BeVTrackingList*& vregsInitialized, const BeMCOperand& operand) |
| 4279 | { |
| 4280 | int vregIdx = operand.mVRegIdx; |
| 4281 | auto vregInfo = mVRegInfo[vregIdx]; |
| 4282 | |
| 4283 | if (mLivenessContext.IsSet(liveRegs, operand.mVRegIdx)) |
| 4284 | return; |
| 4285 | |
| 4286 | for (auto newReg : newRegs) |
| 4287 | if (newReg == operand.mVRegIdx) |
| 4288 | return; |
| 4289 | |
| 4290 | if (!mColorizer.mNodes.empty()) |
| 4291 | { |
| 4292 | // Is new |
| 4293 | for (int i = 0; i < liveRegs->mSize; i++) |
| 4294 | { |
| 4295 | int checkReg = liveRegs->mEntries[i]; |
| 4296 | if (checkReg >= mLivenessContext.mNumItems) |
| 4297 | continue; |
| 4298 | mColorizer.AddEdge(checkReg, operand.mVRegIdx); |
| 4299 | } |
| 4300 | |
| 4301 | for (auto checkReg : newRegs) |
| 4302 | mColorizer.AddEdge(checkReg, operand.mVRegIdx); |
| 4303 | } |
| 4304 | |
| 4305 | if (vregInfo->mHasDynLife) |
| 4306 | { |
| 4307 | if (!mVRegInitializedContext.IsSet(vregsInitialized, vregIdx)) |
| 4308 | { |
| 4309 | // This indicates that this is a 'def' usage, meaning the value wasn't actually set yet |
| 4310 | // so don't propagate this index upward |
| 4311 | return; |
| 4312 | } |
| 4313 | } |
| 4314 | |
| 4315 | if ((vregInfo->mRelTo) && (vregInfo->mRelTo.IsVRegAny())) |
| 4316 | MarkLive(liveRegs, newRegs, vregsInitialized, vregInfo->mRelTo); |
| 4317 | if ((vregInfo->mRelOffset) && (vregInfo->mRelOffset.IsVRegAny())) |
| 4318 | MarkLive(liveRegs, newRegs, vregsInitialized, vregInfo->mRelOffset); |
| 4319 | |
| 4320 | newRegs.push_back(operand.mVRegIdx); |
| 4321 | } |
| 4322 | |
| 4323 | BeVTrackingList* BeMCContext::MergeLiveRegs(BeVTrackingList* prevDestEntry, BeVTrackingList* mergeFrom) |
| 4324 | { |