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

Declare package-private VarHandle.AccessMode/AccessType counts

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 17
    • None
    • core-libs

      When creating VarHandles and in a few other places we call VarHandle.AccessMode/-Type.values().length. This cause cloning of the underlying array, only to discard it. An optimizing compiler would of course shortcut this, but these calls mostly happen during startup of applications. To reduce startup/warmup overheads of using VarHandles (which will be more crucial with JDK-8267277) it makes sense to introduce a constant value equal to values().length.

            redestad Claes Redestad
            redestad Claes Redestad
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: