Uploaded image for project: 'JikesRVM'
  1. RVM-1090

Improve documentation of register allocator data structures with respect to contracts of equals(), hashCode() and compareTo()

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.1.3
    • Fix Version/s: 3.1.4
    • Component/s: Compiler: Optimizing
    • Labels:
      None
    • Environment:

      All

      Description

      Some of the data structures in the regalloc package don't obey the contracts of equals(), hashCode() and compareTo().

      In particular,

      • BasicInterval and MappedBasicInterval implement equals() but not hashCode()
      • equals() isn't symmetric between BasicInterval and MappedBasicInterval
      • StartComparator in IncreasingStartIntervalSet would consider instances of MappedBasicInterval and BasicInterval equivalent even if a correct equals() implementation would return false. The same applies for the comparators in IncreasingEndMappedIntervalSet and IncreasingStartMappedIntervalSet

      Moreover, IncreasingStartMappedIntervalSet is currently unused. BasicInterval is only used as an internal helper class.

      We should refactor and/or redesign the data structures to ensure that they work correctly. After that, the documentation needs to be updated. Unit tests would also be very helpful.

        Attachments

          Activity

            People

            • Assignee:
              ebrangs Erik Brangs
              Reporter:
              ebrangs Erik Brangs
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: