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

Avoid fetching _klass twice in TypeArrayOop::size()

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 8-shenandoah, 11-shenandoah, 12, 13
    • Fix Version/s: tbd
    • Component/s: hotspot
    • Subcomponent:
      gc
    • CPU:
      generic
    • OS:
      generic

      Description

      Currently, when calling TypeArrayOop::size(), we end up calling klass() twice: once before calling into size_given_klass() and then again before calling TypeArrayOop::object_size().

      This is currently only a minor performance nuisance.

      With upcoming Shenandoah's elimination of forwarding pointer, loading klass like this is not safe anymore, and therefore we only call size_given_klass(), and must avoid calling naked klass() altogether.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rkennke Roman Kennke
              Reporter:
              rkennke Roman Kennke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: