Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8256883

C2: Add a RegMask iterator

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b26

      Description

      There are a few places around C2 where we inefficiently iterate over RegMasks:

        RegMask rm = n->out_RegMask();// Make local copy
        while( rm.is_NotEmpty() ) {
          OptoReg::Name kill = rm.find_first_elem();
          rm.Remove(kill);
          verify_do_def( n, kill, msg );
        }

      This copies a RegMask, then find_first_elem + remove in a loop until all registers have been found. find_first_elem is O(n), so this is accidentally quadratic.

      By implementing a simple RegMaskIterator we can speed this up and possibly make the code a bit clearer by doing so.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              redestad Claes Redestad
              Reporter:
              redestad Claes Redestad
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: