Re: RFR: 8267844: Replace Integer/Long.valueOf() with Integer/Long.parse*() where applicable

2021-08-10 Thread Thomas Lußnig
Hi, i wonder why all usages of decode should be replaced. Since Integer.valueOf(text,radix) = Integer.valueOf(Ineger.parseInt(text,radix)) The double allocation with result = Integer.valueOf(nm.substring(index), radix); result = negative ? Integer.valueOf(-result.intValue()) : result; could

Re: RFR: 8267844: Replace Integer/Long.valueOf() with Integer/Long.parse*() where applicable [v2]

2021-08-10 Thread Claes Redestad
On Tue, 10 Aug 2021 21:06:00 GMT, Сергей Цыпанов wrote: >> The code in `Integer.decode()` and `Long.decode()` might allocate two >> instances of Integer/Long for the negative values less than -127: >> >> Integer result; >> >> result = Integer.valueOf(nm.substring(index), radix); >> result =

Re: RFR: 8267844: Replace Integer/Long.valueOf() with Integer/Long.parse*() where applicable [v2]

2021-08-10 Thread Сергей Цыпанов
> The code in `Integer.decode()` and `Long.decode()` might allocate two > instances of Integer/Long for the negative values less than -127: > > Integer result; > > result = Integer.valueOf(nm.substring(index), radix); > result = negative ? Integer.valueOf(-result.intValue()) : result; > > To

Re: RFR: 8267844: Replace Integer/Long.valueOf() with Integer/Long.parse*() where applicable

2021-08-10 Thread Сергей Цыпанов
On Tue, 10 Aug 2021 17:39:01 GMT, Сергей Цыпанов wrote: >> src/java.base/share/classes/java/lang/Integer.java line 1450: >> >>> 1448: >>> 1449: try { >>> 1450: result = parseInt(nm.substring(index), radix); >> >> Possibly a follow-up, but I think using `parseInt/-Long(nm,

Re: RFR: 8272120: Avoid looking for standard encodings in "java." modules

2021-08-10 Thread Claes Redestad
On Tue, 10 Aug 2021 05:08:54 GMT, Sergey Bylokhov wrote: > This is the continuation of JDK-8233884 and JDK-8271456. This change affects > fewer cases so I fix all "java." modules at once. > > In many places standard charsets are looked up via their names, for example: >

Re: RFR: 8272120: Avoid looking for standard encodings in "java." modules

2021-08-10 Thread Sergey Bylokhov
On Tue, 10 Aug 2021 09:18:39 GMT, Alan Bateman wrote: > It would be useful to get up to date performance data on using Charset vs. > charset name. At least historically, the charset name versions were faster > (see [JDK-6764325](https://bugs.openjdk.java.net/browse/JDK-6764325)). The code in

Re: RFR: 8267844: Replace Integer/Long.valueOf() with Integer/Long.parse*() where applicable

2021-08-10 Thread Сергей Цыпанов
On Tue, 10 Aug 2021 14:56:11 GMT, Claes Redestad wrote: >> The code in `Integer.decode()` and `Long.decode()` might allocate two >> instances of Integer/Long for the negative values less than -127: >> >> Integer result; >> >> result = Integer.valueOf(nm.substring(index), radix); >> result =

Re: RFR: 8267125: AES Galois CounterMode (GCM) interleaved implementation using AVX512 + VAES instructions [v7]

2021-08-10 Thread Anthony Scarpino
On Mon, 9 Aug 2021 18:08:53 GMT, Valerie Peng wrote: >> I do not understand this comment > > Doesn't implGCMCrypt(...) return an int telling how much bytes it has > processed? Then we adjust the index and remain input length with this value. > But here we didn't save the return value which

Integrated: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup

2021-08-10 Thread Martin Balao
On Fri, 6 Aug 2021 19:27:30 GMT, Martin Balao wrote: > I'd like to propose a fix for JDK-8270137 [1]. > > This bug is triggered when using a previously stored referral ticket (in the > Referrals Cache) at the moment of following a S4U2Proxy cross-realm referral. > The mistakenly-used referral

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup [v3]

2021-08-10 Thread Martin Balao
On Tue, 10 Aug 2021 16:16:39 GMT, Weijun Wang wrote: >> The TGS in "the TGS is the one" is clientSvcTicketEnc indeed. I admit that >> all these names are a bit confusing -but so it is the underlying protocol-. >> I'll take the 'user" suggestion and rename it to userSvcTicketEnc -in the >>

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup [v3]

2021-08-10 Thread Weijun Wang
On Tue, 10 Aug 2021 14:48:08 GMT, Martin Balao wrote: >> Not adding the type is OK, I said it's just to be a little clearer. I think >> you're right about the cname. It's always the one that actually sends the >> request. >> >> What is "the TGS" (in "the TGS is the one")?

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup [v3]

2021-08-10 Thread Martin Balao
> I'd like to propose a fix for JDK-8270137 [1]. > > This bug is triggered when using a previously stored referral ticket (in the > Referrals Cache) at the moment of following a S4U2Proxy cross-realm referral. > The mistakenly-used referral ticket matched the client and service names but > it

Re: RFR: 8267844: Replace Integer/Long.valueOf() with Integer/Long.parse*() where applicable

2021-08-10 Thread Claes Redestad
On Tue, 10 Aug 2021 13:16:42 GMT, Сергей Цыпанов wrote: > The code in `Integer.decode()` and `Long.decode()` might allocate two > instances of Integer/Long for the negative values less than -127: > > Integer result; > > result = Integer.valueOf(nm.substring(index), radix); > result =

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup [v2]

2021-08-10 Thread Martin Balao
On Tue, 10 Aug 2021 14:08:24 GMT, Weijun Wang wrote: >> Hmm.. in my view, adding the S4U2Type to the key will provide not much value >> other than minor consistency checks (in the form of debug-mode assertions) >> because the assumptions that a key with a non-null 'user' value is of >>

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup [v2]

2021-08-10 Thread Martin Balao
> I'd like to propose a fix for JDK-8270137 [1]. > > This bug is triggered when using a previously stored referral ticket (in the > Referrals Cache) at the moment of following a S4U2Proxy cross-realm referral. > The mistakenly-used referral ticket matched the client and service names but > it

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup

2021-08-10 Thread Weijun Wang
On Tue, 10 Aug 2021 13:45:22 GMT, Martin Balao wrote: >> src/java.security.jgss/share/classes/sun/security/krb5/internal/ReferralsCache.java >> line 59: >> >>> 57: private byte[] clientSvcTicketEnc; // S4U2Proxy only >>> 58: ReferralCacheKey (PrincipalName cname, PrincipalName

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup

2021-08-10 Thread Martin Balao
On Mon, 9 Aug 2021 19:54:21 GMT, Weijun Wang wrote: >> I'd like to propose a fix for JDK-8270137 [1]. >> >> This bug is triggered when using a previously stored referral ticket (in the >> Referrals Cache) at the moment of following a S4U2Proxy cross-realm >> referral. The mistakenly-used

Integrated: 8269130: Replace usages of Collection.toArray() with Collection.toArray(T[]) to avoid redundant array copying

2021-08-10 Thread Andrey Turbanov
On Mon, 14 Jun 2021 17:00:29 GMT, Andrey Turbanov wrote: > I found few places, where code initially perform `Object[] > Colleciton.toArray()` call and then manually copy array into another array > with required type. > This PR cleanups such places to more shorter call `T[] >

Re: RFR: 8270137: Kerberos Credential Retrieval from Cache not Working in Cross-Realm Setup

2021-08-10 Thread Martin Balao
On Mon, 9 Aug 2021 19:48:24 GMT, Weijun Wang wrote: >> I'd like to propose a fix for JDK-8270137 [1]. >> >> This bug is triggered when using a previously stored referral ticket (in the >> Referrals Cache) at the moment of following a S4U2Proxy cross-realm >> referral. The mistakenly-used

RFR: 8267844: Replace Integer/Long.valueOf() with Integer/Long.parse*() where applicable

2021-08-10 Thread Сергей Цыпанов
The code in `Integer.decode()` and `Long.decode()` might allocate two instances of Integer/Long for the negative values less than -127: Integer result; result = Integer.valueOf(nm.substring(index), radix); result = negative ? Integer.valueOf(-result.intValue()) : result; To avoid this we can

Re: RFR: 8267125: AES Galois CounterMode (GCM) interleaved implementation using AVX512 + VAES instructions [v8]

2021-08-10 Thread Andrew Haley
On Mon, 9 Aug 2021 15:49:07 GMT, Smita Kamath wrote: >> I would like to submit AES-GCM optimization for x86_64 architectures >> supporting AVX3+VAES (Evex encoded AES). This optimization interleaves AES >> and GHASH operations. >> Performance gain of ~1.5x - 2x for message sizes 8k and above.

Re: RFR: 8272120: Avoid looking for standard encodings in "java." modules

2021-08-10 Thread Alan Bateman
On Tue, 10 Aug 2021 05:08:54 GMT, Sergey Bylokhov wrote: > This is the continuation of JDK-8233884 and JDK-8271456. This change affects > fewer cases so I fix all "java." modules at once. > > In many places standard charsets are looked up via their names, for example: >