8295555: Primitive wrapper caches could be @Stable

Reviewed-by: rriggs
This commit is contained in:
Per Minborg 2023-06-13 08:39:00 +00:00
parent 5d716121c1
commit f7de726bd3
5 changed files with 16 additions and 5 deletions

View file

@ -29,6 +29,7 @@ import jdk.internal.misc.CDS;
import jdk.internal.misc.VM;
import jdk.internal.vm.annotation.ForceInline;
import jdk.internal.vm.annotation.IntrinsicCandidate;
import jdk.internal.vm.annotation.Stable;
import java.lang.annotation.Native;
import java.lang.constant.Constable;
@ -1005,9 +1006,11 @@ public final class Integer extends Number
* with new Integer object(s) after initialization.
*/
private static class IntegerCache {
private static final class IntegerCache {
static final int low = -128;
static final int high;
@Stable
static final Integer[] cache;
static Integer[] archivedCache;