Changeset 105179 in vbox for trunk/src/VBox/VMM/VMMAll
- Timestamp:
- Jul 8, 2024 10:38:14 AM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllThrdRecompiler.cpp
r105178 r105179 946 946 pTb->pabOpcodes = NULL; 947 947 948 ASMBitClear(&pTbAllocator->bmAllocated, IEMTBALLOC_IDX_MAKE(pTbAllocator, idxChunk, idxInChunk)); 948 if (pTbAllocator->idxTbCacheFree < RT_ELEMENTS(pTbAllocator->apTbFreeCache)) 949 pTbAllocator->apTbFreeCache[pTbAllocator->idxTbCacheFree++] = pTb; 950 else 951 ASMBitClear(&pTbAllocator->bmAllocated, IEMTBALLOC_IDX_MAKE(pTbAllocator, idxChunk, idxInChunk)); 949 952 Assert(pTbAllocator->cInUseTbs > 0); 950 953 … … 1092 1095 Assert(pTbAllocator->cInUseTbs < pTbAllocator->cTotalTbs); 1093 1096 1094 int idxTb; 1095 if (pTbAllocator->iStartHint < pTbAllocator->cTotalTbs) 1096 idxTb = ASMBitNextClear(pTbAllocator->bmAllocated, 1097 pTbAllocator->cTotalTbs, 1098 pTbAllocator->iStartHint & ~(uint32_t)63); 1097 PIEMTB pTb; 1098 if (pTbAllocator->idxTbCacheFree) 1099 pTb = pTbAllocator->apTbFreeCache[--pTbAllocator->idxTbCacheFree]; 1099 1100 else 1100 idxTb = -1; 1101 if (idxTb < 0) 1102 { 1103 idxTb = ASMBitFirstClear(pTbAllocator->bmAllocated, pTbAllocator->cTotalTbs); 1104 AssertLogRelReturn(idxTb >= 0, NULL); 1105 } 1106 Assert((uint32_t)idxTb < pTbAllocator->cTotalTbs); 1107 pTbAllocator->iStartHint = idxTb; 1108 ASMBitSet(pTbAllocator->bmAllocated, idxTb); 1109 1110 /** @todo shift/mask optimization for power of two IEMTB sizes. */ 1111 uint32_t const idxChunk = IEMTBALLOC_IDX_TO_CHUNK(pTbAllocator, idxTb); 1112 uint32_t const idxTbInChunk = IEMTBALLOC_IDX_TO_INDEX_IN_CHUNK(pTbAllocator, idxTb, idxChunk); 1113 PIEMTB const pTb = &pTbAllocator->aChunks[idxChunk].paTbs[idxTbInChunk]; 1114 Assert(pTb->idxAllocChunk == idxChunk); 1101 { 1102 int idxTb; 1103 if (pTbAllocator->iStartHint < pTbAllocator->cTotalTbs) 1104 idxTb = ASMBitNextClear(pTbAllocator->bmAllocated, 1105 pTbAllocator->cTotalTbs, 1106 pTbAllocator->iStartHint & ~(uint32_t)63); 1107 else 1108 idxTb = -1; 1109 if (idxTb < 0) 1110 { 1111 idxTb = ASMBitFirstClear(pTbAllocator->bmAllocated, pTbAllocator->cTotalTbs); 1112 AssertLogRelReturn(idxTb >= 0, NULL); 1113 } 1114 Assert((uint32_t)idxTb < pTbAllocator->cTotalTbs); 1115 pTbAllocator->iStartHint = idxTb; 1116 ASMBitSet(pTbAllocator->bmAllocated, idxTb); 1117 1118 /** @todo shift/mask optimization for power of two IEMTB sizes. */ 1119 uint32_t const idxChunk = IEMTBALLOC_IDX_TO_CHUNK(pTbAllocator, idxTb); 1120 uint32_t const idxTbInChunk = IEMTBALLOC_IDX_TO_INDEX_IN_CHUNK(pTbAllocator, idxTb, idxChunk); 1121 pTb = &pTbAllocator->aChunks[idxChunk].paTbs[idxTbInChunk]; 1122 Assert(pTb->idxAllocChunk == idxChunk); 1123 } 1115 1124 1116 1125 pTbAllocator->cInUseTbs += 1;
Note:
See TracChangeset
for help on using the changeset viewer.