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

Primitive wrapper caches could be `@Stable`

XMLWordPrintable

    • b02
    • generic
    • generic

        A DESCRIPTION OF THE PROBLEM :
        The @jdk.internal.vm.annotation.Stable annotation indicates to the HotSpot vm that it can trust the contents of an array to be treated as constant. I think that primitive wrapper caches (such as Integer.IntegerCache.cache) could benefit from such optimization.

        Please correct me if I'm wrong, I'd love to know if there's other, more powerful optimizations in place, or other reasons why this wouldn't be a good idea or could cause issues.


              pminborg Per-Ake Minborg
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: