Changeset 101096 in vbox for trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
- Timestamp:
- Sep 12, 2023 10:59:30 PM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
r101091 r101096 788 788 pTbAllocator->cTotalTbs += cTbsPerChunk; 789 789 790 if ( idxChunk* cTbsPerChunk >= cInitialTbs)790 if ((idxChunk + 1) * cTbsPerChunk >= cInitialTbs) 791 791 break; 792 792 } … … 1003 1003 STAM_PROFILE_START(&pTbAllocator->StatPrune, a); 1004 1004 uint32_t const msNow = pVCpu->iem.s.msRecompilerPollNow; 1005 uint32_t const cTbsToPrune = 128; 1006 uint32_t const cTbsPerGroup = 4; 1005 1007 uint32_t cFreedTbs = 0; 1006 1008 #ifdef IEMTB_SIZE_IS_POWER_OF_TWO 1007 uint32_t idxTbPruneFrom = pTbAllocator->iPruneFrom & ~(uint32_t) 3;1009 uint32_t idxTbPruneFrom = pTbAllocator->iPruneFrom & ~(uint32_t)(cTbsToPrune - 1); /* Stay within a chunk! */ 1008 1010 #else 1009 1011 uint32_t idxTbPruneFrom = pTbAllocator->iPruneFrom; 1010 1012 #endif 1011 if (idxTbPruneFrom > pTbAllocator->cMaxTbs)1013 if (idxTbPruneFrom >= pTbAllocator->cMaxTbs) 1012 1014 idxTbPruneFrom = 0; 1013 for (uint32_t i = 0; i < 128; i += 4, idxTbPruneFrom += 4)1015 for (uint32_t i = 0; i < cTbsToPrune; i += cTbsPerGroup, idxTbPruneFrom += cTbsPerGroup) 1014 1016 { 1015 1017 uint32_t idxChunk = IEMTBALLOC_IDX_TO_CHUNK(pTbAllocator, idxTbPruneFrom); … … 1017 1019 PIEMTB pTb = &pTbAllocator->aChunks[idxChunk].paTbs[idxInChunk]; 1018 1020 uint32_t cMsAge = msNow - pTb->msLastUsed; 1019 for (uint32_t j = 1, idxChunk2 = idxChunk, idxInChunk2 = idxInChunk + 1; j < 4; j++, idxInChunk2++)1021 for (uint32_t j = 1, idxChunk2 = idxChunk, idxInChunk2 = idxInChunk + 1; j < cTbsPerGroup; j++, idxInChunk2++) 1020 1022 { 1021 1023 #ifndef IEMTB_SIZE_IS_POWER_OF_TWO
Note:
See TracChangeset
for help on using the changeset viewer.