[lworld] Improve performance of identityHashCode for value objects

XMLWordPrintable

      Performance of System.identityHashCode(...) is bad for value objects. Here's a plan on how to improve this:
      (1) Enable storing the hash code in the mark word of value objects with JDK-8376171. JDK-8372268 will then make sure that we keep the buffer object at scalarized calls, and therefore the stored hash code.
      (2) Add a fast path for value objects with only one primitive field but otherwise unknown layout to speedup (re-)computation of the hash for primitive boxes and therefore avoid regressions in legacy code.
      (3) Intrinsify the hash code computation in C2 when the receiver is scalarized and no buffer object is available to load the cached hash from (for example, when loading from a flat array).

      We should also add comprehensive benchmarks / tests for all these cases.

            Assignee:
            Tobias Hartmann
            Reporter:
            Mandy Chung (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated: