Re: RFR: 8360411: [TEST] open/test/jdk/java/io/File/MaxPathLength.java Refactor extract method to encapsulate Windows specific test logic

2025-07-21 Thread duke
On Tue, 8 Jul 2025 16:10:17 GMT, Darragh Conway wrote: > Refactored extract method to encapsulate Windows specific test logic @DarraghConway Your change (at version ba78184ecd4195663832166b06225c670ac00b38) is now ready to be sponsored by a Committer. - PR Comment: https://git.op

Re: RFR: 8356438: Update OutputAnalyzer to optionally print process output as it happens [v2]

2025-07-21 Thread David Holmes
On Tue, 17 Jun 2025 17:33:31 GMT, Matthew Donovan wrote: >> To add on this, I should mention that I noticed a lot of tests are using >> OutputAnalyzer indirectly, returned as a result of a utility function, for >> example `ProcessTools.execute{Process,Command}` >> >> >> git grep -E "ProcessTo

Re: RFR: 8355177: Speed up StringBuilder::append(char[]) via Unsafe::copyMemory [v8]

2025-07-21 Thread Chen Liang
On Fri, 27 Jun 2025 01:04:32 GMT, Shaojin Wen wrote: >> In BufferedReader.readLine and other similar scenarios, we need to use >> StringBuilder.append(char[]) to build the string. >> >> For these scenarios, we can Unsafe.copyMemory instead of the character copy >> of the char-by-char loop to i

Re: RFR: 8362889: [GCC static analyzer] leak in libstringPlatformChars.c [v2]

2025-07-21 Thread Matthias Baesken
On Mon, 21 Jul 2025 15:27:13 GMT, Roger Riggs wrote: >> Matthias Baesken has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Another early return needs a free too > > test/jdk/java/lang/String/nativeEncoding/libstringPlatformChars.c line 74:

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v11]

2025-07-21 Thread Mikhail Yankelevich
On Mon, 21 Jul 2025 13:28:00 GMT, Volkan Yazici wrote: >> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve >> their documentation, enhance the checks in the associated IR or assembly >> code, and adapt them to cause VM crash on invalid input. >> >> ## Implementation

Re: String.charAt vs StringBuilder.charAt performance

2025-07-21 Thread Roger Riggs
Hi Brett, The labeling of the output is confusing, the test output labeled as StringBuffer but the jmh creates StringBuilder. (StringBuffer methods are all synchronized and could explain why they are slower). Also, I would not be surprised that C2 has more optimizations for String than for S

Re: String.charAt vs StringBuilder.charAt performance

2025-07-21 Thread Brett Okken
> output labeled as StringBuffer but the jmh creates StringBuilder. Ugh - sorry about that. But yes - this is about StringBuilder vs String. > I would not be surprised that C2 has more optimizations for String than for StringBuilder. If that were true, it would not surprise me. However, these t

Re: RFR: 8362889: [GCC static analyzer] leak in libstringPlatformChars.c [v2]

2025-07-21 Thread David Holmes
On Mon, 21 Jul 2025 15:38:36 GMT, Matthias Baesken wrote: >> test/jdk/java/lang/String/nativeEncoding/libstringPlatformChars.c line 74: >> >>> 72: (*env)->ReleasePrimitiveArrayCritical(env, bytes, (void*)jbytes, 0); >>> 73: >>> 74: jstring res = JNU_NewStringPlatform(env, str); >> >> A

Re: RFR: 8359419: AArch64: Relax min vector length to 32-bit for short vectors [v4]

2025-07-21 Thread Xiaohong Gong
On Wed, 9 Jul 2025 01:23:43 GMT, Xiaohong Gong wrote: >> ### Background >> On AArch64, the minimum vector length supported is 64-bit for basic types, >> except for `byte` and `boolean` (32-bit and 16-bit respectively to match >> special Vector API features). This limitation prevents intrinsific

Re: RFR: 8345836: Stable annotation documentation is incomplete

2025-07-21 Thread Andrey Turbanov
On Wed, 16 Jul 2025 17:45:23 GMT, Ioi Lam wrote: > Please review this documentation update, authored by @rose00 and originally > pushed to the Leyden repo in [this > PR](https://github.com/openjdk/leyden/pull/26), where more comments can be > found regarding this update. src/java.base/share/c

Re: RFR: 8362889: [GCC static analyzer] leak in libstringPlatformChars.c [v2]

2025-07-21 Thread Matthias Baesken
> This is reported by the gcc static analyzer (-fanalyzer); it is just test > coding so not very critical but probably should still be adjusted . > > > /jdk/test/jdk/java/lang/String/nativeEncoding/libstringPlatformChars.c:74:12: > warning: leak of 'str' [CWE-401] [-Wanalyzer-malloc-leak] >

Re: RFR: 8358880: Performance of parsing with DecimalFormat can be improved [v6]

2025-07-21 Thread Justin Lu
On Mon, 16 Jun 2025 21:19:45 GMT, Johannes Graham wrote: >> This PR replaces construction of intermediate strings to be parsed with more >> direct manipulation of numbers. It also has a more streamlined mechanism of >> handling `Long.MIN_VALUE` when parsing longs by using >> `Long.parseUnsigne

Re: RFR: 8360163: Replace hard-coded checks with AOTRuntimeSetup and AOTSafeClassInitializer [v11]

2025-07-21 Thread Jiangli Zhou
On Mon, 21 Jul 2025 21:08:13 GMT, Chen Liang wrote: > > heapShared.cpp contains a list of hard coded classes & fields for archiving > > the initialized states in CDS archive. With the support for using > > annotation for pre-init being added to the mainline, the support can be > > applied to t

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
On Mon, 21 Jul 2025 20:44:58 GMT, Chen Liang wrote: >> Got it. Could you have this hook in a private class method or a static >> public method? >> Maybe it can be reused in another points? > >> Maybe it can be reused in another points? > > ClassFileFormatVersion and Optional are more user-orie

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
On Mon, 21 Jul 2025 09:00:03 GMT, Mikhail Yankelevich wrote: >> simon has updated the pull request incrementally with two additional commits >> since the last revision: >> >> - 8355652: update copyright year to 2025 in ClassFileVersionImpl.java >> - 8355652: update copyright year to 2025 in

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
> 8355652: add new method to return ClassFileFormatVersion from > ClassFileVersion. > - > ### Progress > - [ ] Change must be properly reviewed (1 review required, with at least 1 > [Reviewer](https://openjdk.org/bylaws#reviewer)) > - [x] Change must not contain extraneous whitespace > -

Re: String.charAt vs StringBuilder.charAt performance

2025-07-21 Thread Brett Okken
Updating to have different test methods for each representation did remove the difference for the non-ascii String case for the jdk 21+ releases. However, the ascii (latin) strings are still slower with String than StringBuilder. How does C2 then handle something like StringCharBuffer wrapping a C

Re: RFR: 8360163: Replace hard-coded checks with AOTRuntimeSetup and AOTSafeClassInitializer [v11]

2025-07-21 Thread Chen Liang
On Mon, 21 Jul 2025 07:16:30 GMT, Jiangli Zhou wrote: > heapShared.cpp contains a list of hard coded classes & fields for archiving > the initialized states in CDS archive. With the support for using annotation > for pre-init being added to the mainline, the support can be applied to those > c

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread Chen Liang
On Mon, 21 Jul 2025 20:48:12 GMT, simon wrote: >>> Maybe it can be reused in another points? >> >> ClassFileFormatVersion and Optional are more user-oriented classes; internal >> code don't really ever use these two types, so I don't think you need to >> extract this logic specifically. > > I

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-21 Thread Vladimir Ivanov
On Wed, 2 Jul 2025 00:18:28 GMT, Ioi Lam wrote: > The CDS full module graph is supposed to contain a snapshot of the boot > layer, which has 3 unnamed modules for the boot, platform and system class > loaders. Each unnamed module is represented by a `java.lang.Module` Java > object and a `Modu

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion [v2]

2025-07-21 Thread simon
On Mon, 21 Jul 2025 21:24:52 GMT, Chen Liang wrote: >> I mean about the rule the version - similar to isSupportedClassFileVersion >> method > > I still don't think so. I intentionally proposed the original RFE so we have > one place where we can consolidate this handling, and that place should

Re: String.charAt vs StringBuilder.charAt performance

2025-07-21 Thread Chen Liang
I finally came around and ran the benchmark on my linux-x64 device; however, I could not produce your results where String is significantly slower than StringBuilder. This is the results I've got: Benchmark (data) Mode CntScore Error Units Char

Re: FFM - Optimizing string reads in MemorySegment

2025-07-21 Thread Per-Ake Minborg
Hi Liam! Thank you for your comments on MemorySegment::getString ! The intention was that the creation of the intermediate array should be elided, but as you point out, that is (at least sometimes) not the case. I've made an experimental patch where I've used JavaLangAccess::uncheckedNewStringN

Re: RFR: 8362889: [GCC static analyzer] leak in libstringPlatformChars.c

2025-07-21 Thread Roger Riggs
On Mon, 21 Jul 2025 14:12:55 GMT, Matthias Baesken wrote: > This is reported by the gcc static analyzer (-fanalyzer); it is just test > coding so not very critical but probably should still be adjusted . > > > /jdk/test/jdk/java/lang/String/nativeEncoding/libstringPlatformChars.c:74:12: > war

Integrated: 8361497: Scoped Values: orElse and orElseThrow do not access the cache

2025-07-21 Thread Andrew Haley
On Mon, 7 Jul 2025 16:13:08 GMT, Andrew Haley wrote: > Neither `ScopedValue.orElse` nor `ScopedValue.orElseThrow` consult the cache > when searching for a binding. Neither do they update the cache when a binding > is found. > While this issue does not affect spec compliance, it is surprising to

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-21 Thread Chen Liang
On Mon, 21 Jul 2025 16:05:59 GMT, simon wrote: > Maybe it can be reused in another points? ClassFileFormatVersion and Optional are more user-oriented classes; internal code don't really ever use these two types, so I don't think you need to extract this logic specifically. - PR R

Re: RFR: 8077587: BigInteger Roots [v28]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Discard wrong bits from the initial estimate - Changes: - all: https://git.openjdk.org/jdk/

Re: RFR: 8360037: Refactor ImageReader in preparation for Valhalla support [v12]

2025-07-21 Thread David Beaumont
On Fri, 18 Jul 2025 16:01:32 GMT, Roger Riggs wrote: >> David Beaumont has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains one commit: >> >> Resync after benchmark. > > src/java.base/share/classes/jdk/internal/jimage/ImageReader.jav

Re: RFR: 8360037: Refactor ImageReader in preparation for Valhalla support [v13]

2025-07-21 Thread David Beaumont
> Refactoring `ImageReader` to make it easy to add preview mode functionality > for Valhalla. > > This PR is a large change to `ImageReader` (effectively a rewrite) but > reduces the surface area of the API significantly, reduces code complexity > and increases performance/memory efficiency. Th

Re: RFR: 8077587: BigInteger Roots [v29]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Make sure to round up - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - ne

Integrated: 8357913: Add `@Stable` to BigInteger and BigDecimal

2025-07-21 Thread Shaojin Wen
On Sun, 25 May 2025 22:35:56 GMT, Shaojin Wen wrote: > Some static final arrays of BigInteger and BigDecimal are stable and > immutable. We should add `@Stable` to give the optimizer more information This pull request has now been integrated. Changeset: 8f1bb59e Author:Shaojin Wen URL:

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v8]

2025-07-21 Thread Volkan Yazici
On Thu, 17 Jul 2025 15:33:37 GMT, Raffaello Giulietti wrote: >> What is the thinking when an `@IntrinsicCandidate` method invokes another >> `@IntrinsicCandidate` method? >> Which part is responsible for the checks? >> >> For example, the Java code of `StringCoding.encodeISOArray0()` invokes

Re: RFR: 8077587: BigInteger Roots [v30]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Revert "Make sure to round up" This reverts commit e305c9f68914553421f2fdd8b4389eaf03946fea.

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v9]

2025-07-21 Thread Volkan Yazici
> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve > their documentation, enhance the checks in the associated IR or assembly > code, and adapt them to cause VM crash on invalid input. > > ## Implementation notes > > The goal of the associated umbrella issue > [JDK-8

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v3]

2025-07-21 Thread Volkan Yazici
On Wed, 16 Jul 2025 05:28:55 GMT, Tobias Hartmann wrote: >> Volkan Yazici has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 12 additional >> commi

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v8]

2025-07-21 Thread Volkan Yazici
On Thu, 17 Jul 2025 13:58:32 GMT, Raffaello Giulietti wrote: >> Volkan Yazici has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Replace casting with `as_Region()` in `generate_string_range_check` > > src/java.base/share/classes/java/lang/

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-21 Thread Mikhail Yankelevich
On Sun, 20 Jul 2025 22:19:07 GMT, simon wrote: > 8355652: add new method to return ClassFileFormatVersion from > ClassFileVersion. > - > ### Progress > - [ ] Change must be properly reviewed (1 review required, with at least 1 > [Reviewer](https://openjdk.org/bylaws#reviewer)) > - [x] C

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v8]

2025-07-21 Thread Volkan Yazici
On Thu, 17 Jul 2025 15:02:21 GMT, Yudi Zheng wrote: >> Volkan Yazici has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Replace casting with `as_Region()` in `generate_string_range_check` > > test/hotspot/jtreg/compiler/intrinsics/TestVerif

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v9]

2025-07-21 Thread Volkan Yazici
On Mon, 21 Jul 2025 12:33:30 GMT, Volkan Yazici wrote: >> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve >> their documentation, enhance the checks in the associated IR or assembly >> code, and adapt them to cause VM crash on invalid input. >> >> ## Implementation

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v9]

2025-07-21 Thread Volkan Yazici
On Mon, 21 Jul 2025 12:33:30 GMT, Volkan Yazici wrote: >> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve >> their documentation, enhance the checks in the associated IR or assembly >> code, and adapt them to cause VM crash on invalid input. >> >> ## Implementation

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v10]

2025-07-21 Thread Volkan Yazici
> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve > their documentation, enhance the checks in the associated IR or assembly > code, and adapt them to cause VM crash on invalid input. > > ## Implementation notes > > The goal of the associated umbrella issue > [JDK-8

Re: RFR: 8360037: Refactor ImageReader in preparation for Valhalla support [v13]

2025-07-21 Thread Alan Bateman
On Mon, 21 Jul 2025 12:03:11 GMT, David Beaumont wrote: >> Refactoring `ImageReader` to make it easy to add preview mode functionality >> for Valhalla. >> >> This PR is a large change to `ImageReader` (effectively a rewrite) but >> reduces the surface area of the API significantly, reduces cod

Re: RFR: 8360037: Refactor ImageReader in preparation for Valhalla support [v12]

2025-07-21 Thread David Beaumont
On Fri, 18 Jul 2025 16:43:30 GMT, Roger Riggs wrote: >> David Beaumont has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains one commit: >> >> Resync after benchmark. > > src/java.base/share/classes/jdk/internal/jimage/ImageReader.jav

RFR: 8362889: [GCC static analyzer] leak in libstringPlatformChars.c

2025-07-21 Thread Matthias Baesken
This is reported by the gcc static analyzer (-fanalyzer); it is just test coding so not very critical but probably should still be adjusted . /jdk/test/jdk/java/lang/String/nativeEncoding/libstringPlatformChars.c:74:12: warning: leak of 'str' [CWE-401] [-Wanalyzer-malloc-leak] 74 | return JN

Re: RFR: 8361842: Move input validation checks to Java for java.lang.StringCoding intrinsics [v11]

2025-07-21 Thread Volkan Yazici
> Validate input in `java.lang.StringCoding` intrinsic Java wrappers, improve > their documentation, enhance the checks in the associated IR or assembly > code, and adapt them to cause VM crash on invalid input. > > ## Implementation notes > > The goal of the associated umbrella issue > [JDK-8

Re: RFR: 8357913: Add `@Stable` to BigInteger and BigDecimal [v4]

2025-07-21 Thread Per Minborg
On Mon, 21 Jul 2025 06:54:46 GMT, Shaojin Wen wrote: > I will integrate it in 24 hours, @minberg do you have any other questions? No further comments from me. Please go ahead and integrate. - PR Comment: https://git.openjdk.org/jdk/pull/25437#issuecomment-3095820477

Re: RFR: 8360163: Replace hard-coded checks with AOTRuntimeSetup and AOTSafeClassInitializer [v11]

2025-07-21 Thread Jiangli Zhou
On Wed, 9 Jul 2025 13:25:22 GMT, Chen Liang wrote: >> I have updated this patch to avoid a redundant `runtimeSetup` annotation - >> we have agreed that the requirement for setup is a side effect of >> initialization, and such methods in AOTCI classes must be automatically >> recognized. This l

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-21 Thread Coleen Phillimore
On Wed, 2 Jul 2025 00:18:28 GMT, Ioi Lam wrote: > The CDS full module graph is supposed to contain a snapshot of the boot > layer, which has 3 unnamed modules for the boot, platform and system class > loaders. Each unnamed module is represented by a `java.lang.Module` Java > object and a `Modu

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-21 Thread Coleen Phillimore
On Thu, 17 Jul 2025 22:41:34 GMT, Ioi Lam wrote: >> If you're storing the unnamed module oop in the archive should this method >> not be called? If it is, what are you saving by archiving the unnamed >> module? > > The callstack is: > > > jdk.internal.loader.BootLoader.setBootLoaderUnnamedMo

Re: FFM - Optimizing string reads in MemorySegment

2025-07-21 Thread Liam Miller-Cushon
Thank you! I will follow along in the bug. On Mon, Jul 21, 2025 at 8:02 AM Per-Ake Minborg wrote: > Hi Liam! > > Thank you for your comments on MemorySegment::getString ! > > The intention was that the creation of the intermediate array should be > elided, but as you point out, that is (at least

Re: RFR: 8355652: Parse ClassFileFormatVersion from ClassFileVersion

2025-07-21 Thread simon
On Mon, 21 Jul 2025 02:50:48 GMT, Chen Liang wrote: >> Do you mean something like this? >> >> >> @Override >> public Optional formatVersion() { >> if (majorVersion < 54 || minorVersion != 0) { >> return Optional.empty(); >> } >> try { >> retu

Re: RFR: 8077587: BigInteger Roots [v31]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Added tests for nth root - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files -

Re: String.charAt vs StringBuilder.charAt performance

2025-07-21 Thread Roger Riggs
Hi Brett, I'd suggest separate initialization and test methods for the two cases to get more reliable numbers. By using @Trial and using a common field for the test data, I think you have handicapped C2. The training runs JMH does to warm up C2 are 'seeing' two different types for the value

Re: RFR: 8360555: Archive all unnamed modules in CDS full module graph

2025-07-21 Thread Ioi Lam
On Mon, 21 Jul 2025 17:51:34 GMT, Coleen Phillimore wrote: >> The callstack is: >> >> >> jdk.internal.loader.BootLoader.setBootLoaderUnnamedModule0(java.base@26-internal/Native >> Method) >> jdk.internal.loader.BootLoader.(java.base@26-internal/BootLoader.java:71) >> jdk.internal.module.Module

Re: String.charAt vs StringBuilder.charAt performance

2025-07-21 Thread Brett Okken
I am running Windows x64. Windows 11 Pro 24H2 Intel(R) Core(TM) i7-1370P On Mon, Jul 21, 2025 at 4:59 PM Chen Liang wrote: > I finally came around and ran the benchmark on my linux-x64 device; > however, I could not produce your results where String is significantly > slower than StringBuilder.

Re: RFR: 8360411: [TEST] open/test/jdk/java/io/File/MaxPathLength.java Refactor extract method to encapsulate Windows specific test logic

2025-07-21 Thread Mark Sheppard
On Tue, 8 Jul 2025 16:10:17 GMT, Darragh Conway wrote: > Refactored extract method to encapsulate Windows specific test logic Marked as reviewed by msheppar (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/26193#pullrequestreview-3040011489

RFR: 8355522: Remove the `java.locale.useOldISOCodes` system property

2025-07-21 Thread Naoto Sato
This PR removes the system property deprecated in JDK 25. If the property is specified at runtime, a warning will be emitted at startup to inform the user that the value is ignored. A corresponding CSR has been drafted as well - Commit messages: - initial commit Changes: https://g