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.
- 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.