RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v27]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Apr 2 11:46:02 UTC 2025


On Wed, 2 Apr 2025 11:39:20 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> Implement JEP 502.
>> 
>> The PR passes tier1-tier3 tests.
>
> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Improve examples

src/java.base/share/classes/java/lang/StableValue.java line 209:

> 207:  *     private SqrtUtil(){}
> 208:  *
> 209:  *     private static final Set<Integer> CACHED_KEYS = Set.of(1, 2, 4, 8, 16, 32);

This is not the same as before, is it? E.g. in the previous example, we had cached results for `0 <= input < CACHED_SIZE`. But here we hand-pick some values for which we know the square root is also an int. I think the two example should be the same, so as to attract attention on how stable int function vs. stable function works...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2024651152


More information about the core-libs-dev mailing list