Re: RFR: 8342486: Implement JEP 505: Structured Concurrency (Fifth Preview) [v8]

2025-04-14 Thread Alan Bateman
> Changes for [JEP 505: Structured Concurrency (Fifth > Preview)](https://openjdk.org/jeps/8340343). The proposal is to re-preview > the API with some changes, specifically: > > - A > [StructuredTaskScope](https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/

Re: RFR: 8354076: LinkedBlockingDeque offer() creates nodes even if capacity has been reached

2025-04-14 Thread kabutz
On Tue, 8 Apr 2025 18:39:30 GMT, kabutz wrote: > In the JavaDoc of LinkedBlockingDeque, it states: "Linked nodes are > dynamically created upon each insertion unless this would bring the deque > above capacity." However, in the current implementation, nodes are always > created, even if the de

Re: RFR: 8354565: jtreg failure handler GatherProcessInfoTimeoutHandler has a leftover call to System.loadLibrary

2025-04-14 Thread Kim Barrett
On Tue, 15 Apr 2025 05:50:03 GMT, Jaikiran Pai wrote: > Can I please get a review of this cleanup in the jtreg timeout handler > `GatherProcessInfoTimeoutHandler`? > > As noted in https://bugs.openjdk.org/browse/JDK-8354565, this is a leftover > after the change done in https://bugs.openjdk.ja

Re: RFR: 8354565: jtreg failure handler GatherProcessInfoTimeoutHandler has a leftover call to System.loadLibrary

2025-04-14 Thread Alan Bateman
On Tue, 15 Apr 2025 05:50:03 GMT, Jaikiran Pai wrote: > Can I please get a review of this cleanup in the jtreg timeout handler > `GatherProcessInfoTimeoutHandler`? > > As noted in https://bugs.openjdk.org/browse/JDK-8354565, this is a leftover > after the change done in https://bugs.openjdk.ja

Re: RFR: 8305186: Reference.waitForReferenceProcessing should be more accessible to tests

2025-04-14 Thread Kim Barrett
On Tue, 15 Apr 2025 00:00:35 GMT, Hans Boehm wrote: > > Racy initialization is fine, the field can be static and the last one (any > > racy init would all the same) wins: > > How did you conclude that? From what I can see, Method has non-final fields. > If another thread reads waitForReferenceP

Re: RFR: 8354300: Fields in String are not trusted

2025-04-14 Thread Chen Liang
On Mon, 14 Apr 2025 15:46:54 GMT, Jaikiran Pai wrote: >> This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and >> `j.l.String.hashIsZero`. This means the VM can trust these fields to never >> change which enables constant folding optimizations. >> >> This PR is tested in ti

Re: RFR: 8354076: LinkedBlockingDeque offer() creates nodes even if capacity has been reached

2025-04-14 Thread Chen Liang
On Tue, 8 Apr 2025 18:39:30 GMT, kabutz wrote: > In the JavaDoc of LinkedBlockingDeque, it states: "Linked nodes are > dynamically created upon each insertion unless this would bring the deque > above capacity." However, in the current implementation, nodes are always > created, even if the de

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v6]

2025-04-14 Thread Ioi Lam
On Mon, 14 Apr 2025 15:23:07 GMT, Timofei Pushkin wrote: >> test/hotspot/jtreg/runtime/cds/appcds/customLoader/ClassFromClasspath.java >> line 53: >> >>> 51: out.shouldContain("unreg CustomLoadee"); >>> 52: } >>> 53: } >> >> For completeness, I think we should have a more complicat

RFR: 8354464: Additional cleanup setting up native.encoding

2025-04-14 Thread Stuart Marks
Remove the #ifdef MACOSX from platform-independent System.c, which (on Mac) sets native.encoding from sprops.encoding or (on non-Mac Unix and Windows) sets native.encoding from sprops.sun_jnu_encoding. After this removal, the native.encoding property will be set from sprops.encoding and the sun

Re: RFR: 8354111: JavaDoc states that Iterator.remove() is linear in the LinkedBlockingDeque

2025-04-14 Thread Chen Liang
On Tue, 8 Apr 2025 08:50:37 GMT, kabutz wrote: > One of the features of the LinkedBlockingDeque is that it is a doubly-linked > node queue, with pointers in each node to "prev" and "next", which allows > remove() in the Iterator to remove the node in constant time. However, in the > JavaDoc of

Integrated: 8354111: JavaDoc states that Iterator.remove() is linear in the LinkedBlockingDeque

2025-04-14 Thread kabutz
On Tue, 8 Apr 2025 08:50:37 GMT, kabutz wrote: > One of the features of the LinkedBlockingDeque is that it is a doubly-linked > node queue, with pointers in each node to "prev" and "next", which allows > remove() in the Iterator to remove the node in constant time. However, in the > JavaDoc of

Re: RFR: 8354111: JavaDoc states that Iterator.remove() is linear in the LinkedBlockingDeque

2025-04-14 Thread duke
On Tue, 8 Apr 2025 08:50:37 GMT, kabutz wrote: > One of the features of the LinkedBlockingDeque is that it is a doubly-linked > node queue, with pointers in each node to "prev" and "next", which allows > remove() in the Iterator to remove the node in constant time. However, in the > JavaDoc of

Re: RFR: 8354300: Fields in String are not trusted

2025-04-14 Thread Aleksey Shipilev
On Mon, 14 Apr 2025 15:46:54 GMT, Jaikiran Pai wrote: > It then means that the other field will never move out of its initial value > and thus will never be considered "stable". For all non-zero hashcodes, it matters that `hash` would be constant-foldable, which means `if (h == 0 && !hashIsZe

Re: My experience using Java to do CLI Scripting

2025-04-14 Thread Stuart Marks
On 4/14/25 1:48 PM, Remi Forax wrote: From: "Ron Pressler" This does what you want (and could even be combined to a single expression): Process p = new ProcessBuilder("ls", "-al").start(); String result = p.inputReader().lines().collect(Collectors.joining("\n")); and it’s even nicer

Re: RFR: 8354111: JavaDoc states that Iterator.remove() is linear in the LinkedBlockingDeque

2025-04-14 Thread Stuart Marks
On Tue, 8 Apr 2025 08:50:37 GMT, kabutz wrote: > One of the features of the LinkedBlockingDeque is that it is a doubly-linked > node queue, with pointers in each node to "prev" and "next", which allows > remove() in the Iterator to remove the node in constant time. However, in the > JavaDoc of

Re: RFR: 8305186: Reference.waitForReferenceProcessing should be more accessible to tests [v5]

2025-04-14 Thread Hans Boehm
On Fri, Apr 11, 2025 at 2:39 PM Roger Riggs wrote: > On Fri, 11 Apr 2025 20:09:10 GMT, Brent Christian > wrote: > > test/lib/jdk/test/whitebox/WhiteBox.java line 568: > > > 566: private Method getWaitForReferenceProcessingMethod() { > > 567: Method wfrp = waitForReferenceProcessingMethod;

Re: RFR: 8301971: Make JDK source code UTF-8 [v3]

2025-04-14 Thread Magnus Ihse Bursie
> Most of the JDK code base has been transitioned to UTF-8, but not all. This > has recently become an acute problem, since our mixing of iso-8859-1 and > utf-8 in properties files confused the version of `sed` that is shipped with > the new macOS 15.4. > > The fix is basically simple, and incl

Integrated: 8346230: [perf] scalability issue for the specjvm2008::xml.transform workload

2025-04-14 Thread Vladimir Ivanov
On Fri, 17 Jan 2025 23:08:20 GMT, Vladimir Ivanov wrote: > The HashMap for caching was deleted. Now it use only ThreadLocal variable > without synchronization. > According to the specjvm2008::xml.transform workload the performance for low > threads counts was not affected and improved for high

RFR: 8354450: Using a File with a path containing a trailing space should fail when alternative data streams are disabled (win)

2025-04-14 Thread Brian Burkhalter
In `java.io.WinNTFileSystem::isInvalid`, replace an insufficient test for file path validity with a sufficient test for file path invalidity. Also, add a new test. - Commit messages: - 8354450: Using a File with a path containing a trailing space should fail when alternative data

Re: My experience using Java to do CLI Scripting

2025-04-14 Thread Remi Forax
- Original Message - > From: "Ron Pressler" > To: "cay horstmann" > Cc: "core-libs-dev" , "David Alayachew" > > Sent: Monday, April 14, 2025 10:30:40 PM > Subject: Re: My experience using Java to do CLI Scripting > (moved from amber-dev) > > Hi. > > This does what you want (and could

Re: My experience using Java to do CLI Scripting

2025-04-14 Thread Ron Pressler
(moved from amber-dev) Hi. This does what you want (and could even be combined to a single expression): Process p = new ProcessBuilder("ls", "-al").start(); String result = p.inputReader().lines().collect(Collectors.joining("\n")); and it’s even nicer in the cases where you may want to

Re: RFR: 8352504: RISC-V: implement and enable CMoveI/L [v8]

2025-04-14 Thread Hamlin Li
On Mon, 14 Apr 2025 06:26:10 GMT, Fei Yang wrote: >> Hamlin Li has updated the pull request incrementally with one additional >> commit since the last revision: >> >> minors > > test/hotspot/jtreg/compiler/lib/ir_framework/TestFramework.java line 149: > >> 147: "UseZbb",

Re: RFR: 8346230: [perf] scalability issue for the specjvm2008::xml.transform workload [v5]

2025-04-14 Thread Vladimir Ivanov
On Fri, 11 Apr 2025 10:13:41 GMT, Jatin Bhateja wrote: >> Vladimir Ivanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8346230: [perf] scalability issue for the specjvm2008::xml.transform >> workload > > src/java.xml/share/classes/co

Re: RFR: 8354053: Remove unused JavaIOFilePermissionAccess [v2]

2025-04-14 Thread Chen Liang
On Mon, 14 Apr 2025 16:14:03 GMT, Roger Riggs wrote: >> The JavaIOFilePermissionAccess interface is removed from SharedSecrets and >> its implementation (FilePermCompat.java) used by the test is moved to >> java.io FilePermission where cross package access is not needed. >> The test FilePermis

Re: RFR: 8354300: Fields in String are not trusted

2025-04-14 Thread Chen Liang
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg wrote: > This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and > `j.l.String.hashIsZero`. This means the VM can trust these fields to never > change which enables constant folding optimizations. > > This PR is tested in tier1, t

Re: RFR: 8346230: [perf] scalability issue for the specjvm2008::xml.transform workload [v6]

2025-04-14 Thread Joe Wang
On Mon, 14 Apr 2025 15:22:21 GMT, Vladimir Ivanov wrote: >> The HashMap for caching was deleted. Now it use only ThreadLocal variable >> without synchronization. >> According to the specjvm2008::xml.transform workload the performance for low >> threads counts was not affected and improved for h

Re: RFR: 8301971: Make JDK source code UTF-8 [v3]

2025-04-14 Thread Kim Barrett
On Mon, 14 Apr 2025 12:53:35 GMT, Magnus Ihse Bursie wrote: >> Most of the JDK code base has been transitioned to UTF-8, but not all. This >> has recently become an acute problem, since our mixing of iso-8859-1 and >> utf-8 in properties files confused the version of `sed` that is shipped with

Re: RFR: 8354300: Fields in String are not trusted

2025-04-14 Thread Aleksey Shipilev
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg wrote: > This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and > `j.l.String.hashIsZero`. This means the VM can trust these fields to never > change which enables constant folding optimizations. > > This PR is tested in tier1, t

Re: RFR: 8354300: Fields in String are not trusted

2025-04-14 Thread Per Minborg
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg wrote: > This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and > `j.l.String.hashIsZero`. This means the VM can trust these fields to never > change which enables constant folding optimizations. > > This PR is tested in tier1, t

Re: RFR: 8354300: Fields in String are not trusted

2025-04-14 Thread Jaikiran Pai
On Mon, 14 Apr 2025 14:47:59 GMT, Per Minborg wrote: > This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and > `j.l.String.hashIsZero`. This means the VM can trust these fields to never > change which enables constant folding optimizations. > > This PR is tested in tier1, t

Re: RFR: 8346230: [perf] scalability issue for the specjvm2008::xml.transform workload [v5]

2025-04-14 Thread Jatin Bhateja
On Mon, 14 Apr 2025 15:23:45 GMT, Vladimir Ivanov wrote: >> src/java.xml/share/classes/com/sun/org/apache/xml/internal/utils/XMLReaderManager.java >> line 148: >> >>> 146: // for this thread, remove it. >>> 147: ReaderWrapper rw = m_readers.get(); >>> 148: if (rw != null

Re: RFR: 8354053: Remove unused JavaIOFilePermissionAccess

2025-04-14 Thread Roger Riggs
On Fri, 11 Apr 2025 21:26:08 GMT, Roger Riggs wrote: > The JavaIOFilePermissionAccess interface is removed from SharedSecrets and > its implementation (FilePermCompat.java) used by the test is moved to java.io > FilePermission where cross package access is not needed. > The test FilePermission

Re: RFR: 8346230: [perf] scalability issue for the specjvm2008::xml.transform workload [v6]

2025-04-14 Thread duke
On Mon, 14 Apr 2025 15:22:21 GMT, Vladimir Ivanov wrote: >> The HashMap for caching was deleted. Now it use only ThreadLocal variable >> without synchronization. >> According to the specjvm2008::xml.transform workload the performance for low >> threads counts was not affected and improved for h

Re: RFR: 8346230: [perf] scalability issue for the specjvm2008::xml.transform workload [v6]

2025-04-14 Thread Vladimir Ivanov
On Mon, 14 Apr 2025 15:22:21 GMT, Vladimir Ivanov wrote: >> The HashMap for caching was deleted. Now it use only ThreadLocal variable >> without synchronization. >> According to the specjvm2008::xml.transform workload the performance for low >> threads counts was not affected and improved for h

Re: RFR: 8354053: Remove unused JavaIOFilePermissionAccess [v2]

2025-04-14 Thread Roger Riggs
> The JavaIOFilePermissionAccess interface is removed from SharedSecrets and > its implementation (FilePermCompat.java) used by the test is moved to java.io > FilePermission where cross package access is not needed. > The test FilePermissionCollectionMerge is updated to access the internal > im

Re: RFR: 8354053: Remove unused JavaIOFilePermissionAccess [v2]

2025-04-14 Thread Roger Riggs
On Mon, 14 Apr 2025 16:14:03 GMT, Roger Riggs wrote: >> The JavaIOFilePermissionAccess interface is removed from SharedSecrets and >> its implementation (FilePermCompat.java) used by the test is moved to >> java.io FilePermission where cross package access is not needed. >> The test FilePermis

Re: RFR: 8343157: Examine large files for character encoding/decoding

2025-04-14 Thread Naoto Sato
On Fri, 11 Apr 2025 17:02:13 GMT, Naoto Sato wrote: > Removing old charset test cases that verify new charset implementations (as > of JDK7). Removed tests/files are actual charset implementations used in > pre-JDK7, which have been used for comparing the results. Since those "new" > implement

Integrated: 8354513: Bug in j.u.l.Handler deadlock test allows null pointer during race condition

2025-04-14 Thread David Beaumont
On Mon, 14 Apr 2025 10:56:45 GMT, David Beaumont wrote: > Add null pointer guard in test formatter (since it can be called with a log > record without parameters). This pull request has now been integrated. Changeset: 313c34ae Author:David Beaumont Committer: Daniel Fuchs URL: htt

Re: RFR: 8346230: [perf] scalability issue for the specjvm2008::xml.transform workload [v5]

2025-04-14 Thread Vladimir Ivanov
On Fri, 11 Apr 2025 10:06:06 GMT, Jatin Bhateja wrote: >> Vladimir Ivanov has updated the pull request incrementally with one >> additional commit since the last revision: >> >> 8346230: [perf] scalability issue for the specjvm2008::xml.transform >> workload > > src/java.xml/share/classes/co

Re: RFR: 8348556: Inlining fails earlier for MemorySegment::reinterpret [v7]

2025-04-14 Thread Per Minborg
On Tue, 8 Apr 2025 12:24:41 GMT, Per Minborg wrote: >> This PR proposes to add some `@ForceInline` annotations in the `Module` >> class in order to assist inlining of FFM var/method handles. >> >> There are also some changes in other classes which, if implemented, can take >> us three addition

Re: RFR: 8350075: Performance difference between SegmentAllocator methods [v2]

2025-04-14 Thread Per Minborg
On Thu, 10 Apr 2025 06:00:48 GMT, Per Minborg wrote: >> This PR proposes to add `@ForceInline` to the `default` methods in >> `SegmentAllocator` that do not already have it. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The incremental webrev

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v6]

2025-04-14 Thread Timofei Pushkin
On Thu, 10 Apr 2025 16:04:59 GMT, Ioi Lam wrote: >> Timofei Pushkin has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Remove findClass, extend explanation comments > > test/hotspot/jtreg/runtime/cds/appcds/customLoader/ClassFromClasspath.j

RFR: 8354300: Fields in String are not trusted

2025-04-14 Thread Per Minborg
This PR proposes to add the `@Stable` annotation to `j.l.String.hash` and `j.l.String.hashIsZero`. This means the VM can trust these fields to never change which enables constant folding optimizations. This PR is tested in tier1, tier2, and tier3 which all pass. - Commit messages:

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v7]

2025-04-14 Thread Timofei Pushkin
> If a base class is package-private then its subclasses should have the same > package name and defining class loader, otherwise `IllegalAccessError` is > thrown when linking a subclass. Currently when dumping a static archive > separate `URLClassLoader`s are used for each unregistered classes'

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v5]

2025-04-14 Thread Timofei Pushkin
On Thu, 10 Apr 2025 16:01:20 GMT, Ioi Lam wrote: >> Currently we have some restrictions if`-Djava.system.class.loader=` is >> specified >> >> - we disable full module graph archiving: >> https://github.com/openjdk/jdk/blob/0e223f1456c14efdb423595bee3444d5e26db7c6/src/hotspot/share/cds/cdsConfi

Re: RFR: 8348986: Improve coverage of enhanced exception messages [v5]

2025-04-14 Thread Daniel Fuchs
On Thu, 10 Apr 2025 21:26:21 GMT, Michael McMahon wrote: >> Hi, >> >> Enhanced exception messages are designed to hide sensitive information such >> as hostnames, IP >> addresses from exception message strings, unless the enhanced mode for the >> specific category >> has been explicitly enab

Re: RFR: 8315130: java.lang.IllegalAccessError when processing classlist to create CDS archive [v8]

2025-04-14 Thread Timofei Pushkin
> If a base class is package-private then its subclasses should have the same > package name and defining class loader, otherwise `IllegalAccessError` is > thrown when linking a subclass. Currently when dumping a static archive > separate `URLClassLoader`s are used for each unregistered classes'

Re: RFR: 8354513: Bug in j.u.l.Handler deadlock test allows null pointer during race condition

2025-04-14 Thread duke
On Mon, 14 Apr 2025 10:56:45 GMT, David Beaumont wrote: > Add null pointer guard in test formatter (since it can be called with a log > record without parameters). @david-beaumont Your change (at version 67bea85bb13c3a7c46d28a458230a2a8e51e7f4d) is now ready to be sponsored by a Committer. -

RE: JDK-8352891 Performance improvements to ByteArrayOutputStream

2025-04-14 Thread Engebretson, John
I thought about this over the weekend, and I think the byte[] variant and the Object[] variant target separate problems: byte[] targets I/O patterns and Object[] targets Collections. So my current mental model is: public class java.io.VariableLengthByteArray { // whatever views we want to sup

Re: RFR: 8354053: Remove unused JavaIOFilePermissionAccess

2025-04-14 Thread Alan Bateman
On Sun, 13 Apr 2025 20:01:28 GMT, Weijun Wang wrote: > I remember the implies method of the file permission class depends on whether > this system property is set. Although file permission is no longer used in > access control check the class and the method are still there. Right, and I wasn't

Re: RFR: 8305186: Reference.waitForReferenceProcessing should be more accessible to tests [v6]

2025-04-14 Thread Kim Barrett
On Fri, 11 Apr 2025 23:31:16 GMT, Brent Christian wrote: >> Certain specific types of tests involving GC and reference processing need >> to account for the delay between a GC completing (during which the GC clears >> a Reference), and the Reference being added to its associated queue. At >> p

Re: RFR: 8305186: Reference.waitForReferenceProcessing should be more accessible to tests [v6]

2025-04-14 Thread Kim Barrett
On Sat, 12 Apr 2025 05:47:06 GMT, Kim Barrett wrote: >> Brent Christian has updated the pull request incrementally with two >> additional commits since the last revision: >> >> - Make *the method* static, also >> - Make Method static > > test/lib/jdk/test/whitebox/WhiteBox.java line 609: > >

Re: RFR: 8301971: Make JDK source code UTF-8 [v2]

2025-04-14 Thread Kim Barrett
On Sun, 13 Apr 2025 23:14:41 GMT, Magnus Ihse Bursie wrote: >> Most of the JDK code base has been transitioned to UTF-8, but not all. This >> has recently become an acute problem, since our mixing of iso-8859-1 and >> utf-8 in properties files confused the version of `sed` that is shipped with

Re: RFR: 8352533: Report useful IOExceptions when jspawnhelper fails [v3]

2025-04-14 Thread Aleksey Shipilev
On Wed, 26 Mar 2025 17:31:47 GMT, Aleksey Shipilev wrote: >> When jspawnhelper fails for whatever reason, but more prominently due to >> [JDK-8325621](https://bugs.openjdk.org/browse/JDK-8325621), it will report >> the errors into stdout, but not to the relevant `IOException`. So, if the >> ap

Re: RFR: 8301971: Make JDK source code UTF-8 [v2]

2025-04-14 Thread Magnus Ihse Bursie
On Sun, 13 Apr 2025 23:14:41 GMT, Magnus Ihse Bursie wrote: >> Most of the JDK code base has been transitioned to UTF-8, but not all. This >> has recently become an acute problem, since our mixing of iso-8859-1 and >> utf-8 in properties files confused the version of `sed` that is shipped with

Re: RFR: 8352504: RISC-V: implement and enable CMoveI/L [v8]

2025-04-14 Thread Fei Yang
On Fri, 11 Apr 2025 10:48:34 GMT, Hamlin Li wrote: >> Hi, >> Can you help to review this patch? >> On riscv, CMoveI/L already were implemented, but there are some gap: >> 1. CMoveI/L does not support comparison with float/double, corresponding >> tests are not turn on either. >> 2. Some optimiza

Re: RFR: 8352504: RISC-V: implement and enable CMoveI/L [v8]

2025-04-14 Thread Feilong Jiang
On Fri, 11 Apr 2025 10:48:34 GMT, Hamlin Li wrote: >> Hi, >> Can you help to review this patch? >> On riscv, CMoveI/L already were implemented, but there are some gap: >> 1. CMoveI/L does not support comparison with float/double, corresponding >> tests are not turn on either. >> 2. Some optimiza

Re: RFR: 8354111: JavaDoc states that Iterator.remove() is linear in the LinkedBlockingDeque

2025-04-14 Thread kabutz
On Tue, 8 Apr 2025 08:50:37 GMT, kabutz wrote: > One of the features of the LinkedBlockingDeque is that it is a doubly-linked > node queue, with pointers in each node to "prev" and "next", which allows > remove() in the Iterator to remove the node in constant time. However, in the > JavaDoc of