Details
-
Enhancement
-
Resolution: Fixed
-
P4
-
17, 20, 21
-
b02
-
generic
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8319215 | 21.0.2 | Aleksey Shipilev | P4 | Resolved | Fixed | b05 |
Description
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.
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.
Attachments
Issue Links
- backported by
-
JDK-8319215 Primitive wrapper caches could be `@Stable`
-
- Resolved
-
- relates to
-
JDK-8001107 @Stable annotation for constant folding of lazily evaluated variables
-
- Resolved
-
- links to
-
Commit openjdk/jdk21u/067cd17c
-
Commit openjdk/jdk/f7de726b
-
Review openjdk/jdk21u/286
-
Review openjdk/jdk/14418
(1 links to)