Re: RFR: 8335939: Hide element writing across the ClassFile API [v5]

2024-07-22 Thread Chen Liang
> `WritableElement` has always been one of the biggest peculiarities of > ClassFile API: it exposes element writing yet has no corresponding reading > ability exposed. Its existence creates a lot of API noise, increasing > maintenance cost in the long run. (This is an iceberg whose tip was expos

Re: RFR: 8204582: Extra spaces in jlink documentation make it incorrect.

2024-07-22 Thread Alan Bateman
On Tue, 23 Jul 2024 04:55:16 GMT, Athijegannathan Sundararajan wrote: > removed extra whitespaces Are you going to update --limit-modules too? - PR Comment: https://git.openjdk.org/jdk/pull/20292#issuecomment-2244261704

Re: RFR: 8335939: Hide element writing across the ClassFile API [v3]

2024-07-22 Thread Chen Liang
On Sat, 20 Jul 2024 23:12:59 GMT, Chen Liang wrote: >> `WritableElement` has always been one of the biggest peculiarities of >> ClassFile API: it exposes element writing yet has no corresponding reading >> ability exposed. Its existence creates a lot of API noise, increasing >> maintenance cos

Re: RFR: 8335939: Hide element writing across the ClassFile API [v4]

2024-07-22 Thread Chen Liang
> `WritableElement` has always been one of the biggest peculiarities of > ClassFile API: it exposes element writing yet has no corresponding reading > ability exposed. Its existence creates a lot of API noise, increasing > maintenance cost in the long run. (This is an iceberg whose tip was expos

Re: RFR: 8335938: Review XxxBuilder.original and XxxModel.parent [v2]

2024-07-22 Thread Chen Liang
On Mon, 15 Jul 2024 15:16:23 GMT, Chen Liang wrote: >> Remove unused `Class/Field/Method/CodeBuilder.original()`, and make >> `Field/Method/CodeModel.parent()` return present only if it's bound (i.e. >> not buffered transformed). See the CSR for details. > > Chen Liang has updated the pull requ

Integrated: 8335938: Review XxxBuilder.original and XxxModel.parent

2024-07-22 Thread Chen Liang
On Mon, 15 Jul 2024 00:33:51 GMT, Chen Liang wrote: > Remove unused `Class/Field/Method/CodeBuilder.original()`, and make > `Field/Method/CodeModel.parent()` return present only if it's bound (i.e. not > buffered transformed). See the CSR for details. This pull request has now been integrated.

RFR: 8204582: Extra spaces in jlink documentation make it incorrect.

2024-07-22 Thread Athijegannathan Sundararajan
removed extra whitespaces - Commit messages: - 8204582: Extra spaces in jlink documentation make it incorrect Changes: https://git.openjdk.org/jdk/pull/20292/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20292&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8204582

RFR: 8336927: Missing equals and hashCode in java.lang.classfile.Annotation

2024-07-22 Thread Chen Liang
Convert `AnnotationImpl` to a record so it comes with proper `equals` and `hashCode` implementations. This also fixes the comparison for annotation-valued annotation element values. - Commit messages: - 8336927: Missing equals and hashCode in java.lang.classfile.Annotation Changes

RFR: 8336934: Clean up JavaLangReflectAccess

2024-07-22 Thread Chen Liang
Removed redundant APIs in `JavaLangReflectAccess` and added general warning against using `SharedSecrets`. - Commit messages: - 8336934: Clean up JavaLangReflectAccess Changes: https://git.openjdk.org/jdk/pull/20290/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20290&ran

Re: RFR: 8317980: Optimization for Integer.parseInt and Long.parseLong [v4]

2024-07-22 Thread Shaojin Wen
> Currently, about 25% of the time spent by the Integer.parseInt and > Long.parseLong methods is spent on the Character.digit method. > > The Character.digit method is common to all radixes. We can use a digit > method optimized for Latin1 encoding radix 10 to improve the performance of > Integ

Re: RFR: 8317980: Optimization for Integer.parseInt and Long.parseLong [v3]

2024-07-22 Thread Shaojin Wen
> Currently, about 25% of the time spent by the Integer.parseInt and > Long.parseLong methods is spent on the Character.digit method. > > The Character.digit method is common to all radixes. We can use a digit > method optimized for Latin1 encoding radix 10 to improve the performance of > Integ

Re: RFR: 8317980: Optimization for Integer.parseInt and Long.parseLong [v2]

2024-07-22 Thread Joe Darcy
On Sat, 13 Jul 2024 00:50:18 GMT, Shaojin Wen wrote: >> Currently, about 25% of the time spent by the Integer.parseInt and >> Long.parseLong methods is spent on the Character.digit method. >> >> The Character.digit method is common to all radixes. We can use a digit >> method optimized for Lat

Re: RFR: 8336856: Optimize String Concat [v3]

2024-07-22 Thread Shaojin Wen
On Mon, 22 Jul 2024 22:34:01 GMT, Shaojin Wen wrote: >> The current implementation of StringConcat is to mix the coder and length >> into a long. This operation will have some overhead for int/long/boolean >> types. We can separate the calculation of the coder from the calculation of >> the le

Integrated: 8335922: Incorrect @Stable usage of LambdaForm$Name.index

2024-07-22 Thread Chen Liang
On Mon, 15 Jul 2024 01:45:57 GMT, Chen Liang wrote: > The `@Stable` on the `index` field is incorrect, as stable only avoids > inlining `0`. On a strategic view, this index field should just become final > so that `Name` becomes eligible for value class migration once valhalla > comes. This pa

Integrated: 8304929: MethodTypeDesc throws an unchecked exception than ReflectiveOperationException when a component class cannot be resolved

2024-07-22 Thread Chen Liang
On Tue, 2 Jul 2024 16:20:54 GMT, Chen Liang wrote: > Simple fix for `MethodTypeDescImpl`'s violation of `resolveConstantDesc` > specification. This pull request has now been integrated. Changeset: 96e4a187 Author:Chen Liang URL: https://git.openjdk.org/jdk/commit/96e4a1876a3ab0819c

Re: RFR: 8336679: Add @implSpec for the default implementations in Process.waitFor()

2024-07-22 Thread Brian Burkhalter
On Mon, 22 Jul 2024 22:10:07 GMT, Naoto Sato wrote: > This is a simple doc-only change that follows up > [JDK-8336479](https://bugs.openjdk.org/browse/JDK-8336479). A corresponding > CSR has also been drafted. Marked as reviewed by bpb (Reviewer). - PR Review: https://git.openjdk

Re: RFR: 8336856: Optimize String Concat [v3]

2024-07-22 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

RFR: 8336679: Add @implSpec for the default implementations in Process.waitFor()

2024-07-22 Thread Naoto Sato
This is a simple doc-only change that follows up [JDK-8336479](https://bugs.openjdk.org/browse/JDK-8336479). A corresponding CSR has also been drafted. - Commit messages: - initial commit Changes: https://git.openjdk.org/jdk/pull/20285/files Webrev: https://webrevs.openjdk.org/?

Re: RFR: 8322256: Define and document GZIPInputStream concatenated stream semantics [v6]

2024-07-22 Thread Archie Cobbs
> `GZIPInputStream` supports reading data from multiple concatenated GZIP data > streams since [JDK-4691425](https://bugs.openjdk.org/browse/JDK-4691425). In > order to do this, after a GZIP trailer frame is read, it attempts to read a > GZIP header frame and, if successful, proceeds onward to d

Re: RFR: 8322256: Define and document GZIPInputStream concatenated stream semantics [v5]

2024-07-22 Thread Archie Cobbs
On Mon, 22 Jul 2024 18:08:52 GMT, Eirik Bjørsnøs wrote: >>> The term "extra" here feels somewhat open to interpretation. Specifically, >>> "extra" sounds like something that is out of the ordinary, but not uncommon >>> or wrong. It could be used when describing an optional feature in a format

Re: RFR: 8322256: Define and document GZIPInputStream concatenated stream semantics [v5]

2024-07-22 Thread Eirik Bjørsnøs
On Fri, 19 Jul 2024 23:16:07 GMT, Archie Cobbs wrote: >> src/java.base/share/classes/java/util/zip/GZIPInputStream.java line 143: >> >>> 141: * @param allowConcatenation true to allow multiple concatenated >>> compressed data streams, >>> 142: * or false to e

Integrated: 8336844: ZipConstants64 defines duplicate constants EXTID_ZIP64 and ZIP64_EXTID

2024-07-22 Thread Liam Miller-Cushon
On Fri, 19 Jul 2024 19:35:14 GMT, Liam Miller-Cushon wrote: > This change deduplicates constants in ZipConstants64 for the Zip64 Extended > Information Extra Field Header ID (see APPNOTE.TXT 4.5.3). > > I think there are arguments for consolidating on either `EXTID_ZIP64` or > `ZIP64_EXTID`. T

Integrated: 8336479: Provide Process.waitFor(Duration)

2024-07-22 Thread Naoto Sato
On Wed, 17 Jul 2024 17:36:29 GMT, Naoto Sato wrote: > Proposing a new overload method for `Process#waitFor()` which takes a > `Duration` for the timeout value. This will reduce the possibility for making > mistakes with the `TimeUnit` in the other overload method. A corresponding > CSR has als

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-22 Thread Naoto Sato
On Fri, 19 Jul 2024 14:47:09 GMT, Roger Riggs wrote: >> I think the test tool should not depend on the internal implementation, so I >> think it should be kept. > > Its still unnecessary, adds bulk and maintenance overhead that will go unused. I will leave it as is for now, as it is consistent

Re: RFR: 8336479: Provide Process.waitFor(Duration) [v5]

2024-07-22 Thread Naoto Sato
On Thu, 18 Jul 2024 20:51:48 GMT, Naoto Sato wrote: >> Proposing a new overload method for `Process#waitFor()` which takes a >> `Duration` for the timeout value. This will reduce the possibility for >> making mistakes with the `TimeUnit` in the other overload method. A >> corresponding CSR has

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v5]

2024-07-22 Thread Andrew Haley
> This patch expands the use of a hash table for secondary superclasses > to the interpreter, C1, and runtime. It also adds a C2 implementation > of hashed lookup in cases where the superclass isn't known at compile > time. > > HotSpot shared runtime > -- > > Building hashed s

RFR: 8336881: [Linux] Support for hierarchical limits for Metrics

2024-07-22 Thread Severin Gehwolf
Please review this fix for cgroups-based metrics reporting in the `jdk.internal.platform` package. This fix is supposed to address wrong reporting of certain limits if the limits aren't set at the leaf nodes. For example, on cg v2, the memory limit interface file is `memory.max`. Consider a cgr

Re: RFR: 8336881: [Linux] Support for hierarchical limits for Metrics

2024-07-22 Thread Severin Gehwolf
On Mon, 22 Jul 2024 16:56:00 GMT, Severin Gehwolf wrote: > Please review this fix for cgroups-based metrics reporting in the > `jdk.internal.platform` package. This fix is supposed to address wrong > reporting of certain limits if the limits aren't set at the leaf nodes. > > For example, on cg

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v4]

2024-07-22 Thread Andrew Haley
On Mon, 22 Jul 2024 16:50:47 GMT, Andrew Haley wrote: >> This patch expands the use of a hash table for secondary superclasses >> to the interpreter, C1, and runtime. It also adds a C2 implementation >> of hashed lookup in cases where the superclass isn't known at compile >> time. >> >> HotSpot

Re: RFR: 8336856: Optimize String Concat [v2]

2024-07-22 Thread Shaojin Wen
> The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length, which can improve the performance in the scenario of

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v4]

2024-07-22 Thread Andrew Haley
On Thu, 11 Jul 2024 23:57:27 GMT, Vladimir Ivanov wrote: >> Andrew Haley has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Review comments >> - Review comments > > src/hotspot/cpu/x86/macroAssembler_x86.cpp line 4810: > >> 4808:

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v4]

2024-07-22 Thread Andrew Haley
> This patch expands the use of a hash table for secondary superclasses > to the interpreter, C1, and runtime. It also adds a C2 implementation > of hashed lookup in cases where the superclass isn't known at compile > time. > > HotSpot shared runtime > -- > > Building hashed s

Re: RFR: 8336754: Remodel TypeAnnotation to "has" instead of "be" an Annotation [v2]

2024-07-22 Thread Chen Liang
> `TypeAnnotation` is not an annotation, as it should not be used in places > like `AnnotationValue.ofAnnotation`. Thus it's remodeled to contain an > annotation at a given location instead of to be an annotation. > > Depends on #20205. Chen Liang has updated the pull request with a new target

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v3]

2024-07-22 Thread Andrew Haley
On Mon, 22 Jul 2024 15:03:12 GMT, Andrew Haley wrote: >> Alternatively, `Klass::is_subtype_of()` can unconditionally perform linear >> search over secondary_supers array. >> >> Even though I very much like to see table lookup written in C++ >> (accompanying heavily optimized platform-specific

Re: RFR: 8333796: Add missing serialization functionality to sun.reflect.ReflectionFactory

2024-07-22 Thread David M . Lloyd
On Tue, 16 Jul 2024 18:34:00 GMT, Roger Riggs wrote: > Is there a high level description of how these methods would be used? They would be used identically to how the `readObjectForSerialization` and `writeObjectForSerialization` methods are used. The caller would pass the object as a pseudo-"

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v3]

2024-07-22 Thread Andrew Haley
On Thu, 18 Jul 2024 20:11:03 GMT, Vladimir Ivanov wrote: > Alternatively, `Klass::is_subtype_of()` can unconditionally perform linear > search over secondary_supers array. > > Even though I very much like to see table lookup written in C++ (accompanying > heavily optimized platform-specific Ma

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v3]

2024-07-22 Thread Andrew Haley
On Thu, 11 Jul 2024 23:07:43 GMT, Vladimir Ivanov wrote: >> Andrew Haley has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Review feedback >> - Review feedback >> - Review feedback >> - Cleanup check_klass_subtype_fast_path for AArch

Re: RFR: 8335791: Speed ​​up j.u.Formatter & String.format [v4]

2024-07-22 Thread Roger Riggs
On Sat, 6 Jul 2024 00:15:04 GMT, Shaojin Wen wrote: >> String.format is widely used, and improving its performance is very >> meaningful. This PR can significantly improve the performance of >> String.format. Sorry, there are many changes, which will take a lot of time. >> I hope you can revie

Re: RFR: 8336856: Optimize String Concat

2024-07-22 Thread Chen Liang
On Sun, 21 Jul 2024 12:25:36 GMT, Shaojin Wen wrote: > The current implementation of StringConcat is to mix the coder and length > into a long. This operation will have some overhead for int/long/boolean > types. We can separate the calculation of the coder from the calculation of > the length

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-22 Thread Chen Liang
On Mon, 22 Jul 2024 07:24:08 GMT, Shaojin Wen wrote: >>> If code is generated through ClassFile, how to access the private methods >>> of classes such as String/StringConcatHelper? >> >> In that case, you have to encode those methods as live `MethodHandle` >> objects, passed to the generated c

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v3]

2024-07-22 Thread Andrew Haley
On Fri, 5 Jul 2024 22:30:09 GMT, Vladimir Ivanov wrote: >> Andrew Haley has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - Review feedback >> - Review feedback >> - Review feedback >> - Cleanup check_klass_subtype_fast_path for AArch6

Re: RFR: 8316882: Do not close ZipFileSystem on interrupt

2024-07-22 Thread Lance Andersen
On Sun, 21 Jul 2024 16:32:09 GMT, Technici4n wrote: > Oh, I missed the assignment and did not check with @LanceAndersen. I don't have a problem with you or someone else taking ownership of this issue once the discussion that Alan points out comes to a conclusion. Until the overall path forwar

Re: RFR: 8331341: secondary_super_cache does not scale well: C1 and interpreter [v3]

2024-07-22 Thread Andrew Haley
On Thu, 11 Jul 2024 22:53:42 GMT, Vladimir Ivanov wrote: >> src/hotspot/share/oops/instanceKlass.cpp line 1410: >> >>> 1408: return nullptr; >>> 1409: } else if (num_extra_slots == 0) { >>> 1410: if (num_extra_slots == 0 && interfaces->length() <= 1) { >> >> Since `secondary_supers` a

Re: RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v15]

2024-07-22 Thread Severin Gehwolf
On Thu, 18 Jul 2024 14:48:02 GMT, Jan Kratochvil wrote: >> The testcase requires root permissions. >> >> Fix by Severin Gehwolf. >> Testcase by Jan Kratochvil. > > Jan Kratochvil has updated the pull request incrementally with one additional > commit since the last revision: > > Unify 4 co

Integrated: 8334394: Race condition in Class::protectionDomain

2024-07-22 Thread Weijun Wang
On Mon, 17 Jun 2024 14:51:07 GMT, Weijun Wang wrote: > Make sure `pd` is always the same object when `getProtectionDomain0` is null. This pull request has now been integrated. Changeset: c3226aae Author:Weijun Wang URL: https://git.openjdk.org/jdk/commit/c3226aaeb810521257e961be5763

Re: RFR: 8334394: Race condition in Class::protectionDomain [v3]

2024-07-22 Thread Roger Riggs
On Mon, 22 Jul 2024 12:42:48 GMT, Weijun Wang wrote: >> Make sure `pd` is always the same object when `getProtectionDomain0` is null. > > Weijun Wang has updated the pull request incrementally with two additional > commits since the last revision: > > - var to real type > - rename Marked as

Integrated: 8336039: Doccheck: HTML warnings, broken links and missing files in java.base documentation

2024-07-22 Thread Nizar Benalla
On Fri, 19 Jul 2024 11:11:38 GMT, Nizar Benalla wrote: > Can I get a review for this change that fixes some broken links in javadoc > comments? The new docs are hosted > [here](https://cr.openjdk.org/~nbenalla/GeneratedDocs/8336039-warnings-links/). > > It's mostly fixing some relative links.

Re: RFR: 8334394: Race condition in Class::protectionDomain [v3]

2024-07-22 Thread Chen Liang
On Mon, 22 Jul 2024 12:42:48 GMT, Weijun Wang wrote: >> Make sure `pd` is always the same object when `getProtectionDomain0` is null. > > Weijun Wang has updated the pull request incrementally with two additional > commits since the last revision: > > - var to real type > - rename Marked as

Re: RFR: 8334394: Race condition in Class::protectionDomain [v3]

2024-07-22 Thread Jaikiran Pai
On Mon, 22 Jul 2024 12:42:48 GMT, Weijun Wang wrote: >> Make sure `pd` is always the same object when `getProtectionDomain0` is null. > > Weijun Wang has updated the pull request incrementally with two additional > commits since the last revision: > > - var to real type > - rename Still look

Re: RFR: 8336039: Doccheck: HTML warnings, broken links and missing files in java.base documentation [v5]

2024-07-22 Thread duke
On Sun, 21 Jul 2024 21:15:03 GMT, Nizar Benalla wrote: >> Can I get a review for this change that fixes some broken links in javadoc >> comments? The new docs are hosted >> [here](https://cr.openjdk.org/~nbenalla/GeneratedDocs/8336039-warnings-links/). >> >> It's mostly fixing some relative li

Re: RFR: 8336039: Doccheck: HTML warnings, broken links and missing files in java.base documentation [v5]

2024-07-22 Thread Nizar Benalla
On Sun, 21 Jul 2024 21:15:03 GMT, Nizar Benalla wrote: >> Can I get a review for this change that fixes some broken links in javadoc >> comments? The new docs are hosted >> [here](https://cr.openjdk.org/~nbenalla/GeneratedDocs/8336039-warnings-links/). >> >> It's mostly fixing some relative li

Re: RFR: 8334394: Race condition in Class::protectionDomain [v2]

2024-07-22 Thread Weijun Wang
On Tue, 16 Jul 2024 12:59:36 GMT, Alan Bateman wrote: >> Weijun Wang has updated the pull request incrementally with one additional >> commit since the last revision: >> >> explain why the test is related to the fix > > test/jdk/java/lang/Class/ProtectionDomainRace.java line 61: > >> 59:

Re: RFR: 8334394: Race condition in Class::protectionDomain [v3]

2024-07-22 Thread Weijun Wang
> Make sure `pd` is always the same object when `getProtectionDomain0` is null. Weijun Wang has updated the pull request incrementally with two additional commits since the last revision: - var to real type - rename - Changes: - all: https://git.openjdk.org/jdk/pull/19752/files

Re: RFR: 8336039: Doccheck: HTML warnings, broken links and missing files in java.base documentation [v5]

2024-07-22 Thread Daniel Jeliński
On Sun, 21 Jul 2024 21:15:03 GMT, Nizar Benalla wrote: >> Can I get a review for this change that fixes some broken links in javadoc >> comments? The new docs are hosted >> [here](https://cr.openjdk.org/~nbenalla/GeneratedDocs/8336039-warnings-links/). >> >> It's mostly fixing some relative li

Re: RFR: 8322420: [Linux] cgroup v2: Limits in parent nested control groups are not detected [v15]

2024-07-22 Thread Severin Gehwolf
On Thu, 18 Jul 2024 14:48:02 GMT, Jan Kratochvil wrote: >> The testcase requires root permissions. >> >> Fix by Severin Gehwolf. >> Testcase by Jan Kratochvil. > > Jan Kratochvil has updated the pull request incrementally with one additional > commit since the last revision: > > Unify 4 co

Integrated: 8336833: Endless loop in Javap ClassWriter

2024-07-22 Thread Adam Sotona
On Fri, 19 Jul 2024 15:32:24 GMT, Adam Sotona wrote: > Artificially corrupted class with overflowing max - min values of > `tableswitch` instruction cause infinite loop in > `jdk.internal.classfile.impl.CodeImpl::inflateJumpTargets` > > This patch fixes the overflow and adds relevant test. >

Re: RFR: 8336831: Optimize StringConcatHelper.simpleConcat [v5]

2024-07-22 Thread Shaojin Wen
On Sat, 20 Jul 2024 06:41:25 GMT, Chen Liang wrote: > > If code is generated through ClassFile, how to access the private methods > > of classes such as String/StringConcatHelper? > > In that case, you have to encode those methods as live `MethodHandle` > objects, passed to the generated class