RFR: 8362376: Use @Stable annotation in Java FDLIBM implementation
Joe Darcy
darcy at openjdk.org
Wed Jul 16 18:46:40 UTC 2025
On Wed, 16 Jul 2025 18:32:13 GMT, John R Rose <jrose at openjdk.org> wrote:
> The effect of this PR is to make the affected array elements eligible for constant-folding by the JIT.
>
> The contract of `@Stable` is private to the JDK, since it is a trusted annotation. The trusted user promises not to change the array elements after the JIT might have observed them.
>
> If we had a frozen (immutable) array feature in the JVM this PR could be formulated using frozen array constants. But we are not there yet.
Yes; my intention was to allow HotSpot greater leeway to optimize the FDLIBM code. Under my limited performance testing, the change seemed to be performance neutral, but if it shouldn't cause a regression, I'd be comfortable pushing the change.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/26341#issuecomment-3079867240
More information about the core-libs-dev
mailing list