Optimize Klass::is_shared()

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 10
    • Affects Version/s: None
    • Component/s: hotspot
    • b21

      During itable/vtable initialization, klass->is_shared() is called frequently. Because there's no specialized implementation of Klass::is_shared(), we end up calling MetaspaceObj::is_shared, which walks the list of shared regions.

      JDK-8178351 proposes simplifying MetaspaceObj::is_shared() by doing fewer comparisons. However, in the case of Klass, we can actually use a free bit in Klass::_access_flags to indicate whether the Klass is shared, so we can have an even more optimal implementation of Klass::is_shared().

            Assignee:
            Ioi Lam
            Reporter:
            Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: