Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v19]

2023-09-12 Thread Roger Riggs
On Tue, 12 Sep 2023 13:27:29 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v18]

2023-09-12 Thread 温绍锦
On Tue, 12 Sep 2023 10:11:53 GMT, Claes Redestad wrote: > Running some additional testing. This mostly looks fine. > > One issue is that you're swapping the byte-order in `DecimalDigits::DIGITS` > but not in `OctalDigits` and `HexDigits`. I think we need to keep these > internally consistent t

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v19]

2023-09-12 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v18]

2023-09-12 Thread Claes Redestad
On Tue, 12 Sep 2023 10:11:53 GMT, Claes Redestad wrote: > If there's no significant performance difference I would prefer if we kept > `DecimalDigits::DIGITS` big-endian encoded - which is more intuitive to most > - and adjust code depending on `DecimalDigits::digitPair` to use `ByteArray` > r

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v18]

2023-09-12 Thread Claes Redestad
On Tue, 12 Sep 2023 01:00:39 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v18]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v17]

2023-09-11 Thread Chen Liang
On Tue, 12 Sep 2023 00:06:41 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v17]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v16]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v15]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v7]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 18:57:58 GMT, Roger Riggs wrote: >> If this PR is split into two PRs, the other two PRs I submitted #15658 >> #1 cannot be based on this PR. > > I agree, do the package move separate from the refactoring. > The other PRs can wait a bit or be committed as is and take part

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v10]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 19:03:45 GMT, Claes Redestad wrote: >> src/java.base/share/classes/jdk/internal/util/DecimalDigits.java line 1: >> >>> 1: /* >> >> Can git be convinced to show this as a rename instead of a delete and add? >> The history will be cleaner. > > I just looked it up and git actua

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v14]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v13]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v12]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v11]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v10]

2023-09-11 Thread Claes Redestad
On Mon, 11 Sep 2023 18:58:56 GMT, Roger Riggs wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> revert code format > > src/java.base/share/classes/jdk/internal/util/DecimalDigits.java line 1: > >> 1: /* > > Can git be convi

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v7]

2023-09-11 Thread Roger Riggs
On Mon, 11 Sep 2023 16:36:55 GMT, 温绍锦 wrote: >> src/java.base/share/classes/jdk/internal/util/DecimalDigits.java line 143: >> >>> 141: * code after loop unrolling. >>> 142: */ >>> 143: public static int stringSize(int x) { >> >> I suggest splitting the moves of `stringSize` `getCh

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v10]

2023-09-11 Thread Roger Riggs
On Mon, 11 Sep 2023 15:57:22 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v10]

2023-09-11 Thread Claes Redestad
On Mon, 11 Sep 2023 15:57:22 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v7]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 14:28:28 GMT, Chen Liang wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> move java.lang.StringLatin1::getChars to >> jdk.internal.util.DecimalDigits::getCharsLatin1 > > src/java.base/share/classes/jdk/i

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v10]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v9]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v8]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v7]

2023-09-11 Thread Chen Liang
On Mon, 11 Sep 2023 12:23:36 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v6]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 10:33:10 GMT, 温绍锦 wrote: >> These weren't in `java.util.DecimalDigits` but have been copied from >> `java.lang.StringLatin1` - part of an unfinished refactoring? There's no >> clear-cut answer where these best fits but it seems reasonable to keep them >> in `StringLatin1` a

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v7]

2023-09-11 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v6]

2023-09-11 Thread 温绍锦
On Mon, 11 Sep 2023 09:38:44 GMT, Claes Redestad wrote: >> src/java.base/share/classes/jdk/internal/util/DecimalDigits.java line 201: >> >>> 199: * @return index of the most significant digit or minus sign, if >>> present >>> 200: */ >>> 201: public static int getChars(int i, int

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v6]

2023-09-11 Thread Claes Redestad
On Mon, 11 Sep 2023 08:49:18 GMT, Andrey Turbanov wrote: >> 温绍锦 has updated the pull request incrementally with two additional commits >> since the last revision: >> >> - remove duplicate stringSize >> - update related comments > > src/java.base/share/classes/jdk/internal/util/DecimalDigits.j

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v6]

2023-09-11 Thread Andrey Turbanov
On Mon, 11 Sep 2023 04:00:34 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v6]

2023-09-10 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v5]

2023-09-10 Thread Yi Yang
On Mon, 11 Sep 2023 01:12:25 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v5]

2023-09-10 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v4]

2023-09-10 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v2]

2023-09-10 Thread Claes Redestad
On Sun, 10 Sep 2023 18:08:44 GMT, Roger Riggs wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> move java.util.DecimalDigits to jdk.internal.util.DecimalDigits > > src/java.base/share/classes/java/util/Digits.java line 36: >

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v2]

2023-09-10 Thread 温绍锦
On Sun, 10 Sep 2023 18:08:44 GMT, Roger Riggs wrote: >> 温绍锦 has updated the pull request incrementally with one additional commit >> since the last revision: >> >> move java.util.DecimalDigits to jdk.internal.util.DecimalDigits > > src/java.base/share/classes/java/util/Digits.java line 36: >

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v3]

2023-09-10 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v2]

2023-09-10 Thread 温绍锦
On Sun, 10 Sep 2023 18:37:20 GMT, 温绍锦 wrote: >> src/java.base/share/classes/java/util/Digits.java line 36: >> >>> 34: * @since 21 >>> 35: */ >>> 36: sealed interface Digits permits HexDigits, OctalDigits { >> >> Don't break up the trio, move all three classes and the interface to >> jdk.inte

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v2]

2023-09-10 Thread Roger Riggs
On Sun, 10 Sep 2023 17:59:10 GMT, 温绍锦 wrote: >> Some codes in core libs are duplicated, including: >> java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS >> java.util.DecimalDigits::size -> java.lang.Long.stringSize >> >> We can reduce duplication through JavaLangAccess, whic

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS [v2]

2023-09-10 Thread 温绍锦
> Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is also needed in > other places, such as: > http

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS

2023-09-10 Thread Claes Redestad
On Sun, 10 Sep 2023 16:15:01 GMT, 温绍锦 wrote: > Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is

Re: RFR: 8315968: Consolidate java.util.Digits and StringLatin1::PACKED_DIGITS

2023-09-10 Thread Roger Riggs
On Sun, 10 Sep 2023 16:15:01 GMT, 温绍锦 wrote: > Some codes in core libs are duplicated, including: > java.util.DecimalDigits::DIGITS -> java.lang.StringLatin1.PACKED_DIGITS > java.util.DecimalDigits::size -> java.lang.Long.stringSize > > We can reduce duplication through JavaLangAccess, which is