VirtualBox

Changeset 106478 in vbox for trunk/src/VBox/VMM/VMMAll


Ignore:
Timestamp:
Oct 18, 2024 1:20:19 PM (7 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
165305
Message:

VMM/IEM: Some IEMNATIVEVAR / iemNativeVarAllocInt optimization tweaks. bugref:10720

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllN8veRecompiler.cpp

    r106465 r106478  
    70987098 * @internal
    70997099 */
    7100 static uint8_t iemNativeVarAllocInt(PIEMRECOMPILERSTATE pReNative, uint8_t cbType)
     7100DECL_INLINE_THROW(uint8_t) iemNativeVarAllocInt(PIEMRECOMPILERSTATE pReNative, uint8_t cbType)
    71017101{
    71027102    Assert(cbType > 0 && cbType <= 64);
    71037103    unsigned const idxVar = ASMBitFirstSetU32(~pReNative->Core.bmVars) - 1;
    71047104    AssertStmt(idxVar < RT_ELEMENTS(pReNative->Core.aVars), IEMNATIVE_DO_LONGJMP(pReNative, VERR_IEM_VAR_EXHAUSTED));
     7105
    71057106    pReNative->Core.bmVars |= RT_BIT_32(idxVar);
    7106     pReNative->Core.aVars[idxVar].enmKind        = kIemNativeVarKind_Invalid;
    7107     pReNative->Core.aVars[idxVar].cbVar          = cbType;
    7108     pReNative->Core.aVars[idxVar].idxStackSlot   = UINT8_MAX;
    7109     pReNative->Core.aVars[idxVar].idxReg         = UINT8_MAX;
    7110     pReNative->Core.aVars[idxVar].uArgNo         = UINT8_MAX;
    7111     pReNative->Core.aVars[idxVar].idxReferrerVar = UINT8_MAX;
    7112     pReNative->Core.aVars[idxVar].enmGstReg      = kIemNativeGstReg_End;
    7113     pReNative->Core.aVars[idxVar].fRegAcquired   = false;
    7114     pReNative->Core.aVars[idxVar].u.uValue       = 0;
    7115     pReNative->Core.aVars[idxVar].fSimdReg       = false;
     7107
     7108    PIEMNATIVEVAR const pVar = &pReNative->Core.aVars[idxVar]; /* VS 2019 gets a bit weird on us otherwise. */
     7109#if 0
     7110    pVar->cbVar          = cbType;
     7111    pVar->enmKind        = kIemNativeVarKind_Invalid;
     7112    pVar->fRegAcquired   = false;
     7113    pVar->fSimdReg       = false;
     7114    pVar->idxReg         = UINT8_MAX;
     7115    pVar->uArgNo         = UINT8_MAX;
     7116    pVar->idxStackSlot   = UINT8_MAX;
     7117    pVar->idxReferrerVar = UINT8_MAX;
     7118    pVar->u.uValue       = 0;
     7119#else
     7120    /* Neither clang 15 nor VC++ 2019 is able to generate this from the above. */
     7121    AssertCompileMemberOffset(IEMNATIVEVAR, cbVar, 1);
     7122    AssertCompile((int)kIemNativeVarKind_Invalid == 0);
     7123    pVar->u32Init0       = (uint32_t)cbType << 8;
     7124    pVar->u32Init1       = UINT32_MAX;
     7125    pVar->u.uValue       = 0;
     7126#endif
    71167127    return idxVar;
    71177128}
     
    78227833                   g_apszIemNativeHstRegNames[idxReg], g_aGstShadowInfo[enmGstReg].pszName));
    78237834        }
    7824         /** @todo figure this one out. We need some way of making sure the register isn't
    7825          * modified after this point, just in case we start writing crappy MC code. */
    7826         pVar->enmGstReg    = enmGstReg;
    78277835        pVar->fRegAcquired = true;
    78287836        return idxReg;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette