Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v4]

2025-07-15 Thread Raffaello Giulietti
On Wed, 4 Jun 2025 13:12:33 GMT, Shaojin Wen 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 with a new target base due to a > merge or a reba

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v3]

2025-06-04 Thread Shaojin Wen
On Wed, 4 Jun 2025 12:08:09 GMT, Per Minborg wrote: > The newly marked arrays are indeed only updated once. Can we see any > benchmark showing a performance gain? I ran `make test TEST="micro:java.math.BigDecimals` on a MacBook M1 Pro, and there was no performance improvement with the Stable a

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-06-04 Thread Shaojin Wen
On Wed, 4 Jun 2025 14:03:49 GMT, Raffaello Giulietti wrote: >> Please do _not_ fix the `mag` issue in this PR. >> I'll take care of it in a future PR. > > I just filed [JDK-8358599](https://bugs.openjdk.org/browse/JDK-8358599). > Please do _not_ fix the `mag` issue in this PR. I'll take care of

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-06-04 Thread Raffaello Giulietti
On Wed, 4 Jun 2025 13:53:09 GMT, Raffaello Giulietti wrote: >> BigInteger is an object that is considered immutable, but its field mag is >> actually changed. This is incredible and should be fixed here. It is easy to >> make mistakes. > > Please do _not_ fix the `mag` issue in this PR. > I'll

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-06-04 Thread Raffaello Giulietti
On Fri, 30 May 2025 22:21:34 GMT, Shaojin Wen wrote: >> 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​.large

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v4]

2025-06-04 Thread Shaojin Wen
> 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 with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes bro

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v3]

2025-06-04 Thread Per Minborg
On Fri, 30 May 2025 22:07:06 GMT, Shaojin Wen 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

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v3]

2025-06-03 Thread Shaojin Wen
On Mon, 2 Jun 2025 18:23:25 GMT, Per Minborg wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> BigInteger::mag remove Stable > > A general comment with respect to `@Stable` is that it asserts the > field/elements wil

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v3]

2025-06-02 Thread Per Minborg
On Fri, 30 May 2025 22:07:06 GMT, Shaojin Wen 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

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-05-30 Thread Shaojin Wen
On Fri, 30 May 2025 21:36:52 GMT, ExE Boss wrote: >> 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

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v3]

2025-05-30 Thread Shaojin Wen
> 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: BigInteger::mag remove Stable

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-05-30 Thread ExE Boss
On Wed, 28 May 2025 13:39:40 GMT, Shaojin Wen 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

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v2]

2025-05-28 Thread Shaojin Wen
> 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 -

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal

2025-05-28 Thread Per Minborg
On Sun, 25 May 2025 22:35:56 GMT, Shaojin Wen wrote: > Some static final arrays of BigInteger and BigDecimal are stable and > immutable. We should add `@Stable` to give the optimizer more information src/java.base/share/classes/java/math/BigDecimal.java line 4317: > 4315: }; > 4316: > 431

RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal

2025-05-27 Thread Shaojin Wen
Some static final arrays of BigInteger and BigDecimal are stable and immutable. We should add `@Stable` to give the optimizer more information - Commit messages: - BigInteger::mag add `@Stable` - add stable Changes: https://git.openjdk.org/jdk/pull/25437/files Webrev: https://we

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal

2025-05-27 Thread ExE Boss
On Sun, 25 May 2025 22:35:56 GMT, Shaojin Wen wrote: > Some static final arrays of BigInteger and BigDecimal are stable and > immutable. We should add `@Stable` to give the optimizer more information Note that `BigInteger.mag` should probably also be made `@Stable` once  `BigInteger​.largePrime

Re: Add `@Stable` to BigInteger and BigDecimal

2025-05-27 Thread Jaikiran Pai
Is this a duplicate of what's already being discussed here https://mail.openjdk.org/pipermail/core-libs-dev/2025-May/146692.html? -Jaikiran On 27/05/25 2:24 pm, wenshao wrote: Some final arrays of BigInteger and BigDecimal are stable and immutable. We should add `@Stable` to give the optimizer

Add `@Stable` to BigInteger and BigDecimal

2025-05-27 Thread wenshao
Some final arrays of BigInteger and BigDecimal are stable and immutable. We should add `@Stable` to give the optimizer more information - Shaojin Wen

Re: Add @Stable to BigInteger and BigDecimal

2025-05-26 Thread Raffaello Giulietti
Depending on which static final arrays, this might be fine. On 2025-05-26 01:57, wenshao 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

Add @Stable to BigInteger and BigDecimal

2025-05-25 Thread wenshao
Some static final arrays of BigInteger and BigDecimal are stable and immutable. We should add @Stable to give the optimizer more information - Shaojin Wen