On Tue, 16 Jul 2024 03:10:29 GMT, Chen Liang <li...@openjdk.org> wrote:

>> The `@Stable` on the `index` field is incorrect, as stable only avoids 
>> inlining `0`. On a strategic view, this index field should just become final 
>> so that `Name` becomes eligible for value class migration once valhalla 
>> comes. This patch makes the `index` field final and updates the usages 
>> correspondingly.
>
> Chen Liang has updated the pull request incrementally with one additional 
> commit since the last revision:
> 
>   Update src/java.base/share/classes/java/lang/invoke/LambdaForm.java
>   
>   Co-authored-by: ExE Boss <3889017+exe-b...@users.noreply.github.com>

src/java.base/share/classes/java/lang/invoke/LambdaForm.java line 1388:

> 1386:         Name withIndex(int i) {
> 1387:             if (i == this.index) return this;
> 1388:             return new Name(i, type, function, arguments, constraint);

Don't we still need to clone the arguments here?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20178#discussion_r1679978905

Reply via email to