On Mon, 14 Apr 2025 18:09:35 GMT, Chen Liang wrote:
>> Hello Per, I'm not too familiar with runtime compiler optimizations. So
>> consider this as a basic question.
>>
>>> This means the VM can trust these fields to never change which enables
>>> constant folding optimizations.
>>
>> If I'm
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
On Wed, 16 Apr 2025 05:38:59 GMT, Chen Liang wrote:
>> yes ! I would write
>> "given the current implementation of hashCode(), marking hasIsZero @Stable
>> is not useful for constant folding, as the field `hash` of value '0' is read
>> first."
>
> Yep. To be more exact, JIT anticipates a read o
On Wed, 16 Apr 2025 05:12:28 GMT, Rémi Forax wrote:
>> src/java.base/share/classes/java/lang/String.java line 183:
>>
>>> 181: * us to avoid recalculating this.
>>> 182: */
>>> 183: @Stable
>>
>> Suggestion:
>>
>> // Marking hashIsZero stable is meaningless, as a read of `0`
On Wed, 16 Apr 2025 00:01:18 GMT, Chen Liang 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 tier
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
On Mon, 14 Apr 2025 15:46:54 GMT, Jaikiran Pai 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 ti
On Mon, 14 Apr 2025 15:46:54 GMT, Jaikiran Pai wrote:
> It then means that the other field will never move out of its initial value
> and thus will never be considered "stable".
For all non-zero hashcodes, it matters that `hash` would be constant-foldable,
which means `if (h == 0 && !hashIsZe
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg 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, t
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, and tier3 which all pass.
-
Commit messages:
15 matches
Mail list logo