RFR: 8354300: Mark String.hash field @Stable [v2]
Hannes Greule
hgreule at openjdk.org
Tue Apr 22 08:50:47 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
Would it make sense to have IR tests for this?
-------------
PR Comment: https://git.openjdk.org/jdk/pull/24625#issuecomment-2820615223
More information about the core-libs-dev
mailing list