Re: RFR: 8304914: Use OperatingSystem, Architecture, and Version in jpackage

2023-05-04 Thread Andrey Turbanov
On Fri, 21 Apr 2023 17:28:54 GMT, Roger Riggs wrote: > Refactor the Platform class in jdk.jpackage to use the internal > OperatingSystem, Architecture, and Version classes. > The OperatingSystem.isXXX() and Architecture.isYYY() methods replace > comparisons in the Platform class. > The checks o

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v9]

2023-05-04 Thread Jan Lahoda
> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: > > - the pattern matching for switch and record patterns features are made > final, together with updates to tests. > - parenthesized patterns are removed. > - qualified enum constants are supported for case label

Re: RFR: 8306927: Collator treats "v" and "w" as the same letter for Swedish language locale.

2023-05-04 Thread Alan Bateman
On Thu, 27 Apr 2023 12:32:19 GMT, Naoto Sato wrote: >> The rule was changed in 2006, the year Jave SE 6 was released. Though it >> looks like very much a corner case, it goes all the way back. I wonder if a >> CSR is needed? > >> The rule was changed in 2006, the year Jave SE 6 was released. Th

RFR: 8291065: Creating a VarHandle for a static field triggers class initialization

2023-05-04 Thread Chen Liang
Also fixed the bug with NPE in `IndirectVarHandle::isAccessModeSupported`. A few implementation-detail methods in VarHandle are now documented with the implied constraints to avoid subtle problems in the future. Changed `IndirectVarHandle` to call `asDirect` lazily to accomodate the lazy VarHand

Re: The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread Ethan McCue
For those who are tracking but didn't click through to find it, here was the writeup of the compatibility analysis for sequenced collections as of 9/20/22. https://bugs.openjdk.org/secure/attachment/100811/compatibility-20220920.html Bug page: https://bugs.openjdk.org/browse/JDK-8266572 On F

Re: The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread Joseph D. Darcy
PS And as a general policy, over the releases we've done more to preserve source compatibility when possible for language changes. For example, there were many source compatibility breakages when "assert" was added as a keyword back in JDK 1.4; the current keyword management policies (https://

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v11]

2023-05-04 Thread Chen Liang
On Thu, 4 May 2023 16:19:04 GMT, Adam Sotona wrote: >> Classfile API didn't handle transformations of class files version 50 and >> below correctly. >> >> Proposed fix have two parts: >> 1. Inflation of branch targets does not depend on StackMapTable attribute >> presence for class file vers

Re: The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread -
In addition, in the CSR of sequenced collection, it already anticipated some other form of source incompatibility: If a class implements List and Deque at the same time, the return type of reversed() must extend both interfaces as well. This alone would be a greater source incompatibility than thi

Re: The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread Joseph D. Darcy
A few comments on the general compatibility policy for the JDK. Compatibility is looked after by the Compatibility and Specification Review (CSR) process ( Compatibility & Specification Review). Summarizing the approach, The general compatibility policy for exported APIs implemented in the JD

Re: [External] : The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread Alan Snyder
This is an interesting issue, and it raises the question of how such issues are resolved. My impression is that historically source code compatibility was given a high weight. Is that not the case now? Although the example may be carefully constructed, my understanding is that the problem surf

RFR: 8307149: MethodHandles.arrayConstructor can be cached

2023-05-04 Thread Chen Liang
This patch migrates `MethodHandles::arrayConstructor`, added in Java 9 as a hotfix to the incorrect constructor found on arrays via Lookup, to share the array access caching features. The result is that calling `MethodHandles.arrayConstructor` to create method handles is much faster. Oracle JDK

Re: [External] : The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread Stuart Marks
The introduction of Sequenced Collections in JDK 21+20 did make a difference in this specific case. One can compile Rémi's example on JDK 21+19 successfully, but it will fail on JDK 21+20. Here's Rémi's example:     public static void m(List>> factories) {     }     public static void main(S

Re: RFR: 8284493: Improve computeNextExponential tail performance and accuracy [v19]

2023-05-04 Thread Chris Hennick
On Thu, 6 Apr 2023 18:07:29 GMT, Chris Hennick wrote: >> This PR improves both the worst-case performance of `nextExponential` and >> `nextGaussian` and the distribution of output at the tails. It fixes the >> following imperfections: >> >> * Repeatedly adding DoubleZigguratTables.exponentialX

Integrated: 8307489: ProblemList jdk/incubator/vector/LoadJsvmlTest.java on windows-x64

2023-05-04 Thread Daniel D . Daugherty
On Thu, 4 May 2023 20:49:26 GMT, Daniel D. Daugherty wrote: > Trivial fixes to ProblemList a few tests: > - [JDK-8307489](https://bugs.openjdk.org/browse/JDK-8307489) ProblemList > jdk/incubator/vector/LoadJsvmlTest.java on windows-x64 > - [JDK-8307490](https://bugs.openjdk.org/browse/JDK-830749

Re: RFR: 8307489: ProblemList jdk/incubator/vector/LoadJsvmlTest.java on windows-x64

2023-05-04 Thread Daniel D . Daugherty
On Thu, 4 May 2023 21:21:38 GMT, Joe Darcy wrote: >> Trivial fixes to ProblemList a few tests: >> - [JDK-8307489](https://bugs.openjdk.org/browse/JDK-8307489) ProblemList >> jdk/incubator/vector/LoadJsvmlTest.java on windows-x64 >> - [JDK-8307490](https://bugs.openjdk.org/browse/JDK-8307490) Pro

Re: RFR: 8307489: ProblemList jdk/incubator/vector/LoadJsvmlTest.java on windows-x64

2023-05-04 Thread Joe Darcy
On Thu, 4 May 2023 20:49:26 GMT, Daniel D. Daugherty wrote: > Trivial fixes to ProblemList a few tests: > - [JDK-8307489](https://bugs.openjdk.org/browse/JDK-8307489) ProblemList > jdk/incubator/vector/LoadJsvmlTest.java on windows-x64 > - [JDK-8307490](https://bugs.openjdk.org/browse/JDK-830749

RFR: 8307489: ProblemList jdk/incubator/vector/LoadJsvmlTest.java on windows-x64

2023-05-04 Thread Daniel D . Daugherty
Trivial fixes to ProblemList a few tests: - [JDK-8307489](https://bugs.openjdk.org/browse/JDK-8307489) ProblemList jdk/incubator/vector/LoadJsvmlTest.java on windows-x64 - [JDK-8307490](https://bugs.openjdk.org/browse/JDK-8307490) ProblemList sun/security/pkcs11/Cipher/TestKATForGCM.java on linux

Re: RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v8]

2023-05-04 Thread Jim Laskey
I suppose that’s a possibility. But is it more informative to have the class print with the synthetic flag? 📱 > On May 4, 2023, at 5:54 PM, Maurizio Cimadamore > wrote: > > On Mon, 1 May 2023 13:06:24 GMT, Jim Laskey wrote: > >>> Add flexible main methods and anonymous main classes to the

Re: RFR: JDK-8306112 Implementation of JEP 445: Unnamed Classes and Instance Main Methods (Preview) [v8]

2023-05-04 Thread Maurizio Cimadamore
On Mon, 1 May 2023 13:06:24 GMT, Jim Laskey wrote: >> Add flexible main methods and anonymous main classes to the Java language. > > Jim Laskey has updated the pull request incrementally with two additional > commits since the last revision: > > - Anonymous main classes renamed to unnamed clas

Re: RFR: 8304913: Use OperatingSystem, Architecture, and Version in jlink [v2]

2023-05-04 Thread Roger Riggs
> Refactor the Platform class of jlink to use jdk.internal.util OperatingSystem > and Architecture instead of os.name and os.arch. > They are direct replacements for the Platform enums except for UNKNOWN; its > use is refactored to report errors via exceptions. > > Neither os.name nor os.arch s

RFR: 8307483: New micros for j.u.c.LockSupport

2023-05-04 Thread Eric Caspole
These micros were developed while investigating JDK-8305670 by myself and Sergey Kuksenko. The order of thread creation was important in that bug, so there are 2 JMH for creating sleepers before and after the worker threads. - Commit messages: - 8307483: New micros for j.u.c.LockSu

Re: RFR: 8307194: Enhance static-libs-image [v5]

2023-05-04 Thread Jiangli Zhou
On Thu, 4 May 2023 19:12:14 GMT, Severin Gehwolf wrote: >> As @jerboaa mentioned, for GraalVM native-image we produce our own >> `libjvm.a` as part of building GraalVM (every native image gets statically >> linked to that library). See >> https://github.com/oracle/graal/blob/f1c1d710625ac84559

Re: RFR: 8307194: Enhance static-libs-image [v5]

2023-05-04 Thread Jiangli Zhou
On Thu, 4 May 2023 19:12:14 GMT, Severin Gehwolf wrote: >> As @jerboaa mentioned, for GraalVM native-image we produce our own >> `libjvm.a` as part of building GraalVM (every native image gets statically >> linked to that library). See >> https://github.com/oracle/graal/blob/f1c1d710625ac84559

Re: RFR: 8307194: Enhance static-libs-image [v5]

2023-05-04 Thread Severin Gehwolf
On Thu, 4 May 2023 09:40:31 GMT, Paul Woegerer wrote: >> GraalVM native-image has it's own `libjvm.a` shim which would likely >> conflict or produce undesirable results. So I'd prefer the approach where >> `static-libs-image` wouldn't produce hotspot `libjvm.a` as part of it. For >> new uses-c

Re: RFR: 8159337: Introduce a method in Locale class to return the language tags as per RFC 5646 convention [v6]

2023-05-04 Thread Roger Riggs
On Wed, 3 May 2023 20:32:25 GMT, Justin Lu wrote: >> Please review this PR which adds the method `caseFoldLanguageTag(String >> languageTag)` to java.util.Locale. >> >> This method case folds a language tag to adhere to _[section 2.1.1. >> Formatting of Language Tags of >> RFC5646](https://ww

Re: RFR: 8159337: Introduce a method in Locale class to return the language tags as per RFC 5646 convention [v6]

2023-05-04 Thread Naoto Sato
On Wed, 3 May 2023 20:32:25 GMT, Justin Lu wrote: >> Please review this PR which adds the method `caseFoldLanguageTag(String >> languageTag)` to java.util.Locale. >> >> This method case folds a language tag to adhere to _[section 2.1.1. >> Formatting of Language Tags of >> RFC5646](https://ww

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v11]

2023-05-04 Thread Adam Sotona
> Classfile API didn't handle transformations of class files version 50 and > below correctly. > > Proposed fix have two parts: > 1. Inflation of branch targets does not depend on StackMapTable attribute > presence for class file version 50 and below. Alternative fallback > implementation is

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v10]

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 15:19:02 GMT, Chen Liang wrote: > Also, has brian reviewed the DiscontinuedInstruction API changes? https://mail.openjdk.org/pipermail/classfile-api-dev/2023-April/000292.html - PR Comment: https://git.openjdk.org/jdk/pull/13478#issuecomment-1535028314

RFR: 8307307: Improve ProcessTools.java to don't try to run Virtual wrapper for incompatible processes

2023-05-04 Thread Leonid Mesnik
The ProcessTools has some support of jtreg thread factory functionality. It tries to run the new process using virtual thread to run `main()` method. This fix updates it to skip the java runs where no main class is involved and more correctly process options which has 2nd argument. Also is sets `m

Re: Time difference calculation bug

2023-05-04 Thread Roger Riggs
Hi, I created a Jira issue: 8307466 java.time.Instant Time difference calculation bug The root cause of the bug is in the cod that manages the representation of Instant as seconds and nanoseconds. The borrow/carry logic between the seconds and nan

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v10]

2023-05-04 Thread Chen Liang
On Tue, 2 May 2023 14:15:27 GMT, Adam Sotona wrote: >> Classfile API didn't handle transformations of class files version 50 and >> below correctly. >> >> Proposed fix have two parts: >> 1. Inflation of branch targets does not depend on StackMapTable attribute >> presence for class file vers

Re: RFR: 8307375: Alignment check on layouts used as sequence element is not correct [v2]

2023-05-04 Thread Maurizio Cimadamore
> This patch fixes `Utils::checkElementAlignment` to do the right thing for > _all_ layouts. > > The current implementation is broken, as it only works correctly when the > input layout is a value layout. > Since value layouts have a size that is a power of two (and size all layouts > have alig

Re: The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread Ethan McCue
I guess this a good time to ask, ignoring the benefit part of a cost benefit analysis, what mechanisms do we have to measure the number of codebases relying on type inference this will break? Iirc Adoptium built/ran the unit tests of a bunch of public repos, but it's also a bit shocking if the jtr

Re: The introduction of Sequenced collections is not a source compatible change

2023-05-04 Thread Raffaello Giulietti
Without changing the semantics at all, you could also write final List> list = Stream.>of(nestedDequeue, nestedList).toList(); to "help" type inference. On 2023-05-03 15:12, fo...@univ-mlv.fr wrote: Another example sent to me by a fellow French guy, final Deque nestedDequeue = new

Integrated: 8304937: BufferedFieldBuilder.Model missing writeTo(DirectClassBuilder)

2023-05-04 Thread Chen Liang
On Sun, 26 Mar 2023 20:35:20 GMT, Chen Liang wrote: > Please review this simple patch to Classfile API that fixes a missing > override that otherwise affects usage of chained class transforms. A test is > included, that it fails on the missing method without this patch. > > Please review a few

Re: RFR: 8307375: Alignment check on layouts used as sequence element is not correct

2023-05-04 Thread Jorn Vernee
On Wed, 3 May 2023 17:44:55 GMT, Maurizio Cimadamore wrote: > This patch fixes `Utils::checkElementAlignment` to do the right thing for > _all_ layouts. > > The current implementation is broken, as it only works correctly when the > input layout is a value layout. > Since value layouts have a

Re: RFR: 8301569: list mode of jmod and jimage cannot be used normally in turkish locale

2023-05-04 Thread Jaikiran Pai
On Sun, 29 Jan 2023 23:54:21 GMT, Glavo wrote: >> When the default Locale is `tr`, the jmod and jimage commands have the >> following problems: >> >> * The jmod command does not correctly recognize the `list` mode typed in >> lowercase; >> * The jimage command cannot obtain the help informatio

Re: RFR: 8304913: Use OperatingSystem, Architecture, and Version in jlink

2023-05-04 Thread Jaikiran Pai
On Fri, 21 Apr 2023 17:06:44 GMT, Roger Riggs wrote: > Refactor the Platform class of jlink to use jdk.internal.util OperatingSystem > and Architecture instead of os.name and os.arch. > They are direct replacements for the Platform enums except for UNKNOWN; its > use is refactored to report er

Re: RFR: 8304913: Use OperatingSystem, Architecture, and Version in jlink

2023-05-04 Thread Jaikiran Pai
On Fri, 21 Apr 2023 17:06:44 GMT, Roger Riggs wrote: > Refactor the Platform class of jlink to use jdk.internal.util OperatingSystem > and Architecture instead of os.name and os.arch. > They are direct replacements for the Platform enums except for UNKNOWN; its > use is refactored to report er

Re: RFR: 8304913: Use OperatingSystem, Architecture, and Version in jlink

2023-05-04 Thread Jaikiran Pai
On Thu, 4 May 2023 12:27:26 GMT, Jaikiran Pai wrote: >> Refactor the Platform class of jlink to use jdk.internal.util >> OperatingSystem and Architecture instead of os.name and os.arch. >> They are direct replacements for the Platform enums except for UNKNOWN; its >> use is refactored to repor

Re: RFR: 8304937: BufferedFieldBuilder.Model missing writeTo(DirectClassBuilder)

2023-05-04 Thread Adam Sotona
On Sun, 26 Mar 2023 20:35:20 GMT, Chen Liang wrote: > Please review this simple patch to Classfile API that fixes a missing > override that otherwise affects usage of chained class transforms. A test is > included, that it fails on the missing method without this patch. > > Please review a few

Re: RFR: 8307194: Enhance static-libs-image [v5]

2023-05-04 Thread Paul Woegerer
On Wed, 3 May 2023 18:51:54 GMT, Severin Gehwolf wrote: >>> Could we decouple `hotspot-static-libs` from `static-libs-image` somehow, >>> please? `static-libs-image` is used by the `graal-builder-image` target and >>> it would be good if it didn't include hotspot static libs as they are not >>

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array [v2]

2023-05-04 Thread David Holmes
On Thu, 4 May 2023 07:19:39 GMT, Adam Sotona wrote: >> src/java.base/share/native/libjli/java.c line 1212: >> >>> 1210: *pret = 0; >>> 1211: >>> 1212: while (argc > 0 && *(arg = *argv) == '-') { >> >> AFAICS this loop terminates at line 1388 and nowhere in the loop body does >> argc g

Integrated: 8307181: MemoryLayout.structLayout uses undocumented strict alignment constraints

2023-05-04 Thread Maurizio Cimadamore
On Wed, 3 May 2023 08:31:34 GMT, Maurizio Cimadamore wrote: > This patch adds documentation for the behavior of the > `MemoryLayout::structLayout` factory. > > This factory throws an `IllegalArgumentException` if one of the member > layouts passed to it occurs at an offset within the struct t

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 06:47:50 GMT, Alan Bateman wrote: > Also are you planning to add a test for this? I've added code to `exeJliLaunchTest.c` (executed by `JliLaunchTest`) to test non null terminated arguments. - PR Comment: https://git.openjdk.org/jdk/pull/13775#issuecomment-15343

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array [v2]

2023-05-04 Thread Adam Sotona
> libjli/java.c's SelectVersion method receives argc and argv but ignores argc > in some circumstances an instead checks if *argv == 0 in its while loop, > which results in a segmentation fault if the provided array is not NULL > terminated. > > This patch counts down argc in the while loops i

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 06:26:53 GMT, David Holmes wrote: >> libjli/java.c's SelectVersion method receives argc and argv but ignores argc >> in some circumstances an instead checks if *argv == 0 in its while loop, >> which results in a segmentation fault if the provided array is not NULL >> termina