# HG changeset patch # User bpb # Date 1539219202 25200 # Node ID c7f7d824f2b6b6d58c71b8ca2fcba6589680f29a # Parent a36ee8e96c1e31367a73609a95cbc29364cf85fd 8152910: Get performance improvement with Stable annotation Reviewed-by: darcy Contributed-by: Peter Levart diff -r a36ee8e96c1e -r c7f7d824f2b6 src/java.base/share/classes/java/math/BigInteger.java --- a/src/java.base/share/classes/java/math/BigInteger.java Thu Oct 11 00:43:09 2018 +0200 +++ b/src/java.base/share/classes/java/math/BigInteger.java Wed Oct 10 17:53:22 2018 -0700 @@ -41,6 +41,7 @@ import jdk.internal.math.DoubleConsts; import jdk.internal.math.FloatConsts; import jdk.internal.HotSpotIntrinsicCandidate; +import jdk.internal.vm.annotation.Stable; /** * Immutable arbitrary-precision integers. All operations behave as if @@ -1219,8 +1220,10 @@ * Initialize static constant array when class is loaded. */ private static final int MAX_CONSTANT = 16; - private static BigInteger posConst[] = new BigInteger[MAX_CONSTANT+1]; - private static BigInteger negConst[] = new BigInteger[MAX_CONSTANT+1]; + @Stable + private static final BigInteger[] posConst = new BigInteger[MAX_CONSTANT+1]; + @Stable + private static final BigInteger[] negConst = new BigInteger[MAX_CONSTANT+1]; /** * The cache of powers of each radix. This allows us to not have to