RFR: 8354300: Mark String.hash field @Stable [v2]

Chen Liang liach at openjdk.org
Tue Apr 22 15:02:45 UTC 2025


On Tue, 22 Apr 2025 08:26:17 GMT, Per Minborg <pminborg at openjdk.org> wrote:

>> This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and `j.l.String.hashIsZero`. This means the VM can trust these fields to never change which enables constant folding optimizations.
>> 
>> This PR is tested in tier1, tier2, tier3, and tier4 which all pass.
>
> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains four additional commits since the last revision:
> 
>  - Remove @Stable annotation from hashIsZero, add benchmark
>  - Merge branch 'master' into string-stable-fields
>  - Update copyright year
>  - Annotate fields with @Stable

Marked as reviewed by liach (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/24625#pullrequestreview-2784433053


More information about the core-libs-dev mailing list