Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-17 Thread Chen Liang
On Tue, 16 Jul 2024 03:10:29 GMT, Chen Liang 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. Thi

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-17 Thread Chen Liang
On Tue, 16 Jul 2024 03:10:29 GMT, Chen Liang 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. Thi

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-17 Thread Jorn Vernee
On Wed, 17 Jul 2024 13:44:58 GMT, Aleksey Shipilev wrote: > > @shipilev Would you re-review this patch, or are you no longer interested > > now that `@Stable` is removed? > > I am not sure I understand the performance implications for this change. I > can see the optimization for avoiding `Nam

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-17 Thread Aleksey Shipilev
On Mon, 15 Jul 2024 13:39:02 GMT, Aleksey Shipilev wrote: >> Indeed, for some reason I thought the range of short is -256 to 255 instead >> of -65536 to 65535 > >> Indeed, for some reason I thought the range of short is -256 to 255 instead >> of -65536 to 65535 > > Yeah, I thought something li

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-16 Thread Chen Liang
On Mon, 15 Jul 2024 13:39:02 GMT, Aleksey Shipilev wrote: >> Indeed, for some reason I thought the range of short is -256 to 255 instead >> of -65536 to 65535 > >> Indeed, for some reason I thought the range of short is -256 to 255 instead >> of -65536 to 65535 > > Yeah, I thought something li

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-16 Thread Jorn Vernee
On Tue, 16 Jul 2024 19:59:41 GMT, Chen Liang wrote: >> 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,

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-16 Thread Jorn Vernee
On Tue, 16 Jul 2024 03:10:29 GMT, Chen Liang 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. Thi

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-16 Thread Chen Liang
On Tue, 16 Jul 2024 19:39:16 GMT, Jorn Vernee wrote: >> 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...@

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-16 Thread Jorn Vernee
On Tue, 16 Jul 2024 03:10:29 GMT, Chen Liang 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. Thi

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v4]

2024-07-15 Thread Chen Liang
On Tue, 16 Jul 2024 00:39:19 GMT, ExE Boss wrote: >> Chen Liang has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Make LambdaForm.Name index final >> - Revert "8335922: Incorrect stable usage of LambdaForm$Name.index" >> >>This

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v5]

2024-07-15 Thread Chen Liang
> 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 usag

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v4]

2024-07-15 Thread ExE Boss
On Mon, 15 Jul 2024 22:56:23 GMT, Chen Liang 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. Thi

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v3]

2024-07-15 Thread Chen Liang
On Mon, 15 Jul 2024 15:57:30 GMT, Chen Liang 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. Thi

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v4]

2024-07-15 Thread Chen Liang
> 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 usag

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v3]

2024-07-15 Thread Chen Liang
On Mon, 15 Jul 2024 15:57:30 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. Solution is to use bit flip on the actual index (and rename >> the field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and >> 0 the de

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v3]

2024-07-15 Thread Jorn Vernee
On Mon, 15 Jul 2024 15:57:30 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. Solution is to use bit flip on the actual index (and rename >> the field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and >> 0 the de

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v3]

2024-07-15 Thread Aleksey Shipilev
On Mon, 15 Jul 2024 15:57:30 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. Solution is to use bit flip on the actual index (and rename >> the field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and >> 0 the de

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v2]

2024-07-15 Thread Aleksey Shipilev
On Mon, 15 Jul 2024 15:47:50 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.java line 778: >> >>> 776: var newParameters = new TreeMap(new >>> Comparator<>() { >>> 777: public int compare(Name n1, Name n2) { >>> 778: r

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v3]

2024-07-15 Thread Chen Liang
> The `@Stable` on the `index` field is incorrect, as stable only avoids > inlining `0`. Solution is to use bit flip on the actual index (and rename the > field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and 0 > the default value is used as an unset indicator. Chen Liang has

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v2]

2024-07-15 Thread Chen Liang
On Mon, 15 Jul 2024 14:29:29 GMT, Aleksey Shipilev wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> We have sufficient space in short, use +1 offset > > src/java.base/share/classes/java/lang/invoke/LambdaFormEditor.ja

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v2]

2024-07-15 Thread Aleksey Shipilev
On Mon, 15 Jul 2024 14:09:22 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. Solution is to use bit flip on the actual index (and rename >> the field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and >> 0 the de

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v2]

2024-07-15 Thread Chen Liang
On Mon, 15 Jul 2024 14:09:22 GMT, Chen Liang wrote: >> The `@Stable` on the `index` field is incorrect, as stable only avoids >> inlining `0`. Solution is to use bit flip on the actual index (and rename >> the field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and >> 0 the de

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index [v2]

2024-07-15 Thread Chen Liang
> The `@Stable` on the `index` field is incorrect, as stable only avoids > inlining `0`. Solution is to use bit flip on the actual index (and rename the > field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and 0 > the default value is used as an unset indicator. Chen Liang has

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-15 Thread Aleksey Shipilev
On Mon, 15 Jul 2024 12:28:51 GMT, Chen Liang wrote: > Indeed, for some reason I thought the range of short is -256 to 255 instead > of -65536 to 65535 Yeah, I thought something like this was going on; it would be a smart way to leverage that negative side in two-complement form is one value la

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-15 Thread Chen Liang
On Mon, 15 Jul 2024 01:45:57 GMT, Chen Liang wrote: > The `@Stable` on the `index` field is incorrect, as stable only avoids > inlining `0`. Solution is to use bit flip on the actual index (and rename the > field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and 0 > the defaul

Re: RFR: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-15 Thread Aleksey Shipilev
On Mon, 15 Jul 2024 01:45:57 GMT, Chen Liang wrote: > The `@Stable` on the `index` field is incorrect, as stable only avoids > inlining `0`. Solution is to use bit flip on the actual index (and rename the > field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and 0 > the defaul

RFR: 8335922: Incorrect stable usage of LambdaForm$Name.index

2024-07-14 Thread Chen Liang
The `@Stable` on the `index` field is incorrect, as stable only avoids inlining `0`. Solution is to use bit flip on the actual index (and rename the field to `flippedIndex`), so we use -1 to -256 (mapping to 0 to 255) and 0 the default value is used as an unset indicator. - Commit