Re: RFR: 8334714: Class-File API leaves preview [v2]

2024-08-23 Thread Matt
On Wed, 17 Jul 2024 08:59:07 GMT, Adam Sotona wrote: >> Class-File API is leaving preview. >> This is a removal of all `@PreviewFeature` annotations from Class-File API. >> It also bumps all `@since` tags and removes >> `jdk.internal.javac.PreviewFeature.Feature.CLASSFILE_API`. >> >> Please rev

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

2024-08-23 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: 8336289: Obliterate most references to _snprintf in the Windows JDK [v5]

2024-08-23 Thread Jaikiran Pai
On Sat, 24 Aug 2024 05:12:42 GMT, Julian Waters wrote: >> snprintf has been available for all officially and unofficially supported >> compilers for Windows, Visual Studio since version 2015 and gcc since, well, >> forever. snprintf is conforming to C99 since the start when compiling using >>

Re: RFR: 8336289: Obliterate most references to _snprintf in the Windows JDK [v4]

2024-08-23 Thread Julian Waters
On Sat, 24 Aug 2024 05:06:18 GMT, Julian Waters wrote: >> snprintf has been available for all officially and unofficially supported >> compilers for Windows, Visual Studio since version 2015 and gcc since, well, >> forever. snprintf is conforming to C99 since the start when compiling using >>

Re: RFR: 8336289: Obliterate most references to _snprintf in the Windows JDK [v5]

2024-08-23 Thread Julian Waters
> snprintf has been available for all officially and unofficially supported > compilers for Windows, Visual Studio since version 2015 and gcc since, well, > forever. snprintf is conforming to C99 since the start when compiling using > gcc, and 2015 when using Visual Studio. Since it conforms to

Re: RFR: 8334714: Class-File API leaves preview [v2]

2024-08-23 Thread xxDark
On Sat, 24 Aug 2024 04:56:34 GMT, Chen Liang wrote: > > Indeed, it would be a good RFE to allow users to override default attribute > mappers to parse attributes; this would be extremely useful if users wish to > support previous previews that only differed in the attribute formats. > I don't

Re: RFR: 8336289: Obliterate most references to _snprintf in the Windows JDK [v4]

2024-08-23 Thread Julian Waters
> snprintf has been available for all officially and unofficially supported > compilers for Windows, Visual Studio since version 2015 and gcc since, well, > forever. snprintf is conforming to C99 since the start when compiling using > gcc, and 2015 when using Visual Studio. Since it conforms to

Re: RFR: 8334714: Class-File API leaves preview [v2]

2024-08-23 Thread Chen Liang
On Wed, 17 Jul 2024 08:59:07 GMT, Adam Sotona wrote: >> Class-File API is leaving preview. >> This is a removal of all `@PreviewFeature` annotations from Class-File API. >> It also bumps all `@since` tags and removes >> `jdk.internal.javac.PreviewFeature.Feature.CLASSFILE_API`. >> >> Please rev

Re: RFR: 8336289: Obliterate most references to _snprintf in the Windows JDK [v3]

2024-08-23 Thread Julian Waters
On Tue, 16 Jul 2024 08:59:20 GMT, Julian Waters wrote: >> snprintf has been available for all officially and unofficially supported >> compilers for Windows, Visual Studio since version 2015 and gcc since, well, >> forever. snprintf is conforming to C99 since the start when compiling using >>

Re: RFR: 8334714: Class-File API leaves preview [v2]

2024-08-23 Thread xxDark
On Sat, 24 Aug 2024 03:45:03 GMT, Chen Liang wrote: > While your account of oak format seems interesting (from a search, it seems > to use u1 for max stacks/locals, u2 for Code size), it is neither recognized > by hotspot (the reference implementation for JVM): > > https://github.com/openjdk/j

Re: RFR: 8334714: Class-File API leaves preview [v2]

2024-08-23 Thread Chen Liang
On Sat, 24 Aug 2024 03:05:14 GMT, xxDark wrote: > Classfiles with oak format seem to be unparsable. They also cannot be > written. (maxStack/maxLocals in Code attribute depend on classfile version). > Constants such as `JAVA_1_VERSION` exist in `java.lang.classfile.ClassFile`. Unfortunately, C

Re: RFR: 8334714: Class-File API leaves preview [v2]

2024-08-23 Thread xxDark
On Wed, 17 Jul 2024 08:59:07 GMT, Adam Sotona wrote: >> Class-File API is leaving preview. >> This is a removal of all `@PreviewFeature` annotations from Class-File API. >> It also bumps all `@since` tags and removes >> `jdk.internal.javac.PreviewFeature.Feature.CLASSFILE_API`. >> >> Please rev

Re: RFR: 8338021: Support saturating vector operators in VectorAPI [v4]

2024-08-23 Thread Sandhya Viswanathan
On Mon, 19 Aug 2024 07:19:30 GMT, Jatin Bhateja wrote: >> Hi All, >> >> As per the discussion on panama-dev mailing list[1], patch adds the support >> following new vector operators. >> >> >> . SUADD : Saturating unsigned addition. >> . SADD: Saturating signed addition. >>

Re: RFR: 8338023: Support two vector selectFrom API [v5]

2024-08-23 Thread Paul Sandoz
On Fri, 23 Aug 2024 06:09:48 GMT, Jatin Bhateja wrote: >> Hi All, >> >> As per the discussion on panama-dev mailing list[1], patch adds the support >> for following new two vector permutation APIs. >> >> >> Declaration:- >> Vector.selectFrom(Vector v1, Vector v2) >> >> >> Semantics:- >>

Re: RFR: 8338690: CompactNumberInstance.format incorrectly formats some numbers (few vs many)

2024-08-23 Thread Naoto Sato
On Fri, 23 Aug 2024 19:01:11 GMT, Roger Riggs wrote: >> src/java.base/share/classes/java/text/CompactNumberFormat.java line 905: >> >>> 903: divisor = divisors.get(++compactDataIndex); >>> 904: } >>> 905: var noFraction = number.mod(new >>> BigInteger(div

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace [v2]

2024-08-23 Thread Coleen Phillimore
On Fri, 23 Aug 2024 06:43:24 GMT, Thomas Stuefe wrote: >> Coleen Phillimore has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Incorporated a set of Thomas Stuefe's comments. Take out AbstractClass >> MetaspaceObj::Type. > > src/hotspot/sh

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace [v2]

2024-08-23 Thread Coleen Phillimore
On Fri, 23 Aug 2024 20:43:52 GMT, Coleen Phillimore wrote: >> This change stores InstanceKlass for interface and abstract classes in the >> non-class metaspace, since class metaspace will have limits on number of >> classes that can be represented when Lilliput changes go in. Classes that >>

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace [v2]

2024-08-23 Thread Coleen Phillimore
On Fri, 23 Aug 2024 20:37:55 GMT, Coleen Phillimore wrote: >> src/hotspot/share/oops/klass.hpp line 214: >> >>> 212: virtual bool is_klass() const { return true; } >>> 213: >>> 214: bool is_in_klass_space() const { return !is_interface() && >>> !is_abstract(); } >> >> This name is mislead

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace [v2]

2024-08-23 Thread Coleen Phillimore
> This change stores InstanceKlass for interface and abstract classes in the > non-class metaspace, since class metaspace will have limits on number of > classes that can be represented when Lilliput changes go in. Classes that > have no instances created for them don't require compressed class

Re: RFR: 8336843: Deprecate java.util.zip.ZipError for removal

2024-08-23 Thread Lance Andersen
On Tue, 20 Aug 2024 10:24:25 GMT, Eirik Bjørsnøs wrote: > Please review this PR which suggests to deprecate the unused class > `java.util.zip.ZipError` for removal. > > The class has been unsed by OpenJDK since the ZIP API was rewritten from > native to Java in JDK 9. > > I opted to not expl

Re: RFR: 8336843: Deprecate java.util.zip.ZipError for removal

2024-08-23 Thread Chen Liang
On Tue, 20 Aug 2024 10:24:25 GMT, Eirik Bjørsnøs wrote: > Please review this PR which suggests to deprecate the unused class > `java.util.zip.ZipError` for removal. > > The class has been unsed by OpenJDK since the ZIP API was rewritten from > native to Java in JDK 9. > > I opted to not expl

Re: RFR: 8336843: Deprecate java.util.zip.ZipError for removal

2024-08-23 Thread ExE Boss
On Tue, 20 Aug 2024 10:24:25 GMT, Eirik Bjørsnøs wrote: > Please review this PR which suggests to deprecate the unused class > `java.util.zip.ZipError` for removal. > > The class has been unsed by OpenJDK since the ZIP API was rewritten from > native to Java in JDK 9. > > I opted to not expl

RFR: 8338882: Clarify matching order of MessageFormat subformat factory styles

2024-08-23 Thread Justin Lu
Please review this PR which clarifies that the matching order of format styles for MessageFormat sub formats is not guaranteed by the JDK implementation. A corresponding CSR has also been drafted. This is relevant when a locale provides equivalent patterns for multiple format factory styles. Fo

Re: RFR: 8313205: Modernize java.text.Format with StringBuilder [v3]

2024-08-23 Thread Justin Lu
> Please review this PR which adds public StringBuilder overloads to the > formatting methods of java.text.Format and implementing subclasses. > > While Format, NumberFormat, and DateFormat are abstract, these new methods > are not added as abstract to prevent compatibility concerns. Instead the

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace

2024-08-23 Thread Coleen Phillimore
On Thu, 9 May 2024 13:51:09 GMT, Coleen Phillimore wrote: > This change stores InstanceKlass for interface and abstract classes in the > non-class metaspace, since class metaspace will have limits on number of > classes that can be represented when Lilliput changes go in. Classes that > have

Re: RFR: 8338690: CompactNumberInstance.format incorrectly formats some numbers (few vs many)

2024-08-23 Thread Justin Lu
On Thu, 22 Aug 2024 16:14:08 GMT, Naoto Sato wrote: > Fixing an issue wrt wrong plural suffix with compact format for some locales. > It was retrieving the suffix based on the value before the rounding, which > ended up in wrong plural expression. Makes sense to defer the affix matching until

Re: RFR: 8336843: Deprecate java.util.zip.ZipError for removal

2024-08-23 Thread Lance Andersen
On Tue, 20 Aug 2024 10:24:25 GMT, Eirik Bjørsnøs wrote: > Please review this PR which suggests to deprecate the unused class > `java.util.zip.ZipError` for removal. > > The class has been unsed by OpenJDK since the ZIP API was rewritten from > native to Java in JDK 9. > > I opted to not expl

Re: RFR: 8338690: CompactNumberInstance.format incorrectly formats some numbers (few vs many)

2024-08-23 Thread Roger Riggs
On Fri, 23 Aug 2024 17:54:55 GMT, Roger Riggs wrote: >> Fixing an issue wrt wrong plural suffix with compact format for some >> locales. It was retrieving the suffix based on the value before the >> rounding, which ended up in wrong plural expression. > > src/java.base/share/classes/java/text/C

Re: RFR: 8338690: CompactNumberInstance.format incorrectly formats some numbers (few vs many)

2024-08-23 Thread Roger Riggs
On Thu, 22 Aug 2024 16:14:08 GMT, Naoto Sato wrote: > Fixing an issue wrt wrong plural suffix with compact format for some locales. > It was retrieving the suffix based on the value before the rounding, which > ended up in wrong plural expression. lgtm - Marked as reviewed by rri

Re: RFR: 8338690: CompactNumberInstance.format incorrectly formats some numbers (few vs many)

2024-08-23 Thread Roger Riggs
On Thu, 22 Aug 2024 16:14:08 GMT, Naoto Sato wrote: > Fixing an issue wrt wrong plural suffix with compact format for some locales. > It was retrieving the suffix based on the value before the rounding, which > ended up in wrong plural expression. src/java.base/share/classes/java/text/CompactN

Re: RFR: 8338690: CompactNumberInstance.format incorrectly formats some numbers (few vs many)

2024-08-23 Thread Joe Wang
On Thu, 22 Aug 2024 16:14:08 GMT, Naoto Sato wrote: > Fixing an issue wrt wrong plural suffix with compact format for some locales. > It was retrieving the suffix based on the value before the rounding, which > ended up in wrong plural expression. Marked as reviewed by joehw (Reviewer). -

Integrated: 8338700: AttributeMapper type parameter should be bounded by Attribute

2024-08-23 Thread Chen Liang
On Wed, 21 Aug 2024 23:20:38 GMT, Chen Liang wrote: > A minor oversight in AttributeMapper type parameter bounds, that it should be > bounded by Attribute. Only real impact is in BoundAttribute.readAttributes > where a cast is now omitted, as other sites of access like > Attribute::attributeMa

Re: RFR: 8338526: Don't store abstract and interface Klasses in class metaspace

2024-08-23 Thread Thomas Stuefe
On Thu, 9 May 2024 13:51:09 GMT, Coleen Phillimore wrote: > This change stores InstanceKlass for interface and abstract classes in the > non-class metaspace, since class metaspace will have limits on number of > classes that can be represented when Lilliput changes go in. Classes that > have

RFR: 8336843: Deprecate java.util.zip.ZipError for removal

2024-08-23 Thread Eirik Bjørsnøs
Please review this PR which suggests to deprecate the unused class `java.util.zip.ZipError` for removal. The class has been unsed by OpenJDK since the ZIP API was rewritten from native to Java in JDK 9. I opted to not explain the reason for the deprecation in detail, but instead simply point

Re: RFR: 8338731: MemoryLayout::offsetHandle can return a negative offset

2024-08-23 Thread Chen Liang
On Wed, 21 Aug 2024 13:26:58 GMT, Maurizio Cimadamore wrote: > When working on startup improvements, I noticed that the method handle > returned by `MemoryLayout::offsetHandle` can overflow if the client calls the > handle with a base offset that is too big. > > In other similar situations, t

Re: RFR: 8338731: MemoryLayout::offsetHandle can return a negative offset

2024-08-23 Thread Per Minborg
On Wed, 21 Aug 2024 13:26:58 GMT, Maurizio Cimadamore wrote: > When working on startup improvements, I noticed that the method handle > returned by `MemoryLayout::offsetHandle` can overflow if the client calls the > handle with a base offset that is too big. > > In other similar situations, t

RFR: 8338729: Retire the test jdk/java/util/zip/TestZipError.java

2024-08-23 Thread Eirik Bjørsnøs
Please review this test-only, cleanup PR which proposes that we retire the `jdk/java/util/zip/TestZipError.java` test. The test has fallen out of sync with its original and stated purpose described by its name, `@summary` tag and code comments. The error condition actually being exercised has e

Re: RFR: 8338728: Misc issues in memory layout javadoc [v2]

2024-08-23 Thread Per Minborg
On Wed, 21 Aug 2024 13:24:15 GMT, Maurizio Cimadamore wrote: >> This PR fixes two minor issues in the `MemoryLayout` javadoc: >> * the section describing dereference path talks about `P` and `P'` but then >> only uses `P` in the code; >> * the `ceilDiv` math on the `PathElement::sequenceElement

Re: RFR: 8338906: Avoid passing EnumDescs and extra classes to type switch methods that don't use them

2024-08-23 Thread Chen Liang
On Fri, 23 Aug 2024 12:34:17 GMT, Claes Redestad wrote: > This PR refactors SwitchBootstraps so that extra EnumDescs and classes are > only passed into bootstraps when needed. Benchmarking shows that in many > cases these are not needed, and avoiding passing them (via binding in the > lists vi

RFR: 8338906: Avoid passing EnumDescs and extra classes to type switch methods that don't use them

2024-08-23 Thread Claes Redestad
This PR refactors SwitchBootstraps so that extra EnumDescs and classes are only passed into bootstraps when needed. Benchmarking shows that in many cases these are not needed, and avoiding passing them (via binding in the lists via `MethodHandle::insertArguments`) avoids some auxiliary MH combin

RFR: 8338445: jdk.internal.loader.URLClassPath may leak JarFile instance when dealing with unexpected Class-Path entry in manifest

2024-08-23 Thread Jaikiran Pai
Can I please get a review of this change which proposes to fix the issue noted in https://bugs.openjdk.org/browse/JDK-8338445? The JDK internal class `jdk.internal.loader.URLClassPath` is used by classloader implementations in the JDK (for example by the `java.net.URLClassLoader` and the `jdk.

Re: RFR: 8338768: Introduce runtime lookup to check for static builds [v2]

2024-08-23 Thread Magnus Ihse Bursie
On Thu, 22 Aug 2024 22:49:50 GMT, David Holmes wrote: > is the final intent here that this one magic file will be compiled first with > an inline declaration such that when the other files containing the apparent > runtime check get compiled, it can actually be determined at build time and > s

Integrated: 8338417: Explicitly pin a virtual thread before acquiring the JFR string pool monitor

2024-08-23 Thread Markus Grönlund
On Wed, 14 Aug 2024 20:53:33 GMT, Markus Grönlund wrote: > Greetings, > > Explicitly pin a virtual thread before acquiring the JFR string pool monitor > because migrating a carrier thread local event writer object onto another > carrier thread is impossible. > > During event commit, the threa

Integrated: 8338745: Intrinsify Continuation.pin() and Continuation.unpin()

2024-08-23 Thread Markus Grönlund
On Wed, 21 Aug 2024 20:11:05 GMT, Markus Grönlund wrote: > Greetings, > > Please help review this change set that implements C2 intrinsics for > jdk.internal.vm.Continuation.pin() and jdk.internal.vm.Continuation.unpin(). > > This work is a consequence of > [JDK-8338417](https://bugs.openjdk.

Re: RFR: 8338745: Intrinsify Continuation.pin() and Continuation.unpin() [v3]

2024-08-23 Thread Markus Grönlund
On Thu, 22 Aug 2024 15:51:49 GMT, Vladimir Kozlov wrote: >> Markus Grönlund has updated the pull request incrementally with one >> additional commit since the last revision: >> >> JVMCI exportation > > Marked as reviewed by kvn (Reviewer). Thank you for your reviews and comments, @vnkozlov,

Re: RFR: 8338417: Explicitly pin a virtual thread before acquiring the JFR string pool monitor [v5]

2024-08-23 Thread Markus Grönlund
On Fri, 23 Aug 2024 07:35:05 GMT, Alan Bateman wrote: >> Markus Grönlund has updated the pull request incrementally with five >> additional commits since the last revision: >> >> - pin state conditional delivered using event writer object >> - Merge branch '8338417' of github.com:mgronlun/jdk

Re: RFR: 8331671: Implement JEP 472: Prepare to Restrict the Use of JNI [v10]

2024-08-23 Thread Maurizio Cimadamore
> This PR implements [JEP 472](https://openjdk.org/jeps/472), by restricting > the use of JNI in the following ways: > > * `System::load` and `System::loadLibrary` are now restricted methods > * `Runtime::load` and `Runtime::loadLibrary` are now restricted methods > * binding a JNI `native` metho

Re: RFR: 8338417: Explicitly pin a virtual thread before acquiring the JFR string pool monitor [v5]

2024-08-23 Thread Alan Bateman
On Wed, 21 Aug 2024 18:26:20 GMT, Markus Grönlund wrote: >> Greetings, >> >> Explicitly pin a virtual thread before acquiring the JFR string pool monitor >> because migrating a carrier thread local event writer object onto another >> carrier thread is impossible. >> >> During event commit, th