| 623 | } |
| 624 | |
| 625 | void BfCompiler::CheckModuleStringRefs(BfModule* module, BfVDataModule* vdataModule, int lastModuleRevision, HashSet<int>& foundStringIds, HashSet<int>& dllNameSet, Array<BfMethodInstance*>& dllMethods, Array<BfCompiler::StringValueEntry>& stringValueEntries) |
| 626 | { |
| 627 | for (int stringId : module->mStringPoolRefs) |
| 628 | { |
| 629 | if (foundStringIds.Add(stringId)) |
| 630 | { |
| 631 | BfStringPoolEntry& stringPoolEntry = module->mContext->mStringObjectIdMap[stringId]; |
| 632 | |
| 633 | if (IsHotCompile()) |
| 634 | { |
| 635 | if (vdataModule->mDefinedStrings.Contains(stringId)) |
| 636 | continue; |
| 637 | } |
| 638 | |
| 639 | StringValueEntry stringEntry; |
| 640 | stringEntry.mId = stringId; |
| 641 | |
| 642 | vdataModule->mDefinedStrings.Add(stringId); |
| 643 | stringEntry.mStringVal = vdataModule->CreateStringObjectValue(stringPoolEntry.mString, stringId, true); |
| 644 | stringValueEntries.Add(stringEntry); |
| 645 | |
| 646 | CompileLog("String %d %s\n", stringId, stringPoolEntry.mString.c_str()); |
| 647 | } |
| 648 | } |
| 649 | |
| 650 | for (auto dllNameId : module->mImportFileNames) |
| 651 | dllNameSet.Add(dllNameId); |
| 652 | |
| 653 | for (auto& dllImportEntry : module->mDllImportEntries) |
| 654 | dllMethods.push_back(dllImportEntry.mMethodInstance); |
| 655 | |
| 656 | auto altModule = module->mNextAltModule; |
| 657 | while (altModule != NULL) |
| 658 | { |
| 659 | CheckModuleStringRefs(altModule, vdataModule, lastModuleRevision, foundStringIds, dllNameSet, dllMethods, stringValueEntries); |
| 660 | altModule = altModule->mNextAltModule; |
| 661 | } |
| 662 | |
| 663 | for (auto& specModulePair : module->mSpecializedMethodModules) |
| 664 | CheckModuleStringRefs(specModulePair.mValue, vdataModule, lastModuleRevision, foundStringIds, dllNameSet, dllMethods, stringValueEntries); |
| 665 | } |
| 666 | |
| 667 | void BfCompiler::HashModuleVData(BfModule* module, HashContext& vdataHash) |
| 668 | { |
nothing calls this directly
no test coverage detected