Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-12-03 Thread Luca Kellermann
On Sat, 30 Nov 2024 01:09:50 GMT, Chen Liang wrote: > Can you try raise this problem in this mailing list > https://mail.openjdk.org/mailman/listinfo/classfile-api-dev? Thanks for [mentioning it on the list](https://mail.openjdk.org/pipermail/classfile-api-dev/2024-December/000613.html) and i

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-11-29 Thread Chen Liang
On Fri, 29 Nov 2024 22:20:50 GMT, Luca Kellermann wrote: >> Don't think so. This imo is fixable in the future if we do have many new >> cp/annotation tags (see example of Thread::threadId), though I don't think >> that is likely > > Wait, I referenced the wrong thing. I was speaking about this

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-11-29 Thread Luca Kellermann
On Fri, 29 Nov 2024 18:59:41 GMT, Chen Liang wrote: >>> Yet I think we can consider promoting Constant Pool tag from byte or char, >>> short, or int to represent a u1 in case it goes over 127. >> >> Is there any chance a change like this could make it into JDK 24? I'd >> imagine it would be to

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-11-29 Thread Chen Liang
On Fri, 29 Nov 2024 17:53:43 GMT, Luca Kellermann wrote: >>> Your example is an exact antipattern from our data-oriented model: we would >>> want users to check the object type with `instanceof` (should be `is` in >>> kotlin) instead of checking these constants. >> >> I'm aware, this was just

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-11-29 Thread Luca Kellermann
On Mon, 7 Oct 2024 17:37:40 GMT, Luca Kellermann wrote: > Yet I think we can consider promoting Constant Pool tag from byte or char, > short, or int to represent a u1 in case it goes over 127. Is there any chance a change like this could make it into JDK 24? I'd imagine it would be too late af

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-10-07 Thread Luca Kellermann
On Mon, 7 Oct 2024 17:07:47 GMT, Chen Liang wrote: > Your example is an exact antipattern from our data-oriented model: we would > want users to check the object type with `instanceof` (should be `is` in > kotlin) instead of checking these constants. I'm aware, this was just the first example

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-10-07 Thread Chen Liang
On Mon, 7 Oct 2024 16:45:28 GMT, Luca Kellermann wrote: >> First, some bit of history. These API methods are added before those >> constants, and this patch did not change the type of these methods or >> constants. >> >> I believe the methods have restricted return types to be informative: >>

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-10-07 Thread Luca Kellermann
On Wed, 2 Oct 2024 20:24:41 GMT, Chen Liang wrote: > First, some bit of history. These API methods are added before those > constants, and this patch did not change the type of these methods or > constants. Sure, makes sense to separate this patch from a potential type change of the methods/c

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-10-02 Thread Chen Liang
On Wed, 2 Oct 2024 19:16:08 GMT, Luca Kellermann wrote: >> Chen Liang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> AbstractPoolEntry is broken too > > src/java.base/share/classes/java/lang/classfile/AnnotationValue.java line 482: > >

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-10-02 Thread Luca Kellermann
On Tue, 24 Sep 2024 17:23:41 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-09-25 Thread Chen Liang
On Tue, 24 Sep 2024 17:23:41 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-09-24 Thread Adam Sotona
On Tue, 24 Sep 2024 17:23:41 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v9]

2024-09-24 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v8]

2024-09-24 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v7]

2024-09-24 Thread Adam Sotona
On Mon, 23 Sep 2024 21:42:11 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v7]

2024-09-23 Thread Chen Liang
On Mon, 23 Sep 2024 21:42:11 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v7]

2024-09-23 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v6]

2024-09-23 Thread Chen Liang
On Mon, 23 Sep 2024 15:15:15 GMT, Adam Sotona wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 14 commits: >> >> - Merge branch 'master' of https://github.com/openjdk/jdk into >> fix/constant-moving >> - omi

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v6]

2024-09-23 Thread Adam Sotona
On Tue, 10 Sep 2024 21:18:19 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v6]

2024-09-10 Thread Chen Liang
On Wed, 11 Sep 2024 03:20:54 GMT, ExE Boss wrote: >> Chen Liang has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 14 commits: >> >> - Merge branch 'master' of https://github.com/openjdk/jdk into >> fix/constant-moving >> - omissi

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v6]

2024-09-10 Thread ExE Boss
On Tue, 10 Sep 2024 21:18:19 GMT, Chen Liang wrote: >> Many constants are cluttered in `ClassFile`. However, only a few of them are >> ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` >> constants. All other constants are specific and should live in more local >> loca

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v6]

2024-09-10 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v5]

2024-09-05 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v4]

2024-09-05 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v3]

2024-09-04 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

Re: RFR: 8339260: Move rarely used constants out of ClassFile [v2]

2024-08-30 Thread Chen Liang
> Many constants are cluttered in `ClassFile`. However, only a few of them are > ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` > constants. All other constants are specific and should live in more local > locations, such as getters that return these constants. > > T

RFR: 8339260: Move rarely used constants out of ClassFile

2024-08-29 Thread Chen Liang
Many constants are cluttered in `ClassFile`. However, only a few of them are ever used by regular users, most notably `ACC_` flags and `JAVA_X_VERSION` constants. All other constants are specific and should live in more local locations, such as getters that return these constants. This simplifi