Changeset 101490 in vbox for trunk/src/VBox/VMM
- Timestamp:
- Oct 18, 2023 9:00:11 AM (18 months ago)
- svn:sync-xref-src-repo-rev:
- 159562
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp
r101484 r101490 1201 1201 RTCritSectLeave(&g_IemNativeGdbJitLock); 1202 1202 1203 RT_BREAKPOINT(); 1204 # endif 1203 # endif /* IEMNATIVE_USE_GDB_JIT */ 1205 1204 1206 1205 return VINF_SUCCESS; … … 2012 2011 if (fRegs) 2013 2012 { 2014 fPreferVolatile = false; /// @todo DO NOT COMMIT THIS2015 2013 if (fPreferVolatile) 2016 2014 idxReg = (uint8_t)ASMBitFirstSetU32( fRegs & IEMNATIVE_CALL_VOLATILE_GREG_MASK … … 2741 2739 2742 2740 /** 2741 * Flushes a set of guest register shadow copies. 2742 * 2743 * This is usually done after calling a threaded function or a C-implementation 2744 * of an instruction. 2745 * 2746 * @param pReNative The native recompile state. 2747 * @param fGstRegs Set of guest registers to flush. 2748 */ 2749 DECLHIDDEN(void) iemNativeRegFlushGuestShadows(PIEMRECOMPILERSTATE pReNative, uint64_t fGstRegs) RT_NOEXCEPT 2750 { 2751 /* 2752 * Reduce the mask by what's currently shadowed 2753 */ 2754 fGstRegs &= pReNative->bmGstRegShadows; 2755 if (fGstRegs) 2756 { 2757 pReNative->bmGstRegShadows &= ~fGstRegs; 2758 if (pReNative->bmGstRegShadows) 2759 { 2760 /* 2761 * Partial. 2762 */ 2763 do 2764 { 2765 unsigned const idxGstReg = ASMBitFirstSetU64(fGstRegs) - 1; 2766 uint8_t const idxHstReg = pReNative->aidxGstRegShadows[idxGstReg]; 2767 Assert(idxHstReg < RT_ELEMENTS(pReNative->aidxGstRegShadows)); 2768 Assert(pReNative->bmHstRegsWithGstShadow & RT_BIT_32(idxHstReg)); 2769 Assert(pReNative->aHstRegs[idxHstReg].fGstRegShadows & RT_BIT_64(idxGstReg)); 2770 2771 uint64_t const fInThisHstReg = (pReNative->aHstRegs[idxHstReg].fGstRegShadows & fGstRegs) | RT_BIT_64(idxGstReg); 2772 fGstRegs &= ~fInThisHstReg; 2773 pReNative->aHstRegs[idxHstReg].fGstRegShadows &= fInThisHstReg; 2774 if (!pReNative->aHstRegs[idxHstReg].fGstRegShadows) 2775 pReNative->bmHstRegsWithGstShadow &= ~RT_BIT_32(idxHstReg); 2776 } while (fGstRegs != 0); 2777 } 2778 else 2779 { 2780 /* 2781 * Clear all. 2782 */ 2783 do 2784 { 2785 unsigned const idxGstReg = ASMBitFirstSetU64(fGstRegs) - 1; 2786 uint8_t const idxHstReg = pReNative->aidxGstRegShadows[idxGstReg]; 2787 Assert(idxHstReg < RT_ELEMENTS(pReNative->aidxGstRegShadows)); 2788 Assert(pReNative->bmHstRegsWithGstShadow & RT_BIT_32(idxHstReg)); 2789 Assert(pReNative->aHstRegs[idxHstReg].fGstRegShadows & RT_BIT_64(idxGstReg)); 2790 2791 fGstRegs &= ~(pReNative->aHstRegs[idxHstReg].fGstRegShadows | RT_BIT_64(idxGstReg)); 2792 pReNative->aHstRegs[idxHstReg].fGstRegShadows = 0; 2793 } while (fGstRegs != 0); 2794 pReNative->bmHstRegsWithGstShadow = 0; 2795 } 2796 } 2797 } 2798 2799 2800 /** 2743 2801 * Emits a code for checking the return code of a call and rcPassUp, returning 2744 2802 * from the code if either are non-zero. … … 2889 2947 AssertReturn(off != UINT32_MAX, UINT32_MAX); 2890 2948 #endif 2891 /** @todo Must flush all shadow guest registers as well.*/2949 iemNativeRegFlushGuestShadows(pReNative, UINT64_MAX); /** @todo optimize this */ 2892 2950 off = iemNativeRegMoveAndFreeAndFlushAtCall(pReNative, off, 4, false /*fFreeArgVars*/); 2893 2951 uint8_t const cParams = g_acIemThreadedFunctionUsedArgs[pCallEntry->enmFunction];
Note:
See TracChangeset
for help on using the changeset viewer.