Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-15 Thread John Rose
A @Stable field does not need to be volatile. Avoiding volatile is one of the uses for @Stable. That said, @Stable is not as foolproof as volatile. It’s more dangerous, and cheaper. You have to do a release store to a stable variable. That’s what the VM does for you automatically for a final, an

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-15 Thread John Rose
On 13 Mar 2025, at 4:20, Per Minborg wrote: > … >> Reentrancy into here seems really buggy, I would endorse disallowing it >> >> instead. In that case, a `ReentrantLock` seems better than the native >> monitor as we can cheaply check `lock.isHeldByCurrentThread()` > > StableValueImpl was careful

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-15 Thread John R Rose
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

RFR: 8352107: Allow jtreg test cases to query test VM properties

2025-03-15 Thread Ioi Lam
This PR tries to cut down the use of `WhiteBox` in the HotSpot test cases. It modifies `VMProps` to save the set of VM properties into a file called "vm.properties" under Jtreg's work directory. The new API `jdk.test.lib.VMPropsGetter` loads the properties from this file to pass onto individual

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-15 Thread John Rose
> Are deeper cycles of concern? I was thinking of this: There are a couple of ways existing java.util code handles self-cycles. The deepToString method handles them at all levels, so it is robust. But it is tricky and expensive. (Look at the variable named “dejaVu”.) If you grep for /"(this / i

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-15 Thread John R Rose
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-15 Thread John R Rose
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-15 Thread John R Rose
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8343110: Add getChars(int, int, char[], int) to CharSequence and CharBuffer

2025-03-15 Thread Markus KARG
On Sat, 26 Oct 2024 15:48:11 GMT, Markus KARG wrote: > This Pull Request proposes an implementation for > [JDK-8343110](https://bugs.openjdk.org/browse/JDK-8343110): Adding the new > method `public void getChars(int srcBegin, int srcEnd, char[] dst, int > dstBegin)` to the `CharSequence` inter

Xalan-J xsl 3 within openjdk

2025-03-15 Thread Mukul Gandhi
Hi all, Few days ago, I've suggested on this list to try having latest Xalan-J XSLT 3.0 development code (it's available here, https://github.com/apache/xalan-java/tree/xalan-j_xslt3.0_mvn. IMHO, I've written all XSLT 3 and corresponding XPath 3.1 changes within Xalan-J's XSL 3 dev repos branch

Re: Request for Enhancement: java.io.Writer.of(Appendable) as an efficient alternative to java.io.StringWriter

2025-03-15 Thread Markus KARG
Chen, thank you for sharing your opinion! Thinking about what you wrote about the "trifecta" complexity, I think it might be better to restart my idea from scratch: As explained in my original proposal (https://mail.openjdk.org/pipermail/core-libs-dev/2024-December/137807.html), the actual

Re: RFR: 8342382: Implementation of JEP G1: Improve Application Throughput with a More Efficient Write-Barrier [v17]

2025-03-15 Thread Thomas Schatzl
On Wed, 12 Mar 2025 13:56:57 GMT, Thomas Schatzl wrote: >> src/hotspot/share/gc/g1/g1ConcurrentRefine.cpp line 263: >> >>> 261: >>> 262: SuspendibleThreadSetLeaver sts_leave; >>> 263: VMThread::execute(&op); >> >> Can you elaborate what synchronization this VM op is trying to achieve?

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-15 Thread Quan Anh Mai
On Wed, 12 Mar 2025 08:09:04 GMT, Per Minborg wrote: >> If you have an `@Stable Object[]`, then the elements are also considered >> `@Stable`. Then you can do something like: >> >> ReentrantLock[] locks; >> >> T get(int idx) { >> Object x = backing[idx]; >> if (x == nul

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-15 Thread Per Minborg
On Tue, 11 Mar 2025 19:04:39 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/lang/StableValue.java line 344: >> >>> 342: * {@linkplain java.lang.ref##reachability reachable} stable values >>> will hold their set >>> 343: * content perpetually. >>> 344: * >> >> Should the origina

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-15 Thread Quan Anh Mai
On Tue, 11 Mar 2025 11:19:13 GMT, Per Minborg wrote: >> src/java.base/share/classes/java/util/ImmutableCollections.java line 777: >> >>> 775: private final IntFunction mapper; >>> 776: @Stable >>> 777: private final StableValueImpl[] backing; >> >> You can use a backing

Re: RFR: 8352015: LIBVERIFY_OPTIMIZATION remove special optimization settings

2025-03-15 Thread Magnus Ihse Bursie
On Fri, 14 Mar 2025 11:53:33 GMT, Alan Bateman wrote: >> On Linux there are some special settings for LIBVERIFY_OPTIMIZATION that are >> most likely not needed any more and could be removed. >> The removal (on Linux) brings the lib optimization level de facto from LOW >> to HIGH. > > In additio

Integrated: 8351017: ChronoUnit.MONTHS.between() not giving correct result when date is in February

2025-03-15 Thread Naoto Sato
On Thu, 6 Mar 2025 23:36:29 GMT, Naoto Sato wrote: > Clarifying the explanation for `TemporalUnit.between()`. There is already an > example for the `HOURS` case where the minutes are not enough to make a full > hour. Explaining how smaller units contribute to determining the whole > number, al

Re: RFR: 8351969: Add Public Identifiers to the JDK built-in Catalog

2025-03-15 Thread Mikhail Yankelevich
On Thu, 13 Mar 2025 19:01:03 GMT, Joe Wang wrote: > Add public identifiers to the JDK built-in Catalog; Replace the incorrect > Schema 1.1 DTD files (note the Public Identifier at line 2) with the correct > Shema 1.0 DTDs. Looks good to me, just a few very minor questions. Thank you test/jaxp

Re: RFR: 8351344: Avoid explicit Objects.requireNonNull in String.join

2025-03-15 Thread Jaikiran Pai
On Thu, 20 Feb 2025 09:30:02 GMT, Andrey Turbanov wrote: > We have helpful NPE messages now - they are more user-friendly. > And shorter methods are more likely to be inlined. src/java.base/share/classes/java/lang/String.java line 3649: > 3647: Iterable elements) { > 3648: O

RFR: 8351970: Retire JavaLangAccess::exit

2025-03-15 Thread Roger Riggs
Cleanup the single use of JavaLangAccess.exit() it is no longer necessary; System.exit() can be called directly. - Commit messages: - 8351970: Retire JavaLangAccess::exit Changes: https://git.openjdk.org/jdk/pull/24066/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24066&

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview)

2025-03-15 Thread Per Minborg
On Wed, 12 Mar 2025 14:38:28 GMT, Luca Kellermann wrote: >> This is something we experimented with a bit in the past. It isn't easy to >> do in the general case. There are pros (the function and its resources that >> can be collected) and cons (e.g., mutability, visibility, complexity, etc.) >

Re: RFR: 8351322: Parameterize link option for pthreads

2025-03-15 Thread snake66
On Thu, 6 Mar 2025 15:56:43 GMT, Magnus Ihse Bursie wrote: >> Replace hardcoded instances of `-lpthread` with `$(LIBPTHREAD)`, so that >> it's possible to parameterize this for platforms that use different flags >> for enabling posix threads. >> >> This work is a continuation of the work done

Re: RFR: 8351322: Parameterize link option for pthreads [v2]

2025-03-15 Thread Erik Joelsson
On Sat, 8 Mar 2025 13:39:44 GMT, snake66 wrote: >> Replace hardcoded instances of `-lpthread` with `$(LIBPTHREAD)`, so that >> it's possible to parameterize this for platforms that use different flags >> for enabling posix threads. >> >> This work is a continuation of the work done by Greg Lew

Re: RFR: 8351322: Parameterize link option for pthreads [v2]

2025-03-15 Thread Magnus Ihse Bursie
On Thu, 6 Mar 2025 13:27:15 GMT, snake66 wrote: >> Abstracting this out seems reasonable to me, though I should say I thought >> we already used `-pthread` rather than `-lpthread`. >> >> Needs build team approval before integrating. > >> Abstracting this out seems reasonable to me, though I sho

Re: RFR: 8341641: Make %APPDATA% and %LOCALAPPDATA% env variables available in *.cfg files

2025-03-15 Thread Alexey Semenyuk
On Thu, 6 Mar 2025 12:10:01 GMT, Andrey Turbanov wrote: >> jpackage app laucnher will expand environment variables in .cfg files. >> >> Previously jpackage app launcher only replaced `$APPDIR`, `$BINDIR`, and >> `$ROOTDIR` tokens with the corresponding path values. With this patch, any >> envi

Re: RFR: 8351322: Parameterize link option for pthreads

2025-03-15 Thread Erik Joelsson
On Thu, 6 Mar 2025 10:39:27 GMT, snake66 wrote: > Replace hardcoded instances of `-lpthread` with `$(LIBPTHREAD)`, so that it's > possible to parameterize this for platforms that use different flags for > enabling posix threads. > > This work is a continuation of the work done by Greg Lewis in

Re: RFR: 8351842: Test issues on Windows with combination of --enable-linkable-runtime and --with-external-symbols-in-bundles=public

2025-03-15 Thread Severin Gehwolf
On Fri, 14 Mar 2025 12:29:22 GMT, Christoph Langer wrote: > Alternative approach to #24012 > > This keeps the current handling of *.pdb vs *.stripped.pdb which allows > debugging at the cost of a little hack in jlink. Maybe the code in jlink can > be improved, e.g. make it more conditional. >

Re: RFR: 8351969: Add Public Identifiers to the JDK built-in Catalog [v2]

2025-03-15 Thread Joe Wang
> Add public identifiers to the JDK built-in Catalog; Replace the incorrect > Schema 1.1 DTD files (note the Public Identifier at line 2) with the correct > Shema 1.0 DTDs. Joe Wang has updated the pull request incrementally with one additional commit since the last revision: update the test

Re: RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]

2025-03-15 Thread Chen Liang
On Thu, 13 Mar 2025 15:22:43 GMT, Per Minborg wrote: >> Implement JEP 502. >> >> The PR passes tier1-tier3 tests. > > Per Minborg has updated the pull request with a new target base due to a > merge or a rebase. The pull request now contains 246 commits: > > - Merge branch 'master' into imple

Re: RFR: 8342382: Implementation of JEP G1: Improve Application Throughput with a More Efficient Write-Barrier [v22]

2025-03-15 Thread Thomas Schatzl
> Hi all, > > please review this change that implements (currently Draft) JEP: G1: > Improve Application Throughput with a More Efficient Write-Barrier. > > The reason for posting this early is that this is a large change, and the JEP > process is already taking very long with no end in sight