Make RegMask copy constructor explicit and replace RegMask operator= with named function

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 26
    • Affects Version/s: 26
    • Component/s: hotspot
    • b21

      The RegMask copy constructor is currently non-explicit. Making it explicit catches a few probably unintended register mask copies in the below methods.
      - Matcher::divI_proj_mask
      - Matcher::modI_proj_mask
      - Matcher::divL_proj_mask
      - Matcher::modL_proj_mask
      These methods could and should return a const RegMask&, but instead (implicitly) construct a new RegMask. Making the copy constructor explicit guarantees we catch and do not introduce similar cases in the future.

      RegMask additionally relies on overloading operator= for deep copy assignment, which somewhat conflicts with the HotSpot coding style ("Avoid most operator overloading, preferring named functions"). We should replace the overloaded operator= with a named function.

            Assignee:
            Daniel Lunden
            Reporter:
            Daniel Lunden
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: