Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v5]

2021-03-05 Thread Alan Bateman
On Sat, 6 Mar 2021 01:35:28 GMT, Craig Andrews wrote: >> `java.net.URLClassLoader.getResource` can throw an undocumented >> `IllegalArgumentException`. >> >> According to the javadoc for the `getResource` and `findResource` methods, >> neither should be throwing `IllegalArgumentException` -

Re: RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category) [v2]

2021-03-05 Thread Sergey Bylokhov
On Fri, 5 Mar 2021 18:53:29 GMT, Claes Redestad wrote: >> This patch refactors Locale.getDefault(Category) so that the volatile field >> holding the Locale is typically only read once. This has a small performance >> advantage, and might be more robust if initialization is racy. > > Claes

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v5]

2021-03-05 Thread Craig Andrews
> `java.net.URLClassLoader.getResource` can throw an undocumented > `IllegalArgumentException`. > > According to the javadoc for the `getResource` and `findResource` methods, > neither should be throwing `IllegalArgumentException` - they should return > null if the resource can't be resolved.

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v4]

2021-03-05 Thread Craig Andrews
On Fri, 5 Mar 2021 23:35:46 GMT, Brent Christian wrote: >> Craig Andrews has refreshed the contents of this pull request, and previous >> commits have been removed. The incremental views will show differences >> compared to the previous content of the PR. The pull request contains one >> new

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v4]

2021-03-05 Thread Brent Christian
On Fri, 5 Mar 2021 16:02:49 GMT, Craig Andrews wrote: >> `java.net.URLClassLoader.getResource` can throw an undocumented >> `IllegalArgumentException`. >> >> According to the javadoc for the `getResource` and `findResource` methods, >> neither should be throwing `IllegalArgumentException` -

Re: RFR: 8263091: Remove CharacterData.isOtherUppercase/-Lowercase

2021-03-05 Thread Iris Clark
On Fri, 5 Mar 2021 14:24:34 GMT, Claes Redestad wrote: > This patch removes the CharacterData.isOtherUppercase and isOtherLowercase > methods. It also exploits the fact that isOtherUppercase is always false for > all codepoints in the CharacterDataLatin1 range for a small speed-up. > > I have

Re: [External] : Re: ThreadLocal lookup elimination

2021-03-05 Thread Eirik Bjørsnøs
> > But before that. Alan Bateman said to me that Loom project has much > simpler implementation to what you want. > Ahh! Another good reason why I'm seriously considering just going to the beach and returning once Loom is shipped! :-) Can't do that. JIT have to update underlying hash table to

Re: [External] : Re: ThreadLocal lookup elimination

2021-03-05 Thread Vladimir Kozlov
Eirik See my answers bellow. But before that. Alan Bateman said to me that Loom project has much simpler implementation to what you want. Thread local scopedCache which is Object[] array referenced from current thread:

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v4]

2021-03-05 Thread Craig Andrews
On Thu, 4 Mar 2021 21:10:56 GMT, Craig Andrews wrote: >> Hi, Craig >> The commented-out lines should be removed from the change. >> >> As Alan said, a regression test will be needed. At minimum, it should test >> a method that returns a URL, as well as a method that returns an >>

Re: ThreadLocal lookup elimination

2021-03-05 Thread Eirik Bjørsnøs
On Fri, Mar 5, 2021 at 6:41 PM Vladimir Kozlov wrote: Vladimir, Thanks a lot for taking time to consider this! Some comments inline: > Currently it is "impossible" for JIT compiler to reliably know that value > stored by set() in hash map is the same as > read by get(). > My layman (perhaps

Re: RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category) [v2]

2021-03-05 Thread Naoto Sato
On Fri, 5 Mar 2021 18:53:29 GMT, Claes Redestad wrote: >> This patch refactors Locale.getDefault(Category) so that the volatile field >> holding the Locale is typically only read once. This has a small performance >> advantage, and might be more robust if initialization is racy. > > Claes

Re: RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category) [v2]

2021-03-05 Thread Claes Redestad
> This patch refactors Locale.getDefault(Category) so that the volatile field > holding the Locale is typically only read once. This has a small performance > advantage, and might be more robust if initialization is racy. Claes Redestad has updated the pull request incrementally with one

Re: RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category) [v2]

2021-03-05 Thread Claes Redestad
On Fri, 5 Mar 2021 17:29:16 GMT, Naoto Sato wrote: >> Claes Redestad has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Fix omitted synchronized > > src/java.base/share/classes/java/util/Locale.java line 959: > >> 957: } >> 958: >>

Re: RFR: 8263091: Remove CharacterData.isOtherUppercase/-Lowercase

2021-03-05 Thread Naoto Sato
On Fri, 5 Mar 2021 14:24:34 GMT, Claes Redestad wrote: > This patch removes the CharacterData.isOtherUppercase and isOtherLowercase > methods. It also exploits the fact that isOtherUppercase is always false for > all codepoints in the CharacterDataLatin1 range for a small speed-up. > > I have

Re: ThreadLocal lookup elimination

2021-03-05 Thread Vladimir Kozlov
Hi Erik, The implementation of ThreadLocal is based on HashMap: https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/lang/ThreadLocal.java#L76 Currently it is "impossible" for JIT compiler to reliably know that value stored by set() in hash map is the same as read by

Re: RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category)

2021-03-05 Thread Naoto Sato
On Fri, 5 Mar 2021 14:14:14 GMT, Claes Redestad wrote: > This patch refactors Locale.getDefault(Category) so that the volatile field > holding the Locale is typically only read once. This has a small performance > advantage, and might be more robust if initialization is racy.

Re: RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9]

2021-03-05 Thread Richard Reingruber
On Fri, 5 Mar 2021 11:11:44 GMT, Alan Hayward wrote: >>> I was building this PR on a new machine, and I now get the following error: >>> >>> > /Users/alahay01/java/gerrit_jdk/src/java.desktop/macosx/native/libjsound/PLATFORM_API_MacOSX_MidiUtils.c:258:31: >>> > error: cast to smaller integer

Re: RFR: 8263091: Remove CharacterData.isOtherUppercase/-Lowercase

2021-03-05 Thread Roger Riggs
On Fri, 5 Mar 2021 14:24:34 GMT, Claes Redestad wrote: > This patch removes the CharacterData.isOtherUppercase and isOtherLowercase > methods. It also exploits the fact that isOtherUppercase is always false for > all codepoints in the CharacterDataLatin1 range for a small speed-up. > > I have

Re: RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category)

2021-03-05 Thread Roger Riggs
On Fri, 5 Mar 2021 14:14:14 GMT, Claes Redestad wrote: > This patch refactors Locale.getDefault(Category) so that the volatile field > holding the Locale is typically only read once. This has a small performance > advantage, and might be more robust if initialization is racy. Marked as

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-05 Thread Roger Riggs
On Fri, 5 Mar 2021 17:03:34 GMT, Claes Redestad wrote: >> src/java.base/share/classes/java/util/Formatter.java line 3017: >> >>> 3015: s = ((Character)arg).toString(); >>> 3016: } else if (arg instanceof Byte) { >>> 3017: byte i = (Byte) arg; >> >>

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-05 Thread Claes Redestad
On Fri, 5 Mar 2021 16:36:03 GMT, Roger Riggs wrote: >> This patch optimizes String.format expressions that uses trivial specifiers. >> In the JDK, the most common variation of String.format is a variation of >> format("foo: %s", s), which gets a significant speed-up from this. >> >> Various

Re: RFR: 8263038: Optimize String.format for simple specifiers

2021-03-05 Thread Roger Riggs
On Thu, 4 Mar 2021 17:20:40 GMT, Claes Redestad wrote: > This patch optimizes String.format expressions that uses trivial specifiers. > In the JDK, the most common variation of String.format is a variation of > format("foo: %s", s), which gets a significant speed-up from this. > > Various

Re: RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category)

2021-03-05 Thread Claes Redestad
On Fri, 5 Mar 2021 14:14:14 GMT, Claes Redestad wrote: > This patch refactors Locale.getDefault(Category) so that the volatile field > holding the Locale is typically only read once. This has a small performance > advantage, and might be more robust if initialization is racy. Results on the

RFR: 8263090: Avoid reading volatile fields twice in Locale.getDefault(Category)

2021-03-05 Thread Claes Redestad
This patch refactors Locale.getDefault(Category) so that the volatile field holding the Locale is typically only read once. This has a small performance advantage, and might be more robust if initialization is racy. - Commit messages: - Add microbenchmark - Reduce volatile reads

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v3]

2021-03-05 Thread Craig Andrews
On Fri, 5 Mar 2021 15:46:40 GMT, Craig Andrews wrote: >> test/jdk/java/net/URLClassLoader/TestBug8262277.java line 30: >> >>> 28: * @summary Test to see if URLClassLoader.getResource and >>> URLClassLoader.getResources >>> 29: * throw IllegalArgumentException >>> 30: */ >> >> I'd prefer

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v3]

2021-03-05 Thread Craig Andrews
On Fri, 5 Mar 2021 15:42:11 GMT, Alan Bateman wrote: > I'd prefer if the test checked that findResource returned null and that > findResources returned an empty enumeration. I'll update the test accordingly. > think we should be able to find a better name for the test too. > Do you really

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v3]

2021-03-05 Thread Alan Bateman
On Thu, 4 Mar 2021 22:16:10 GMT, Craig Andrews wrote: >> `java.net.URLClassLoader.getResource` can throw an undocumented >> `IllegalArgumentException`. >> >> According to the javadoc for the `getResource` and `findResource` methods, >> neither should be throwing `IllegalArgumentException` -

Re: RFR: JDK-8262277: java.net.URLClassLoader.getResource throws undocumented IllegalArgumentException [v4]

2021-03-05 Thread Craig Andrews
> `java.net.URLClassLoader.getResource` can throw an undocumented > `IllegalArgumentException`. > > According to the javadoc for the `getResource` and `findResource` methods, > neither should be throwing `IllegalArgumentException` - they should return > null if the resource can't be resolved.

Re: RFR: 8263091: Remove CharacterData.isOtherUppercase/-Lowercase

2021-03-05 Thread Claes Redestad
On Fri, 5 Mar 2021 14:24:34 GMT, Claes Redestad wrote: > This patch removes the CharacterData.isOtherUppercase and isOtherLowercase > methods. It also exploits the fact that isOtherUppercase is always false for > all codepoints in the CharacterDataLatin1 range for a small speed-up. > > I have

RFR: 8263091: Remove CharacterData.isOtherUppercase/-Lowercase

2021-03-05 Thread Claes Redestad
This patch removes the CharacterData.isOtherUppercase and isOtherLowercase methods. It also exploits the fact that isOtherUppercase is always false for all codepoints in the CharacterDataLatin1 range for a small speed-up. I have no means to test if this is correct on PPC, which has intrinsics

Contributing to 8259896: Base64 MIME decoder should allow unrecognised characters within padding

2021-03-05 Thread Raffaello Giulietti
Hello, I can contribute in solving the issue [1] mentioned in [2]. But before investing time, I just want to make sure that there is some consensus that it needs to be solved in the first place. Maybe there are diverging opinions that consider the current behavior as correct. Greetings

Re: RFR: 8253795: Implementation of JEP 391: macOS/AArch64 Port [v9]

2021-03-05 Thread Alan Hayward
On Thu, 4 Mar 2021 18:19:33 GMT, Vladimir Kempik wrote: > Hello > there is one issue with the info you provided, it's from Xcode12.5 beta. > And beta license agreement forbids sharing output of beta version of > compiler > So we can't say we have issue with newer xcode beta until that beta went