Re: RFR: 8335274: SwitchBootstraps.ResolvedEnumLabels.resolvedEnum should be final

2024-06-28 Thread Jan Lahoda
On Thu, 27 Jun 2024 19:30:34 GMT, Aleksey Shipilev wrote: > I was auditing the current uses of `@Stable` before relaxing its barriers > ([JDK-8333791](https://bugs.openjdk.org/browse/JDK-8333791)), and this is an > easy spot. > > `resolvedEnum` is not `final`. So technically publishing the ob

Re: RFR: 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container [v7]

2024-06-28 Thread Severin Gehwolf
On Tue, 25 Jun 2024 13:54:46 GMT, Severin Gehwolf wrote: >> Please review this enhancement to the container detection code which allows >> it to figure out whether the JVM is actually running inside a container >> (`podman`, `docker`, `crio`), or with some other means that enforces >> memory/c

Re: RFR: 8335274: SwitchBootstraps.ResolvedEnumLabels.resolvedEnum should be final

2024-06-28 Thread Jan Lahoda
On Thu, 27 Jun 2024 19:30:34 GMT, Aleksey Shipilev wrote: > I was auditing the current uses of `@Stable` before relaxing its barriers > ([JDK-8333791](https://bugs.openjdk.org/browse/JDK-8333791)), and this is an > easy spot. > > `resolvedEnum` is not `final`. So technically publishing the ob

Re: RFR: 8335274: SwitchBootstraps.ResolvedEnumLabels.resolvedEnum should be final

2024-06-28 Thread Aleksey Shipilev
On Thu, 27 Jun 2024 19:30:34 GMT, Aleksey Shipilev wrote: > I was auditing the current uses of `@Stable` before relaxing its barriers > ([JDK-8333791](https://bugs.openjdk.org/browse/JDK-8333791)), and this is an > easy spot. > > `resolvedEnum` is not `final`. So technically publishing the ob

Re: RFR: 8335252: ForceInline j.u.Formatter.Conversion#isValid [v2]

2024-06-28 Thread Claes Redestad
On Thu, 27 Jun 2024 14:12:36 GMT, Shaojin Wen wrote: >> Currently, the java.util.Formatter$Conversion::isValid method is implemented >> based on switch, which cannot be inlined because codeSize > 325. This >> problem can be avoided by implementing it with ImmutableBitSetPredicate. >> >> use `-

Re: RFR: 8332072: Convert package.html files in `java.naming` to package-info.java [v3]

2024-06-28 Thread Nizar Benalla
> Can I please get a review for this small change? The motivation is that javac > does not recognize `package.html` files. > > The conversion was simple, I used a script to rename the files, append "*" on > the left and remove some HTML tags like `` and ``. I did the > conversion in place, rena

Re: RFR: 8332072: Convert package.html files in `java.naming` to package-info.java [v2]

2024-06-28 Thread Nizar Benalla
On Thu, 27 Jun 2024 10:27:03 GMT, Aleksei Efimov wrote: >> Nizar Benalla 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 four additional >> comm

Re: RFR: 8330954: since-checker - Fix remaining @ since tags in java.base [v7]

2024-06-28 Thread Nizar Benalla
> Please review this PR that aims to add all the remaining needed `@since` tags > in `java.base`, and group them into a single fix. > This is related to #18934 and my work around the `@since` checker feature. > Explicit `@since` tags are needed for some overriding methods for the purpose > of the

Re: RFR: 8335252: ForceInline j.u.Formatter.Conversion#isValid [v2]

2024-06-28 Thread Shaojin Wen
On Fri, 28 Jun 2024 10:22:58 GMT, Claes Redestad wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> revert & use `@ForceInline` > > So the compound issue here is that there's a heuristic which prevents > inlining of l

Re: RFR: 8335252: ForceInline j.u.Formatter.Conversion#isValid [v3]

2024-06-28 Thread Shaojin Wen
> Currently, the java.util.Formatter$Conversion::isValid method is implemented > based on switch, which cannot be inlined because codeSize > 325. This problem > can be avoided by implementing it with ImmutableBitSetPredicate. > > use `-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining` to see the

Re: RFR: 8335252: ForceInline j.u.Formatter.Conversion#isValid [v3]

2024-06-28 Thread Claes Redestad
On Fri, 28 Jun 2024 11:27:47 GMT, Shaojin Wen wrote: >> Currently, the java.util.Formatter$Conversion::isValid method is implemented >> based on switch, which cannot be inlined because codeSize > 325. This >> problem can be avoided by implementing it with ImmutableBitSetPredicate. >> >> use `-

Re: RFR: 8335182: Consolidate and streamline String concat code shapes [v2]

2024-06-28 Thread Claes Redestad
> This PR attains a speed-up on some microbenchmarks by simplifying how we > build up the MH combinator tree shape > (only use prependers with prefix, always add a suffix to the newArray > combinator), then simplifying/inlining some of the code in the helper > functions. > > Many simple concat

Re: RFR: 8335252: Reduce size of j.u.Formatter.Conversion#isValid [v4]

2024-06-28 Thread Shaojin Wen
> Currently, the java.util.Formatter$Conversion::isValid method is implemented > based on switch, which cannot be inlined because codeSize > 325. This problem > can be avoided by implementing it with ImmutableBitSetPredicate. > > use `-XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining` to see the

Re: RFR: 8335252: Reduce size of j.u.Formatter.Conversion#isValid [v4]

2024-06-28 Thread Claes Redestad
On Fri, 28 Jun 2024 12:46:49 GMT, Shaojin Wen wrote: >> Currently, the java.util.Formatter$Conversion::isValid method is implemented >> based on switch, which cannot be inlined because codeSize > 325. This >> problem can be avoided by implementing it with ImmutableBitSetPredicate. >> >> use `-

Re: RFR: 8331051: Add an `@since` checker test for `java.base` module [v11]

2024-06-28 Thread Nizar Benalla
> This checker checks the values of the `@since` tag found in the documentation > comment for an element against the release in which the element first > appeared. > > Real since value of an API element is computed as the oldest release in which > the given API element was introduced. That is:

Re: RFR: 8331051: Add an `@since` checker test for `java.base` module [v10]

2024-06-28 Thread Nizar Benalla
On Tue, 25 Jun 2024 08:29:42 GMT, Nizar Benalla wrote: >> This checker checks the values of the `@since` tag found in the >> documentation comment for an element against the release in which the >> element first appeared. >> >> Real since value of an API element is computed as the oldest relea

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v5]

2024-06-28 Thread Alan Bateman
On Thu, 20 Jun 2024 19:37:23 GMT, Jorn Vernee wrote: > It looks like it's possible to get even more custom by using a custom > `HelpFormatter` as well, if we wanted. I think what you have is okay for the first integration, just looks odd to have the help/usage say "String" and "Path". Using a

Re: RFR: 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container [v7]

2024-06-28 Thread Severin Gehwolf
On Thu, 27 Jun 2024 18:40:09 GMT, Larry Cable wrote: >> Severin Gehwolf has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 17 commits: >> >> - Refactor mount info matching to helper function >> - Merge branch 'master' into jdk-8261

Re: RFR: 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container [v8]

2024-06-28 Thread Severin Gehwolf
> Please review this enhancement to the container detection code which allows > it to figure out whether the JVM is actually running inside a container > (`podman`, `docker`, `crio`), or with some other means that enforces > memory/cpu limits by means of the cgroup filesystem. If neither of thos

Re: RFR: 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container [v8]

2024-06-28 Thread Severin Gehwolf
On Fri, 28 Jun 2024 15:41:48 GMT, Severin Gehwolf wrote: >> Please review this enhancement to the container detection code which allows >> it to figure out whether the JVM is actually running inside a container >> (`podman`, `docker`, `crio`), or with some other means that enforces >> memory/c

Re: RFR: 8335252: Reduce size of j.u.Formatter.Conversion#isValid [v4]

2024-06-28 Thread duke
On Fri, 28 Jun 2024 12:46:49 GMT, Shaojin Wen wrote: >> Currently, the java.util.Formatter$Conversion::isValid method is implemented >> based on switch, which cannot be inlined because codeSize > 325. This >> problem can be avoided by implementing it with ImmutableBitSetPredicate. >> >> use `-

Integrated: 8335274: SwitchBootstraps.ResolvedEnumLabels.resolvedEnum should be final

2024-06-28 Thread Aleksey Shipilev
On Thu, 27 Jun 2024 19:30:34 GMT, Aleksey Shipilev wrote: > I was auditing the current uses of `@Stable` before relaxing its barriers > ([JDK-8333791](https://bugs.openjdk.org/browse/JDK-8333791)), and this is an > easy spot. > > `resolvedEnum` is not `final`. So technically publishing the ob

Re: RFR: 8335252: Reduce size of j.u.Formatter.Conversion#isValid [v4]

2024-06-28 Thread Paul Sandoz
On Fri, 28 Jun 2024 12:46:49 GMT, Shaojin Wen wrote: >> Currently, the java.util.Formatter$Conversion::isValid method is implemented >> based on switch, which cannot be inlined because codeSize > 325. This >> problem can be avoided by implementing it with ImmutableBitSetPredicate. >> >> use `-

Re: RFR: 8335274: SwitchBootstraps.ResolvedEnumLabels.resolvedEnum should be final

2024-06-28 Thread Jan Lahoda
On Fri, 28 Jun 2024 09:33:41 GMT, Aleksey Shipilev wrote: > > FWIW, there are more `@Stable` uses here: #19906 > > if you would have a moment to check that, it may be helpful. Thanks. > > That one looks fine: it is set outside of constructor, is intrinsically racy, > and it has AFAICS the recov

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v9]

2024-06-28 Thread Alan Bateman
On Mon, 24 Jun 2024 12:57:39 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The tool accepts

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v9]

2024-06-28 Thread Alan Bateman
On Mon, 24 Jun 2024 12:57:39 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The tool accepts

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v9]

2024-06-28 Thread Alan Bateman
On Mon, 24 Jun 2024 12:57:39 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The tool accepts

Re: RFR: 8335252: Reduce size of j.u.Formatter.Conversion#isValid [v4]

2024-06-28 Thread Shaojin Wen
On Fri, 28 Jun 2024 16:29:02 GMT, Paul Sandoz wrote: >> Shaojin Wen has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fix comment > > That's a clever change and more preferable (but still potentially fragile in > the source to bytecode tr

Re: RFR: 8261242: [Linux] OSContainer::is_containerized() returns true when run outside a container [v8]

2024-06-28 Thread Larry Cable
On Fri, 28 Jun 2024 15:41:48 GMT, Severin Gehwolf wrote: >> Please review this enhancement to the container detection code which allows >> it to figure out whether the JVM is actually running inside a container >> (`podman`, `docker`, `crio`), or with some other means that enforces >> memory/c

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v9]

2024-06-28 Thread Jorn Vernee
On Fri, 28 Jun 2024 16:47:27 GMT, Alan Bateman wrote: >> Jorn Vernee has updated the pull request incrementally with one additional >> commit since the last revision: >> >> de-dupe on path, not module name > > src/jdk.jdeps/share/classes/com/sun/tools/jnativescan/JNativeScanTask.java > line

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v10]

2024-06-28 Thread Jorn Vernee
> This PR adds a new JDK tool, called `jnativescan`, that can be used to find > code that accesses native functionality. Currently this includes `native` > method declarations, and methods marked with `@Restricted`. > > The tool accepts a list of class path and module path entries through > `--

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v10]

2024-06-28 Thread Chen Liang
On Fri, 28 Jun 2024 19:43:36 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The tool accepts

RFR: 8335290: Rename ClassFile::transform to ClassFile::transformClass

2024-06-28 Thread Chen Liang
`ClassFile::transform` was initially `ClassModel::transform`, which transforms the receiver class model to a new class byte array. This functionality was in parallel with `ClassBuilder::transform`, which accepts a `ClassModel` and a `ClassTransform` and forwards the results to the receiver build

Re: RFR: 8335252: Reduce size of j.u.Formatter.Conversion#isValid [v4]

2024-06-28 Thread Chen Liang
On Fri, 28 Jun 2024 12:46:49 GMT, Shaojin Wen wrote: >> Currently, the java.util.Formatter$Conversion::isValid method is implemented >> based on switch, which cannot be inlined because codeSize > 325. This >> problem can be avoided by implementing it with ImmutableBitSetPredicate. >> >> use `-

Integrated: 8335252: Reduce size of j.u.Formatter.Conversion#isValid

2024-06-28 Thread Shaojin Wen
On Thu, 27 Jun 2024 11:14:30 GMT, Shaojin Wen wrote: > Currently, the java.util.Formatter$Conversion::isValid method is implemented > based on switch, which cannot be inlined because codeSize > 325. This problem > can be avoided by implementing it with ImmutableBitSetPredicate. > > use `-XX:+U

Re: RFR: 8333396: Performance regression of DecimalFormat.format [v14]

2024-06-28 Thread Naoto Sato
On Fri, 28 Jun 2024 04:12:08 GMT, lingjun-cg wrote: >> ### Performance regression of DecimalFormat.format >> From the output of perf, we can see the hottest regions contain atomic >> instructions. But when run with JDK 11, there is no such problem. The >> reason is the removed biased locking.

Re: RFR: 8333396: Performance regression of DecimalFormat.format [v14]

2024-06-28 Thread Iris Clark
On Fri, 28 Jun 2024 22:46:22 GMT, Naoto Sato wrote: >> lingjun-cg has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - 896: Performance regression of DecimalFormat.format >> - 896: Performance regression of DecimalFormat.format > >

Re: RFR: 8317611: Add a tool like jdeprscan to find usage of restricted methods [v10]

2024-06-28 Thread Alan Bateman
On Fri, 28 Jun 2024 19:43:36 GMT, Jorn Vernee wrote: >> This PR adds a new JDK tool, called `jnativescan`, that can be used to find >> code that accesses native functionality. Currently this includes `native` >> method declarations, and methods marked with `@Restricted`. >> >> The tool accepts