VirtualBox

Ignore:
Timestamp:
Feb 23, 2024 12:26:32 AM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161888
Message:

VMM/IEM: More helpful way to make the MC block names unique. bugref:10370

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/VMM/VMMAll/IEMAllInstPython.py

    r103256 r103542  
    15051505        ## @}
    15061506
     1507        ## All the MC blocks associated with this instruction.
     1508        self.aoMcBlocks     = []        # type: List[McBlock]
     1509
    15071510    def toString(self, fRepr = False):
    15081511        """ Turn object into a string. """
     
    18671870                    return oHit;
    18681871        return None;
     1872
     1873    @staticmethod
     1874    def countStmtsByName(aoStmts, dNames, dRet):
     1875        """
     1876        Searches the given list of statements for the names in the dictionary,
     1877        adding each found to dRet with an occurnece count.
     1878
     1879        return total number of hits;
     1880        """
     1881        cHits = 0;
     1882        for oStmt in aoStmts:
     1883            if oStmt.sName in dNames:
     1884                dRet[oStmt.sName] = dRet.get(oStmt.sName, 0) + 1;
     1885                cHits += 1;
     1886            if isinstance(oStmt, McStmtCond):
     1887                cHits += McStmt.countStmtsByName(oStmt.aoIfBranch,   dNames, dRet);
     1888                cHits += McStmt.countStmtsByName(oStmt.aoElseBranch, dNames, dRet);
     1889        return cHits;
    18691890
    18701891    def isCppStmt(self):
     
    53645385            self.raiseError(oXcpt.args[0]);
    53655386
     5387        if self.oCurMcBlock.oInstruction:
     5388            self.oCurMcBlock.oInstruction.aoMcBlocks.append(self.oCurMcBlock);
    53665389        self.iMcBlockInFunc += 1;
    53675390        return True;
     
    55285551
    55295552        g_aoMcBlocks.append(oMcBlock);
     5553        if oMcBlock.oInstruction:
     5554            oMcBlock.oInstruction.aoMcBlocks.append(oMcBlock);
    55305555        self.cTotalMcBlocks += 1;
    55315556        self.iMcBlockInFunc += 1;
     
    60616086
    60626087# Some sanity checking.
    6063 for sClass, dLists in SimpleParser.kdEFlagsClasses.items():
    6064     for sAttrib, asFlags in dLists.items():
    6065         for sFlag in asFlags:
    6066             assert sFlag in g_kdEFlagsMnemonics, 'sClass=%s sAttrib=%s sFlag=%s' % (sClass, sAttrib, sFlag,);
     6088def __sanityCheckEFlagsClasses():
     6089    for sClass, dLists in SimpleParser.kdEFlagsClasses.items():
     6090        for sAttrib, asFlags in dLists.items():
     6091            for sFlag in asFlags:
     6092                assert sFlag in g_kdEFlagsMnemonics, 'sClass=%s sAttrib=%s sFlag=%s' % (sClass, sAttrib, sFlag,);
     6093__sanityCheckEFlagsClasses();
    60676094
    60686095## The parsed content of IEMAllInstCommonBodyMacros.h.
Note: See TracChangeset for help on using the changeset viewer.

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