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

Refactor Symbol to make _length a standalone field again

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 12, 13, 14
    • Fix Version/s: 15
    • Component/s: hotspot
    • Subcomponent:
    • Resolved In Build:
      b12

      Description

      JDK-8207359 merged Symbol::_refcount and _length into a single field. We should refactor this to instead pack _refcount and _identity_hash, leaving _length as a standalone field.

      _length is used in a lot more places, so not having to call a method to extract the value using shifts results in a code size reduction and potential speed-up. Except for a path only used when dumping CDS archives, _identity_hash is only accessed in one place, and there in conjunction with an access to length.

      External tools like async-profiler[1] have been found to depend on Symbol::_length, which broke and required a fix in JDK 12. I haven't found any tools that care about the _identity_hash and _refcount fields, though.

      [1] https://github.com/jvm-profiling-tools/async-profiler

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved: