Streams, parallelization, and OOME.

2024-10-18 Thread David Alayachew
Hello Core Libs Dev Team, I have a file that I am streaming from a service, and I am trying to split into multiple parts based on a certain attribute found on each line. I am sending each part up to a different service. I am using BufferedReader.lines(). However, I cannot read the whole file into

Re: RFR: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API

2024-10-18 Thread Shaojin Wen
On Fri, 18 Oct 2024 13:32:57 GMT, Chen Liang wrote: >> Cache commonly used classDesc to avoid creating ReferenceClassDescImpl every >> time > > src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java > line 141: > >> 139: case "MH" -> CD_MH; >> 140:

Re: RFR: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API

2024-10-18 Thread Chen Liang
On Fri, 18 Oct 2024 10:01:59 GMT, Shaojin Wen wrote: > Cache commonly used classDesc to avoid creating ReferenceClassDescImpl every > time src/java.base/share/classes/java/lang/invoke/InvokerBytecodeGenerator.java line 141: > 139: case "MH" -> CD_MH; > 140: case "DMH"

RFR: 8342644: Optimize InvokerBytecodeGenerator for using ClassFile API

2024-10-18 Thread Shaojin Wen
Cache commonly used classDesc to avoid creating ReferenceClassDescImpl every time - Commit messages: - cache ClassDesc MH/BMH/DMH Changes: https://git.openjdk.org/jdk/pull/21580/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21580&range=00 Issue: https://bugs.openjdk.or

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Sean Mullan
On Thu, 17 Oct 2024 17:59:20 GMT, Sean Mullan wrote: >> All JGSS permission classes follow the same style: >> >> In `javax.security.auth.kerberos.DelegationPermission`: >> >> * This class is used to restrict the usage of the Kerberos >> * delegation model, ie: forwardable and proxiable ticket

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v8]

2024-10-18 Thread Lance Andersen
> Please review the changes for > [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a > follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) which > addresses that > > - ZipEntry(String) > - ZipEntry::setComment > - ZipEntry::setExtra > > currently validat

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-18 Thread Shaojin Wen
On Fri, 18 Oct 2024 21:56:53 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) methods so that >> these two meth

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Kevin Walls
On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security >> Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The >> [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the >> main ch

Re: RFR: 8335271: Specify the MessageFormat ArgumentIndex Implementation Limit [v4]

2024-10-18 Thread Iris Clark
On Fri, 18 Oct 2024 21:05:18 GMT, Justin Lu wrote: >> Please review this PR which specifies the _j.text.MessageFormat_ >> ArgumentIndex limit. A corresponding CSR is drafted. >> >> Both the existence of the limit (and behavior if violated), as well as this >> implementation's limit are added t

Re: RFR: 8325089: jpackage utility creates an "infinite", undeleteable directory tree [v4]

2024-10-18 Thread Alexander Matveev
On Fri, 18 Oct 2024 14:42:39 GMT, Alexey Semenyuk wrote: >> Make jpackage correctly handle the output directory (`--dest`) that is: >> - a subdirectory of the input directory; >> - the same as the input directory. >> >> Make jpackage correctly handle temp directory (`--temp`) that is: >> - a

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v20]

2024-10-18 Thread Shaojin Wen
> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into > primitive arrays by combining values ​​into larger stores. > > This PR rewrites the code of appendNull and append(boolean) methods so that > these two methods can be optimized by C2. Shaojin Wen has updated the pul

Re: RFR: 8341975: Unable to set encoding for IO.println, IO.print and IO.readln [v3]

2024-10-18 Thread Naoto Sato
> Changing the charset initialization of `java.io.Console` class, which is the > basis of `java.io.IO`, so that it would behave the same way as `System.out` > wrt encoding. This change will also have the capability to override the > default charset used in `IO` methods with `stdout.encoding` sys

Re: RFR: 8342609: Bug in jpackage test helper

2024-10-18 Thread Alexander Matveev
On Fri, 18 Oct 2024 13:45:00 GMT, Alexey Semenyuk wrote: > `Files.walk(root, 0)` returns the `root` itself and not the contents of the > `root`. > Replaced `Files.walk(root, 0)` with `Files.list(root)` to get a non-recursive > listing of the `root` directory. Looks good, but can you make issue

Re: RFR: 8335271: Specify the MessageFormat ArgumentIndex Implementation Limit [v4]

2024-10-18 Thread Joe Darcy
On Fri, 18 Oct 2024 21:05:18 GMT, Justin Lu wrote: >> Please review this PR which specifies the _j.text.MessageFormat_ >> ArgumentIndex limit. A corresponding CSR is drafted. >> >> Both the existence of the limit (and behavior if violated), as well as this >> implementation's limit are added t

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v4]

2024-10-18 Thread Chen Liang
On Fri, 18 Oct 2024 17:47:00 GMT, Dan Heidinga wrote: >> This is correct for the LMF, but I think we are using weak hidden classes in >> string concatenation. > > I just confirmed - the `InlineHiddenClassStrategy` in > j.l.i.StringConcatFactory uses weak hidden classes. It looks like there are

Re: RFR: 8341975: Unable to set encoding for IO.println, IO.print and IO.readln [v2]

2024-10-18 Thread Roger Riggs
On Thu, 17 Oct 2024 20:25:40 GMT, Naoto Sato wrote: >> Changing the charset initialization of `java.io.Console` class, which is the >> basis of `java.io.IO`, so that it would behave the same way as `System.out` >> wrt encoding. This change will also have the capability to override the >> defau

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v7]

2024-10-18 Thread Lance Andersen
On Fri, 18 Oct 2024 20:42:47 GMT, Eirik Bjørsnøs wrote: >> I am going to leat the comment as is > > Sorry, this was not to comment the summary, just pointing out that we have no > test verifying the combined length exceeding the limit when each component > alone does not. Thanks for the clarif

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v9]

2024-10-18 Thread Lance Andersen
> Please review the changes for > [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a > follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) which > addresses that > > - ZipEntry(String) > - ZipEntry::setComment > - ZipEntry::setExtra > > currently validat

Re: RFR: 8233451: (fs) Files.newInputStream() cannot be used with character special files [v2]

2024-10-18 Thread Brian Burkhalter
On Fri, 18 Oct 2024 15:03:43 GMT, Brian Burkhalter wrote: >> I wonder if there is another special file that could be read to EOF to allow >> the methods be tested. Asking because the overrides have a code path we need >> to test. > > I need to investigate this. I might hold off integrating even

Re: RFR: 8341975: Unable to set encoding for IO.println, IO.print and IO.readln [v2]

2024-10-18 Thread Iris Clark
On Thu, 17 Oct 2024 20:25:40 GMT, Naoto Sato wrote: >> Changing the charset initialization of `java.io.Console` class, which is the >> basis of `java.io.IO`, so that it would behave the same way as `System.out` >> wrt encoding. This change will also have the capability to override the >> defau

Re: RFR: 8335271: Specify the MessageFormat ArgumentIndex Implementation Limit [v4]

2024-10-18 Thread Justin Lu
> Please review this PR which specifies the _j.text.MessageFormat_ > ArgumentIndex limit. A corresponding CSR is drafted. > > Both the existence of the limit (and behavior if violated), as well as this > implementation's limit are added to the class description. See the JBS issue > comments for

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v7]

2024-10-18 Thread Lance Andersen
On Fri, 18 Oct 2024 20:29:00 GMT, Eirik Bjørsnøs wrote: >> Lance Andersen has updated the pull request incrementally with one >> additional commit since the last revision: >> >> change field -> fields > > test/jdk/java/util/zip/ZipEntry/MaxZipEntryFieldSizeTest.java line 28: > >> 26: * @sum

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v7]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 20:38:31 GMT, Lance Andersen wrote: >> test/jdk/java/util/zip/ZipEntry/MaxZipEntryFieldSizeTest.java line 28: >> >>> 26: * @summary Verify that ZipEntry(String), ZipEntry::setComment, and >>> 27: * ZipEntry::setExtra throws a IllegalArgumentException when the >>> 28: * com

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v7]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 20:06:14 GMT, Lance Andersen wrote: >> Please review the changes for >> [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a >> follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) >> which addresses that >> >> - ZipEntry(String) >> - Z

Re: RFR: 8069345: (fs) FileTreeWalker throws NotDirectoryException on file junction points [v2]

2024-10-18 Thread Brian Burkhalter
On Fri, 18 Oct 2024 11:51:42 GMT, Alan Bateman wrote: > Directory junctions may be semantically close but aren't quite the same thing > so I fear that this will require effort to audit every I/O operation to flush > out oddities. Probably. The constrained case of true directory junctions, wher

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread David M . Lloyd
On Fri, 18 Oct 2024 19:03:30 GMT, Sean Mullan wrote: >> This is the implementation of JEP 486: Permanently Disable the Security >> Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The >> [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the >> main ch

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Sean Mullan
On Thu, 17 Oct 2024 05:54:24 GMT, Alan Bateman wrote: >> Ok, I'll also add an API note to `getClassContext()` to use `StackWalker` >> instead. > > Okay, it already has `@see StackWalker`. My guess is that anything extending > SM to call getClassContext is very old code. If that old code is comp

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v7]

2024-10-18 Thread Lance Andersen
> Please review the changes for > [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a > follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) which > addresses that > > - ZipEntry(String) > - ZipEntry::setComment > - ZipEntry::setExtra > > currently validat

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v5]

2024-10-18 Thread Ioi Lam
On Wed, 16 Oct 2024 15:58:28 GMT, Ioi Lam wrote: >> Here's the call stack if I remove the "if" check on line 49. It can be >> reproduced with >> test/hotspot/jtreg/runtime/cds/appcds/aotClassLinking/BulkLoaderTest.java >> from the PR repo. >> >> >> 10 javaSignalHandler (sig=11, info=0x74

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v10]

2024-10-18 Thread Ioi Lam
> This is the 7th and final PR for [JEP 483: Ahead-of-Time Class Loading & > Linking](https://bugs.openjdk.org/browse/JDK-8315737). > > This PR implements the AOT-linking of invokedynamic callsites: > - We only link lambda expressions (`LambdaMetafactory::metafactory`) and > string concat (`Stri

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v5]

2024-10-18 Thread Lance Andersen
On Fri, 18 Oct 2024 18:40:13 GMT, Eirik Bjørsnøs wrote: >> Lance Andersen has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Address PR feedback > > src/java.base/share/classes/java/util/zip/ZipEntry.java line 528: > >> 526: * extra f

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v6]

2024-10-18 Thread Lance Andersen
> Please review the changes for > [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a > follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) which > addresses that > > - ZipEntry(String) > - ZipEntry::setComment > - ZipEntry::setExtra > > currently validat

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Sean Mullan
On Tue, 15 Oct 2024 22:14:00 GMT, Sean Mullan wrote: >> src/java.management/share/classes/javax/management/remote/JMXConnectorFactory.java >> line 225: >> >>> 223: */ >>> 224: public static JMXConnector connect(JMXServiceURL serviceURL) >>> 225: throws IOException { >> >>

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Sean Mullan
On Tue, 15 Oct 2024 14:50:54 GMT, Daniel Fuchs wrote: >> Sean Mullan has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 97 commits: >> >> - Merge remote-tracking branch 'jdk-sandbox/jep486' into JDK-8338411 >> - Change apiNote to d

RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning

2024-10-18 Thread Patricio Chilano Mateo
This is the implementation of JEP 491: Synchronize Virtual Threads without Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for further details. In order to make the code review easier the changes have been split into the following initial 4 commits: - Changes to allow unmou

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Sean Mullan
On Tue, 15 Oct 2024 17:01:59 GMT, Sean Mullan wrote: >>> While making `LogManager.checkAccess` be a no-op might be more convenient, >>> it could unconditionally permit operations that formerly required a >>> permission check: clearly a bad idea. Always throwing a `SecurityException` >>> is the

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Sean Mullan
On Wed, 16 Oct 2024 20:42:11 GMT, Sean Mullan wrote: >> The description for the SecurityException thrown by these methods were >> adjusted to "if access to the screen is denied by desktop environment". If >> you bring back the paragraphs that were removed then you might have to >> adjust the w

Re: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning

2024-10-18 Thread Patricio Chilano Mateo
On Fri, 18 Oct 2024 00:09:59 GMT, David Holmes wrote: >> This is the implementation of JEP 491: Synchronize Virtual Threads without >> Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for >> further details. >> >> In order to make the code review easier the changes have been

Re: RFR: 8338383: Implementation of Synchronize Virtual Threads without Pinning

2024-10-18 Thread David Holmes
On Thu, 17 Oct 2024 14:28:30 GMT, Patricio Chilano Mateo wrote: > This is the implementation of JEP 491: Synchronize Virtual Threads without > Pinning. See [JEP 491](https://bugs.openjdk.org/browse/JDK-8337395) for > further details. > > In order to make the code review easier the changes hav

Re: RFR: 8340554: Improve MessageFormat readObject checks [v2]

2024-10-18 Thread Justin Lu
> Please review this PR which improves the readObject logic for > _j.text.MessageFormat_. > > No offset should be larger than the pattern length. We already ensure the > offsets when consumed backwards are equal/descending. The existing > first/initial check was off by 1 since it was checking a

Re: RFR: 8340554: Improve MessageFormat readObject checks

2024-10-18 Thread Naoto Sato
On Thu, 17 Oct 2024 20:14:05 GMT, Justin Lu wrote: > Please review this PR which improves the readObject logic for > _j.text.MessageFormat_. > > No offset should be larger than the pattern length. We already ensure the > offsets when consumed backwards are equal/descending. The existing > fir

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v5]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 14:02:09 GMT, Lance Andersen wrote: >> Please review the changes for >> [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a >> follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) >> which addresses that >> >> - ZipEntry(String) >> - Z

Re: RFR: 8338411: Implement JEP 486: Permanently Disable the Security Manager [v2]

2024-10-18 Thread Sean Mullan
> This is the implementation of JEP 486: Permanently Disable the Security > Manager. See [JEP 486](https://openjdk.org/jeps/486) for more details. The > [CSR](https://bugs.openjdk.org/browse/JDK-8338412) describes in detail the > main changes in the JEP and also includes an apidiff of the specif

Re: RFR: 8339480: Build static-jdk image with a statically linked launcher [v7]

2024-10-18 Thread Johan Vos
On Tue, 15 Oct 2024 20:22:52 GMT, Magnus Ihse Bursie wrote: >> As a prerequisite for Hermetic Java, we need a statically linked `java` >> launcher. It should behave like the normal, dynamically linked `java` >> launcher, except that all JDK native libraries should be statically, not >> dynamic

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v4]

2024-10-18 Thread Dan Heidinga
On Fri, 18 Oct 2024 15:33:09 GMT, Chen Liang wrote: >> I looked at the InnerClassLambdaMetaFactory and it only generates >> MHs.Lookup.ClassOption::STRONG classes that live as long as their >> corresponding loaders. Given that, do we want an assert here that we are >> only dealing with strong

Integrated: 8340488: Clarify LocaleServiceProvider deployment on application module path

2024-10-18 Thread Justin Lu
On Tue, 1 Oct 2024 17:28:53 GMT, Justin Lu wrote: > Please review this PR and [CSR](https://bugs.openjdk.org/browse/JDK-8341285) > which clarifies that a Locale sensitive service provider can be deployed as a > module. > > This mainly follows the same format as the work done for > [JDK-834040

Re: RFR: 8338021: Support new unsigned and saturating vector operators in VectorAPI [v25]

2024-10-18 Thread Paul Sandoz
On Thu, 17 Oct 2024 23:35:36 GMT, Paul Sandoz wrote: > > I have restricted the IR validation to just newly added UMin/UMax > > transformations. > > Even then i think it better to do so in follow on PR, otherwise it is a > moving target for review and testing. This new test fails on aarch64 e.g

Re: RFR: 8327624: Remove VM implementation that bypass verification for core reflection [v2]

2024-10-18 Thread Mandy Chung
On Fri, 18 Oct 2024 16:54:59 GMT, Mandy Chung wrote: >> Oh that's a good find. Maybe we should write a test for this, if as I >> assume there isn't one already. >> Edit: not with this RFE, just in general. > >> // If the loader is not the boot loader then throw an exception if its >> // supercl

Re: RFR: 8327624: Remove VM implementation that bypass verification for core reflection [v2]

2024-10-18 Thread Mandy Chung
On Fri, 18 Oct 2024 16:17:12 GMT, Coleen Phillimore wrote: >> src/hotspot/share/classfile/classFileParser.cpp line 4098: >> >>> 4096: } >>> 4097: } >>> 4098: >> >> This code should not be removed. The spec for this code should now be: >> >> // If the loader is not the boot loader

Re: RFR: 8327624: Remove VM implementation that bypass verification for core reflection [v2]

2024-10-18 Thread Mandy Chung
On Fri, 18 Oct 2024 03:54:40 GMT, John R Rose wrote: > Happily, that day has come. Yes, feeling happy!I have been waiting to get rid of this last piece! - PR Comment: https://git.openjdk.org/jdk/pull/21571#issuecomment-2422885117

Re: RFR: 8327624: Remove VM implementation that bypass verification for core reflection [v2]

2024-10-18 Thread Coleen Phillimore
On Fri, 18 Oct 2024 02:25:16 GMT, David Holmes wrote: >> Mandy Chung has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Remove unused classes > > src/hotspot/share/classfile/classFileParser.cpp line 4098: > >> 4096: } >> 4097: }

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 15:43:18 GMT, Chen Liang wrote: >> Eirik Bjørsnøs has updated the pull request incrementally with four >> additional commits since the last revision: >> >> - Map versions by entry name hashcode instead of by entry name. This avoids >> String allocation and storage >> - Me

Re: RFR: 8336707: Contention of ForkJoinPool grows when stealing works [v2]

2024-10-18 Thread Viktor Klang
On Fri, 18 Oct 2024 15:18:12 GMT, Doug Lea wrote: >> This addresses tendencies in previous update to increase fencing, scanning, >> and signalling that can increase contention, and slow down performance >> especially on ARM platforms. It also uses more ARM-friendly constructions to >> reduce o

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Chen Liang
On Fri, 18 Oct 2024 13:59:32 GMT, Eirik Bjørsnøs wrote: >> Please review this PR which speeds up `JarFile::getEntry` lookup >> significantly for multi-release JAR files. >> >> The changes in this PR are motivated by the following insights: >> >> * `META-INF/versions/` is sparsely populated. >>

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v4]

2024-10-18 Thread Chen Liang
On Fri, 18 Oct 2024 14:56:23 GMT, Dan Heidinga wrote: >> (I've replied to this comment. I can see it in the mailing list but it seems >> to be lost on this page, so I'll add it again) >> >> We only resolve indys for the boot/platform/app class loaders, so there's no >> need to support class un

Re: RFR: 8336707: Contention of ForkJoinPool grows when stealing works [v2]

2024-10-18 Thread Doug Lea
> This addresses tendencies in previous update to increase fencing, scanning, > and signalling that can increase contention, and slow down performance > especially on ARM platforms. It also uses more ARM-friendly constructions to > reduce overhead (leading to several changes that all of the same

Re: RFR: 8293336: AOT-linking of invokedynamic for lambda expression and string concat [v4]

2024-10-18 Thread Dan Heidinga
On Fri, 18 Oct 2024 04:24:31 GMT, Ioi Lam wrote: >> We only resolve indys for the boot/platform/app class loaders, so there's no >> need to support class unloading. I've added a comment and tightened up the >> code with asserts. See version >> [382446d](https://github.com/openjdk/jdk/pull/2114

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 13:41:55 GMT, Claes Redestad wrote: >> Eirik Bjørsnøs has updated the pull request incrementally with four >> additional commits since the last revision: >> >> - Map versions by entry name hashcode instead of by entry name. This avoids >> String allocation and storage >>

Re: RFR: 8233451: (fs) Files.newInputStream() cannot be used with character special files [v2]

2024-10-18 Thread Brian Burkhalter
On Fri, 18 Oct 2024 08:06:48 GMT, Alan Bateman wrote: >> I added test coverage for `skip` but not for `readAllBytes` nor `readNBytes`: >> - `readAllBytes` throws before but hangs after the change; >> - `readNBytes` hangs both before and after the change. > > I wonder if there is another special f

Re: RFR: 8338021: Support new unsigned and saturating vector operators in VectorAPI [v30]

2024-10-18 Thread Jatin Bhateja
> Hi All, > > As per the discussion on panama-dev mailing list[1], patch adds the support > for following new vector operators. > > > . SUADD : Saturating unsigned addition. > . SADD: Saturating signed addition. > . SUSUB : Saturating unsigned subtraction. > . SSUB

Re: RFR: 8341137: Optimize long vector multiplication using x86 VPMULUDQ instruction [v4]

2024-10-18 Thread Jatin Bhateja
On Fri, 18 Oct 2024 02:03:21 GMT, Jatin Bhateja wrote: >> This patch optimizes LongVector multiplication by inferring VPMULUDQ >> instruction for following IR pallets. >> >> >>MulL ( And SRC1, 0x) ( And SRC2, 0x) >>MulL (URShift SRC1 , 32) (URShift

Re: RFR: 8325089: jpackage utility creates an "infinite", undeleteable directory tree [v4]

2024-10-18 Thread Alexey Semenyuk
> Make jpackage correctly handle the output directory (`--dest`) that is: > - a subdirectory of the input directory; > - the same as the input directory. > > Make jpackage correctly handle temp directory (`--temp`) that is: > - a subdirectory of the input directory. > > jpackage will produce a

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Claes Redestad
On Fri, 18 Oct 2024 12:08:08 GMT, Eirik Bjørsnøs wrote: >> There are a few possible strategies for avoiding that additional parse, >> since the effect we're getting at here is to have a quick filter to avoid >> pointless lookups and not necessarily an exact mapping. >> >> One is to store the `

Re: RFR: 8340133: Investigate if the java launcher could give hints about JShell [v3]

2024-10-18 Thread Alan Bateman
On Wed, 16 Oct 2024 14:55:34 GMT, Jan Lahoda wrote: >> Currently, running `java` without any parameters will lead to an output that >> is a full `--help`, which is over 100 lines (on my computer at least), and >> it feels overwhelming. And many people might actually want to run >> JShell/REPL,

Re: RFR: 8325089: jpackage utility creates an "infinite", undeleteable directory tree [v2]

2024-10-18 Thread Alexey Semenyuk
On Thu, 17 Oct 2024 01:59:46 GMT, Alexander Matveev wrote: >> Alexey Semenyuk has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use jdk.jpackage.test.Annotations.Parameter annotation to parameterize >> packaging type in the test > > Look

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Claes Redestad
On Fri, 18 Oct 2024 13:54:30 GMT, Eirik Bjørsnøs wrote: >> Please review this PR which speeds up `JarFile::getEntry` lookup >> significantly for multi-release JAR files. >> >> The changes in this PR are motivated by the following insights: >> >> * `META-INF/versions/` is sparsely populated. >>

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v5]

2024-10-18 Thread Lance Andersen
> Please review the changes for > [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a > follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) which > addresses that > > - ZipEntry(String) > - ZipEntry::setComment > - ZipEntry::setExtra > > currently validat

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Claes Redestad
On Fri, 18 Oct 2024 12:34:18 GMT, Claes Redestad wrote: >>> One is to store the `checkedHash` rather than the full `String`. This gets >>> `openCloseZipFile` down to ~91 ns/op. (`checkedHash` very hot in >>> profiles). There's still a chance for redundant lookups on hash collisions, >>> bu

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 10:04:55 GMT, Claes Redestad wrote: > One is to store the `checkedHash` rather than the full `String`. This gets > `openCloseZipFile` down to ~91 ns/op. (`checkedHash` very hot in > profiles). There's still a chance for redundant lookups on hash collisions, > but this s

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Claes Redestad
On Fri, 18 Oct 2024 09:31:45 GMT, Eirik Bjørsnøs wrote: >> With this change to `ZipFileOpen`: >> >> diff --git a/test/micro/org/openjdk/bench/java/util/zip/ZipFileOpen.java >> b/test/micro/org/openjdk/bench/java/util/zip/ZipFileOpen.java >> index 4f6ae6373ec..0e22cf7f0ab 100644 >> --- a/test/m

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Claes Redestad
On Thu, 17 Oct 2024 22:32:12 GMT, Claes Redestad wrote: >>> I guess performance leans on there being only one or a small number of >>> versions per entry. >> >> I checked Spring Petclinic: >> >> * 109 JAR dependencies >> * 15 are multi-release enabled. >> * The 15 MR-JARs have 9347 entries, o

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 09:23:17 GMT, Claes Redestad wrote: > I suspect remaining regression is mostly from the added `String` > creation/processing in `initCEN`. Yes, there is a cost with the String construction when parsing the name out of `META-INF/versions/{name}` - PR Review Com

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v3]

2024-10-18 Thread Eirik Bjørsnøs
> Please review this PR which speeds up `JarFile::getEntry` lookup > significantly for multi-release JAR files. > > The changes in this PR are motivated by the following insights: > > * `META-INF/versions/` is sparsely populated. > * Most entries are not versioned > * The number of unique versio

Re: RFR: 8341137: Optimize long vector multiplication using x86 VPMULUDQ instruction [v4]

2024-10-18 Thread Vladimir Ivanov
On Fri, 18 Oct 2024 02:03:21 GMT, Jatin Bhateja wrote: >> This patch optimizes LongVector multiplication by inferring VPMULUDQ >> instruction for following IR pallets. >> >> >>MulL ( And SRC1, 0x) ( And SRC2, 0x) >>MulL (URShift SRC1 , 32) (URShift

RFR: 8342609: Bug in jpackage test helper

2024-10-18 Thread Alexey Semenyuk
`Files.walk(root, 0)` returns the `root` itself and not the contents of the `root`. Replaced `Files.walk(root, 0)` with `Files.list(root)` to get a non-recursive listing of the `root` directory. - Commit messages: - 8342609: Bug in jpackage test helper Changes: https://git.openjdk

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v4]

2024-10-18 Thread Lance Andersen
On Fri, 18 Oct 2024 13:30:37 GMT, Eirik Bjørsnøs wrote: > Looks good. See comment about `headerSize` overflow plus some other minor > comments. Thank you > > Would this change in the `ZipEntry` API description require a re-approval of > the CSR, even if just a formality? Yes the CSR will need

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v4]

2024-10-18 Thread Lance Andersen
On Fri, 18 Oct 2024 13:24:08 GMT, Eirik Bjørsnøs wrote: >> Lance Andersen has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Added additional validation to ZipEntry > > src/java.base/share/classes/java/util/zip/ZipEntry.java line 106: > >>

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v4]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 12:58:17 GMT, Lance Andersen wrote: >> Please review the changes for >> [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a >> follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) >> which addresses that >> >> - ZipEntry(String) >> - Z

Re: RFR: 8325089: jpackage utility creates an "infinite", undeleteable directory tree [v3]

2024-10-18 Thread Alexey Semenyuk
> Make jpackage correctly handle the output directory (`--dest`) that is: > - a subdirectory of the input directory; > - the same as the input directory. > > Make jpackage correctly handle temp directory (`--temp`) that is: > - a subdirectory of the input directory. > > jpackage will produce a

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v4]

2024-10-18 Thread Eirik Bjørsnøs
On Fri, 18 Oct 2024 12:58:17 GMT, Lance Andersen wrote: >> Please review the changes for >> [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a >> follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) >> which addresses that >> >> - ZipEntry(String) >> - Z

Re: RFR: 8336707: Contention of ForkJoinPool grows when stealing works

2024-10-18 Thread Doug Lea
On Wed, 16 Oct 2024 16:38:13 GMT, Viktor Klang wrote: >> This addresses tendencies in previous update to increase fencing, scanning, >> and signalling that can increase contention, and slow down performance >> especially on ARM platforms. It also uses more ARM-friendly constructions to >> redu

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v2]

2024-10-18 Thread Lance Andersen
On Thu, 17 Oct 2024 19:29:16 GMT, Lance Andersen wrote: >>> I had thought about that and decided to keep the changes as they are. I am >>> not opposed to revisiting this in a follow on PR. Any additional changes >>> would require more javadoc updates to address the overall change in >>> valida

Re: RFR: 8340553: ZipEntry field validation does not take into account the size of a CEN header [v4]

2024-10-18 Thread Lance Andersen
> Please review the changes for > [JDK-8340553](https://bugs.openjdk.org/browse/JDK-8340553), which is a > follow-on to [JDK-8336025](https://bugs.openjdk.org/browse/JDK-8336025) which > addresses that > > - ZipEntry(String) > - ZipEntry::setComment > - ZipEntry::setExtra > > currently validat

Re: RFR: 8336707: Contention of ForkJoinPool grows when stealing works

2024-10-18 Thread Viktor Klang
On Fri, 18 Oct 2024 12:32:21 GMT, Doug Lea wrote: >> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1287: >> >>> 1285: if (!internal) >>> 1286: unlockPhase(); >>> 1287: if ((room == 0 || U.getReference(a, pk) == null) && pool >>>

Re: RFR: 8333796: Add missing serialization functionality to sun.reflect.ReflectionFactory [v7]

2024-10-18 Thread David M . Lloyd
> Issue [JDK-8164908](https://bugs.openjdk.org/browse/JDK-8164908) added > support for functionality required to continue to support IIOP and custom > serializers in light of additional module-based restrictions on reflection. > It was expected that these libraries would use `sun.misc.Unsafe` in

Re: RFR: 8336707: Contention of ForkJoinPool grows when stealing works

2024-10-18 Thread Viktor Klang
On Fri, 18 Oct 2024 12:27:34 GMT, Doug Lea wrote: >> src/java.base/share/classes/java/util/concurrent/ForkJoinPool.java line 1913: >> >>> 1911: if (!all) >>> 1912: break; >>> 1913: } >> >> Stylistically, it might be cleaner to do this: >> >> Sugg

Re: RFR: 8336707: Contention of ForkJoinPool grows when stealing works

2024-10-18 Thread Doug Lea
On Wed, 16 Oct 2024 16:32:32 GMT, Viktor Klang wrote: >> This addresses tendencies in previous update to increase fencing, scanning, >> and signalling that can increase contention, and slow down performance >> especially on ARM platforms. It also uses more ARM-friendly constructions to >> redu

Re: RFR: 8069345: (fs) FileTreeWalker throws NotDirectoryException on file junction points [v2]

2024-10-18 Thread Alan Bateman
On Thu, 17 Oct 2024 23:56:37 GMT, Brian Burkhalter wrote: > Agreed. Note that the only actual implementation changes being proposed here > are > > 1. `Files.isSymbolicLink` would return `true` for directory junctions. > 2. `Files.readSymbolicLink` would return the target of the mount point. >

Re: RFR: 8319343: Improve CDS module graph support for --add-modules option [v2]

2024-10-18 Thread Alan Bateman
On Thu, 17 Oct 2024 01:28:41 GMT, Calvin Cheung wrote: >> Summary of changes: >> >> Before dumping info the archive, all the module names from `--add-modules` >> will be sorted and then concatenated into one string with comma as the >> separator between module names. >> >> During runtime, sam

Re: RFR: 8233451: (fs) Files.newInputStream() cannot be used with character special files [v3]

2024-10-18 Thread Alan Bateman
On Thu, 17 Oct 2024 22:55:57 GMT, Brian Burkhalter wrote: >> Add `isOther` and `available` methods to `FileChannelImpl` and the >> interfaces to native code and use these in `ChannelInputStream` to work >> around cases where a wrapped `FileChannelImpl` is not really seekable. > > Brian Burkhalt

Re: RFR: 8342513: Autoboxing Overhead & Inefficient Parallel Processing

2024-10-18 Thread wasif kirmani
On Thu, 17 Oct 2024 22:41:02 GMT, wasif kirmani wrote: >> [JDK-8342513](https://bugs.openjdk.org/browse/JDK-8342513) : Autoboxing >> Overhead & Inefficient Parallel Processing > >> [xxDark](/xxDark) > > Quite an allegation. Well, I initially wrote it for IntStraem and as I > mentioned the perf

Re: RFR: 8342513: Autoboxing Overhead & Inefficient Parallel Processing

2024-10-18 Thread Viktor Klang
On Thu, 17 Oct 2024 22:41:02 GMT, wasif kirmani wrote: >> [JDK-8342513](https://bugs.openjdk.org/browse/JDK-8342513) : Autoboxing >> Overhead & Inefficient Parallel Processing > >> [xxDark](/xxDark) > > Quite an allegation. Well, I initially wrote it for IntStraem and as I > mentioned the perf

Re: RFR: 8327624: Remove VM implementation that bypass verification for core reflection [v2]

2024-10-18 Thread Alan Bateman
On Thu, 17 Oct 2024 22:44:05 GMT, Mandy Chung wrote: >> The old core reflection implementation generates dynamic classes that are >> special cases in the VM to bypass bytecode verification to workaround >> various issues [1] [2] [3]. >> >> The old core reflection implementation was [removed in

Re: RFR: 8342040: Further improve entry lookup performance for multi-release JARs [v2]

2024-10-18 Thread Eirik Bjørsnøs
On Mon, 14 Oct 2024 19:50:45 GMT, Eirik Bjørsnøs wrote: >> Please review this PR which speeds up `JarFile::getEntry` lookup >> significantly for multi-release JAR files. >> >> The changes in this PR are motivated by the following insights: >> >> * `META-INF/versions/` is sparsely populated. >>

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v48]

2024-10-18 Thread fabioromano1
> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses > repeated squares trick. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Refine comments to point out the substructure of the method's contract better ---

Re: RFR: 8335989: Implement Module Import Declarations (Second Preview) [v3]

2024-10-18 Thread Aggelos Biboudis
On Mon, 14 Oct 2024 12:46:29 GMT, Jan Lahoda wrote: >> This is a current patch for module imports declarations, second preview. At >> least the JEP number and preview revision will need to be updated in >> `jdk.internal.javac.PreviewFeature.Feature`, but otherwise I believe this is >> ready to

Re: RFR: 8333893: Optimization for StringBuilder append boolean & null [v19]

2024-10-18 Thread Emanuel Peter
On Mon, 23 Sep 2024 23:23:12 GMT, Shaojin Wen wrote: >> After PR https://github.com/openjdk/jdk/pull/16245, C2 optimizes stores into >> primitive arrays by combining values ​​into larger stores. >> >> This PR rewrites the code of appendNull and append(boolean) methods so that >> these two meth

Integrated: 8341664: ReferenceClassDescImpl cache internalName

2024-10-18 Thread Shaojin Wen
On Sun, 6 Oct 2024 01:22:33 GMT, Shaojin Wen wrote: > ReferenceClassDescImpl caches internalName to avoid creating a new String > object for each call, which can also simplify the implementation of classfile. This pull request has now been integrated. Changeset: 0963b9e8 Author:Shaojin Wen

Re: RFR: 8233451: (fs) Files.newInputStream() cannot be used with character special files [v2]

2024-10-18 Thread Alan Bateman
On Thu, 17 Oct 2024 22:56:33 GMT, Brian Burkhalter wrote: >> test/jdk/java/nio/file/Files/InputStreamTest.java line 139: >> >>> 137: InputStream s = Files.newInputStream(stdin); >>> 138: s.available(); >>> 139: } >> >> I assume you meant to close the input stream

Re: RFR: 8341273: JVMTI is not properly hiding some continuation related methods [v6]

2024-10-18 Thread Alan Bateman
On Fri, 18 Oct 2024 00:53:37 GMT, Serguei Spitsyn wrote: >> This fixes a problem in the VTMS (Virtual Thread Mount State) transition >> frames hiding mechanism. >> Please, see a fix description in the first comment. >> >> Testing: >> - Verified with new test `vthread/CheckHiddenFrames` >> - M

  1   2   >