On Wed, 28 May 2025 13:39:40 GMT, Shaojin Wen <s...@openjdk.org> wrote:

>> Some static final arrays of BigInteger and BigDecimal are stable and 
>> immutable. We should add `@Stable` to give the optimizer more information
>
> Shaojin Wen has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   bug fix, from @minborg

src/java.base/share/classes/java/math/BigInteger.java line 192:

> 190:      * zero-length mag array.
> 191:      */
> 192:     @Stable

`BigInteger.mag` gets written to a few times during computation in 
`BigInteger​.largePrime(…)`:
https://github.com/openjdk/jdk/blob/db340e54f83cf7bf72abb94c9cf9cdac007ed38a/src/java.base/share/classes/java/math/BigInteger.java#L886-L887
https://github.com/openjdk/jdk/blob/db340e54f83cf7bf72abb94c9cf9cdac007ed38a/src/java.base/share/classes/java/math/BigInteger.java#L895-L898

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25437#discussion_r2116698333

Reply via email to