| 5566 | } |
| 5567 | |
| 5568 | void BfCompiler::UpdateCompletion() |
| 5569 | { |
| 5570 | if (mIsResolveOnly) |
| 5571 | return; |
| 5572 | |
| 5573 | float typeScale = 10.0f; |
| 5574 | float methodScale = 1.0f; |
| 5575 | float queueModuleScale = 50.0f; |
| 5576 | float genModuleScale = 50.0f; |
| 5577 | |
| 5578 | mCodeGen.UpdateStats(); |
| 5579 | |
| 5580 | BF_ASSERT(mCodeGen.mQueuedCount >= mCodeGen.mCompletionCount); |
| 5581 | BF_ASSERT(mStats.mModulesFinished <= mStats.mModulesStarted); |
| 5582 | BF_ASSERT(mCodeGen.mCompletionCount <= mStats.mModulesStarted); |
| 5583 | |
| 5584 | float numerator = ((mStats.mQueuedTypesProcessed * typeScale) + //(mStats.mMethodsProcessed * methodScale) + |
| 5585 | (mStats.mModulesFinished * queueModuleScale) + (mCodeGen.mCompletionCount * genModuleScale)); |
| 5586 | float divisor = ((mStats.mTypesQueued * typeScale) + //(mStats.mMethodsQueued * methodScale) + |
| 5587 | (mStats.mModulesStarted * queueModuleScale) + (mStats.mReifiedModuleCount * genModuleScale)); |
| 5588 | float checkPct = 0; |
| 5589 | if (divisor > 0) |
| 5590 | { |
| 5591 | checkPct = numerator / divisor; |
| 5592 | BF_ASSERT(checkPct >= 0); |
| 5593 | if (checkPct > mCompletionPct) |
| 5594 | mCompletionPct = checkPct; |
| 5595 | } |
| 5596 | else |
| 5597 | mCompletionPct = 0; |
| 5598 | if (!mHadCancel) |
| 5599 | BF_ASSERT(mCompletionPct <= 1.0f); |
| 5600 | if (mCompletionPct > 1.0f) |
| 5601 | mCompletionPct = 1.0f; |
| 5602 | } |
| 5603 | |
| 5604 | void BfCompiler::MarkStringPool(BfModule* module) |
| 5605 | { |
no test coverage detected