Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v5]

2023-02-16 Thread Alan Bateman
On Thu, 16 Feb 2023 21:53:00 GMT, Roger Riggs wrote: >> It can be difficult to find the cause of calls to >> `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java >> runtime exits. >> The status value and stack trace are logged using the System Logger named >> `java.lang.

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-16 Thread Xiaowei Lu
On Thu, 16 Feb 2023 16:51:43 GMT, Raffaello Giulietti wrote: > After making sure that `intVal` is even, and before attempting a division by > a power of 10, it might help to check if 5 divides `intVal` in the first > place. If it doesn't, there no point in performing the division. > > It can

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-16 Thread Xiaowei Lu
On Fri, 17 Feb 2023 04:36:08 GMT, Xiaowei Lu wrote: > The pr looks promising in terms of performance. What makes sense to do: > > *) Don't rely on external benchmarks. It's fine if such exists, but anyway > set of microbenchmarks (using JMH) will be much better. More clear, readable > results,

Re: RFR: 8302204: Optimize BigDecimal.divide [v2]

2023-02-16 Thread Xiaowei Lu
> [JDK-8269667](https://bugs.openjdk.org/browse/JDK-8269667) has uncovered the > poor performance of BigDecimal.divide under certain circumstance. > > We confront similar situations when benchmarking Spark3 on TPC-DS test kit. > According to the flame-graph below, it is StripZeros that spends mo

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-16 Thread Xiaowei Lu
On Tue, 14 Feb 2023 04:48:43 GMT, Xiaowei Lu wrote: > The pr looks promising in terms of performance. What makes sense to do: > > *) Don't rely on external benchmarks. It's fine if such exists, but anyway > set of microbenchmarks (using JMH) will be much better. More clear, readable > results,

Re: RFR: JDK-8302028: Port fdlibm atan2 to Java [v2]

2023-02-16 Thread Joe Darcy
> Working down the porting list, next stop, atan2. Joe Darcy 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 three additional commits since the last re

Integrated: JDK-8301444: Port fdlibm hyperbolic transcendental functions to Java

2023-02-16 Thread Joe Darcy
On Sun, 5 Feb 2023 03:05:55 GMT, Joe Darcy wrote: > Initial pass of porting FDLIBM sinh/cosh/tanh to Java. I do intend to > refactor the regression tests a bit to reduce duplication, but the actual > ports should be ready for review. > > Diff'ing the ports as before, original vs transliteratio

Re: RFR: 8276799: Implementation of JEP 422: Linux/RISC-V Port [v5]

2023-02-16 Thread SUN Guoyun
On Thu, 24 Mar 2022 07:01:43 GMT, Fei Yang wrote: >> This PR implements JEP 422: Linux/RISC-V Port [1]. >> The PR starts as a squashed merge of the >> https://openjdk.java.net/projects/riscv-port branch. >> >> This has been tested with jtreg tier{1,2,3,4} and jcstress on HiFive >> Unmatched bo

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v9]

2023-02-16 Thread Mandy Chung
On Fri, 17 Feb 2023 01:56:21 GMT, Ian Graves wrote: >> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java >> line 95: >> >>> 93: switch (level) { >>> 94: case LEVEL_0: >>> 95: System.err.println("warning - the

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v9]

2023-02-16 Thread Ian Graves
On Thu, 16 Feb 2023 23:04:30 GMT, Mandy Chung wrote: >> Ian Graves has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Additional updates > > src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/DefaultCompressPlugin.java > line 95:

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v5]

2023-02-16 Thread Ian Graves
On Wed, 8 Feb 2023 13:27:09 GMT, Jaikiran Pai wrote: >> Ian Graves has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Adding plugin type to force compact strings vs zip ordering > > src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugi

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread Mandy Chung
On Thu, 16 Feb 2023 19:35:54 GMT, David M. Lloyd wrote: >> The class generated for lambda proxies is now defined as a hidden class. >> This means that the counter, which was used to ensure a unique class name >> and avoid clashes, is now redundant. In addition to performing redundant >> work,

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread David M . Lloyd
On Thu, 16 Feb 2023 22:23:09 GMT, ExE Boss wrote: >> The Lamdba class name already ends in `$` - is there a reason we'd need a >> second one when dumping? > > I suggested removing it in: > https://github.com/openjdk/jdk/pull/12579#discussion_r1108941733 Ah I missed that. Sure, I guess that's f

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v2]

2023-02-16 Thread Mandy Chung
On Thu, 15 Dec 2022 07:31:05 GMT, Jaikiran Pai wrote: >> test/jdk/tools/jlink/plugins/CompressorPluginTest.java line 153: >> >>> 151: Properties optionsZip0 = new Properties(); >>> 152: DefaultCompressPlugin compressPluginZip0 = new >>> DefaultCompressPlugin(); >>> 153:

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v2]

2023-02-16 Thread Mandy Chung
On Thu, 15 Dec 2022 07:02:37 GMT, Jaikiran Pai wrote: >> Ian Graves has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Swapping deprecations in properties > > test/jdk/tools/jlink/plugins/CompressorPluginTest.java line 203: > >> 201:

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v9]

2023-02-16 Thread Mandy Chung
On Thu, 16 Feb 2023 23:07:13 GMT, Ian Graves wrote: >> This is an approach to adding a flag to jlink that will allow --compress to >> take the same types of arguments as jmod, thus bringing the two into >> alignment. This likely requires a CSR and a discussion on whether we should >> deprecate

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option

2023-02-16 Thread Ian Graves
On Mon, 9 Jan 2023 21:38:59 GMT, Mandy Chung wrote: >> I skimmed through this (not a detailed review) and I think it's mostly okay. >> It's --compress 0 and 2 that should be listed as deprecated as --compress 1 >> is string sharing rather than zip compression. > >> I skimmed through this (not a

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v9]

2023-02-16 Thread Ian Graves
> This is an approach to adding a flag to jlink that will allow --compress to > take the same types of arguments as jmod, thus bringing the two into > alignment. This likely requires a CSR and a discussion on whether we should > deprecate or simply remove the original numeric compression argumen

Re: RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask

2023-02-16 Thread Paul Sandoz
On Thu, 16 Feb 2023 19:44:35 GMT, Viktor Klang wrote: >> src/java.base/share/classes/java/util/stream/ForEachOps.java line 431: >> >>> 429: // leftChild and rightChild were just created and not >>> fork():ed >>> 430: // yet so no need for a volatile write >>> 431

Re: RFR: JDK-8301444: Port fdlibm hyperbolic transcendental functions to Java [v11]

2023-02-16 Thread Brian Burkhalter
On Wed, 15 Feb 2023 22:44:40 GMT, Joe Darcy wrote: >> Initial pass of porting FDLIBM sinh/cosh/tanh to Java. I do intend to >> refactor the regression tests a bit to reduce duplication, but the actual >> ports should be ready for review. >> >> Diff'ing the ports as before, original vs translit

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread ExE Boss
On Thu, 16 Feb 2023 20:02:36 GMT, David M. Lloyd wrote: >> src/java.base/share/classes/java/lang/invoke/ProxyClassesDumper.java line >> 124: >> >>> 122: } >>> 123: } >>> 124: sb.append(counter.incrementAndGet()); >> >> Suggestion: >> >> sb.append('$').appen

Re: RFR: JDK-8302028: Port fdlibm atan2 to Java

2023-02-16 Thread Brian Burkhalter
On Thu, 16 Feb 2023 19:30:06 GMT, Joe Darcy wrote: > Working down the porting list, next stop, atan2. The port looks reasonable to me. - PR: https://git.openjdk.org/jdk/pull/12608

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v5]

2023-02-16 Thread Roger Riggs
> It can be difficult to find the cause of calls to > `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java > runtime exits. > The status value and stack trace are logged using the System Logger named > `java.lang.Runtime` with message level `System.Logger.Level.DEBUG`. Ro

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v4]

2023-02-16 Thread Roger Riggs
On Tue, 14 Feb 2023 19:02:52 GMT, Stuart Marks wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Correct System.getLogger link > > src/java.base/share/classes/java/lang/Shutdown.java line 168: > >> 166:

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v4]

2023-02-16 Thread Roger Riggs
On Thu, 16 Feb 2023 16:52:14 GMT, Sean Mullan wrote: >> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Correct System.getLogger link > > src/java.base/share/classes/java/lang/Runtime.java line 160: > >> 158: * >> 159:

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v4]

2023-02-16 Thread Roger Riggs
On Tue, 14 Feb 2023 13:10:41 GMT, Daniel Fuchs wrote: >> Roger has updated this but it's still a comment on a non-public class. I >> think the main question here is whether there should be a note in the >> System.exit and Runtime.exit to document that these methods log? If not, >> will it be d

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v4]

2023-02-16 Thread Roger Riggs
On Mon, 13 Feb 2023 11:02:14 GMT, Daniel Fuchs wrote: >> test/jdk/java/lang/runtime/RuntimeExitLogTest.java line 89: >> >>> 87: } >>> 88: cmd.add(this.getClass().getName()); >>> 89: cmd.add(Integer.toString(status)); >> >> Another possibility for testing this is to launc

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread David M . Lloyd
On Thu, 16 Feb 2023 19:37:18 GMT, ExE Boss wrote: >> David M. Lloyd has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Use a unique index for the dumped lambda class instead of a time stamp > > src/java.base/share/classes/java/lang/invoke/I

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v8]

2023-02-16 Thread Ian Graves
On Thu, 16 Feb 2023 19:08:39 GMT, Mandy Chung wrote: >> Ian Graves has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Updating properties > > src/jdk.jlink/share/classes/jdk/tools/jlink/internal/ImagePluginConfiguration.java > line 57: >

Re: RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask

2023-02-16 Thread Viktor Klang
On Thu, 16 Feb 2023 17:10:17 GMT, Paul Sandoz wrote: >> I noticed when looking at the code that there was no real need to use a CHM >> to perform the tracking of activation in an ordered fashion on >> ForEachOrderedTask, but instead a VarHandle can be used, reducing >> allocations and indirect

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread ExE Boss
On Thu, 16 Feb 2023 19:35:54 GMT, David M. Lloyd wrote: >> The class generated for lambda proxies is now defined as a hidden class. >> This means that the counter, which was used to ensure a unique class name >> and avoid clashes, is now redundant. In addition to performing redundant >> work,

Re: RFR: JDK-8302028: Port fdlibm atan2 to Java

2023-02-16 Thread Joe Darcy
On Thu, 16 Feb 2023 19:30:06 GMT, Joe Darcy wrote: > Working down the porting list, next stop, atan2. Diffs of the various ports, starting with the original C vs the transliteration port: $ diff -w Atan2.c Atan2.translit.java 1c1,4 < /* __ieee754_atan2(y,x) --- > /** > * Returns the

RFR: JDK-8302028: Port fdlibm atan2 to Java

2023-02-16 Thread Joe Darcy
Working down the porting list, next stop, atan2. - Commit messages: - JDK-8302028: Port fdlibm atan2 to Java Changes: https://git.openjdk.org/jdk/pull/12608/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=12608&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8302028

Re: RFR: 8292914: Drop the counter from lambda class names [v6]

2023-02-16 Thread David M . Lloyd
> The class generated for lambda proxies is now defined as a hidden class. This > means that the counter, which was used to ensure a unique class name and > avoid clashes, is now redundant. In addition to performing redundant work, > this also impacts build reproducibility for native image gener

Re: RFR: 8292914: Drop the counter from lambda class names [v5]

2023-02-16 Thread David M . Lloyd
On Thu, 16 Feb 2023 14:06:54 GMT, David M. Lloyd wrote: >> The class generated for lambda proxies is now defined as a hidden class. >> This means that the counter, which was used to ensure a unique class name >> and avoid clashes, is now redundant. In addition to performing redundant >> work,

Re: RFR: 8293667: Align jlink's --compress option with jmod's --compress option [v8]

2023-02-16 Thread Mandy Chung
On Thu, 16 Feb 2023 03:35:31 GMT, Ian Graves wrote: >> This is an approach to adding a flag to jlink that will allow --compress to >> take the same types of arguments as jmod, thus bringing the two into >> alignment. This likely requires a CSR and a discussion on whether we should >> deprecate

Re: RFR: 8292914: Drop the counter from lambda class names [v5]

2023-02-16 Thread Ioi Lam
On Thu, 16 Feb 2023 14:06:54 GMT, David M. Lloyd wrote: >> The class generated for lambda proxies is now defined as a hidden class. >> This means that the counter, which was used to ensure a unique class name >> and avoid clashes, is now redundant. In addition to performing redundant >> work,

Re: RFR: 8292914: Drop the counter from lambda class names [v5]

2023-02-16 Thread David M . Lloyd
On Thu, 16 Feb 2023 14:06:54 GMT, David M. Lloyd wrote: >> The class generated for lambda proxies is now defined as a hidden class. >> This means that the counter, which was used to ensure a unique class name >> and avoid clashes, is now redundant. In addition to performing redundant >> work,

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-16 Thread Raffaello Giulietti
On Thu, 16 Feb 2023 16:51:43 GMT, Raffaello Giulietti wrote: > It can be shown that 5 divides `intVal` if and only if it divides the `long` > sum of all `int`s in the mag array of `intVal`. More precisely, the sum must be computed over the `mag` elements taken as _unsigned_ values: `sum += ma

Re: RFR: 8301873: Avoid string decoding in ZipFile.Source.getEntryPos [v15]

2023-02-16 Thread Lance Andersen
On Wed, 15 Feb 2023 11:44:17 GMT, Eirik Bjorsnos wrote: >> After finding a hash match, getEntryPos needs to compare the lookup name up >> to the encoded entry name in the CEN. This comparison is done by decoding >> the entry name into a String. The names can then be compared using the >> Strin

Re: RFR: 8302590: Add String.indexOf(int ch, int fromIndex, int toIndex)

2023-02-16 Thread Raffaello Giulietti
On Thu, 16 Feb 2023 17:16:35 GMT, Raffaello Giulietti wrote: > Add an `indexOf()` variant allowing to specify both a lower and an upper > bound on the search. The underlying functionality is already present in non-publicly accessible methods. These are intrinsified, leveraging SIMD instructio

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-16 Thread Andriy Plokhotnyuk
On Thu, 16 Feb 2023 16:51:43 GMT, Raffaello Giulietti wrote: > After making sure that `intVal` is even, and before attempting a division by > a power of 10, it might help to check if 5 divides `intVal` in the first > place. If it doesn't, there no point in performing the division. > > It can

RFR: 8302590: Add String.indexOf(int ch, int fromIndex, int toIndex)

2023-02-16 Thread Raffaello Giulietti
Add an `indexOf()` variant allowing to specify both a lower and an upper bound on the search. - Commit messages: - 8302590: Add String.indexOf(int ch, int fromIndex, int toIndex) Changes: https://git.openjdk.org/jdk/pull/12600/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr

Re: RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask

2023-02-16 Thread Paul Sandoz
On Tue, 31 Jan 2023 10:57:58 GMT, Viktor Klang wrote: > I noticed when looking at the code that there was no real need to use a CHM > to perform the tracking of activation in an ordered fashion on > ForEachOrderedTask, but instead a VarHandle can be used, reducing allocations > and indirection

Re: RFR: 8301627: System.exit and Runtime.exit debug logging [v4]

2023-02-16 Thread Sean Mullan
On Tue, 14 Feb 2023 18:56:29 GMT, Roger Riggs wrote: >> It can be difficult to find the cause of calls to >> `java.lang.System.exit(status)` and `Runtime.exit(status)` because the Java >> runtime exits. >> The status value and stack trace are logged using the System Logger named >> `java.lang.

Re: RFR: 8302204: Optimize BigDecimal.divide

2023-02-16 Thread Raffaello Giulietti
On Fri, 10 Feb 2023 10:00:05 GMT, Xiaowei Lu wrote: > [JDK-8269667](https://bugs.openjdk.org/browse/JDK-8269667) has uncovered the > poor performance of BigDecimal.divide under certain circumstance. > > We confront similar situations when benchmarking Spark3 on TPC-DS test kit. > According to

Re: RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask

2023-02-16 Thread Viktor Klang
On Thu, 16 Feb 2023 15:01:34 GMT, Per Minborg wrote: >> I noticed when looking at the code that there was no real need to use a CHM >> to perform the tracking of activation in an ordered fashion on >> ForEachOrderedTask, but instead a VarHandle can be used, reducing >> allocations and indirect

RFR: 8302667: Improve message format when failing to load symbols or libraries

2023-02-16 Thread Julian Waters
DLL_ERROR4 is a macro expanding to an error message when a failure to load a generic item (shared libraries or an exported symbol from said libraries for example) occurs. "Error: loading:" is not a very pretty message, so this small change results in "Error: Failed to load %s" instead, which loo

Re: RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask

2023-02-16 Thread Per Minborg
On Tue, 31 Jan 2023 10:57:58 GMT, Viktor Klang wrote: > I noticed when looking at the code that there was no real need to use a CHM > to perform the tracking of activation in an ordered fashion on > ForEachOrderedTask, but instead a VarHandle can be used, reducing allocations > and indirection

Re: RFR: 8294982: Implementation of Classfile API [v20]

2023-02-16 Thread Maurizio Cimadamore
On Thu, 16 Feb 2023 10:41:33 GMT, Adam Sotona wrote: >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests consolidating JDK class files parsing, generating, >> and transforming >> ([JDK-8294957](https://bu

RFR: JDK-8302666: Replace CHM with VarHandle in ForeachOrderedTask

2023-02-16 Thread Viktor Klang
I noticed when looking at the code that there was no real need to use a CHM to perform the tracking of activation in an ordered fashion on ForEachOrderedTask, but instead a VarHandle can be used, reducing allocations and indirection. - Commit messages: - JDK-8302666: Replace CHM wi

Re: RFR: 8302659: Modernize Windows native code for NetworkInterface

2023-02-16 Thread Daniel Fuchs
On Thu, 16 Feb 2023 14:32:15 GMT, Rich DiCroce wrote: > Improves performance and correctness, as discussed on the net-dev mailing > list. FWIW - there is a perl script located in `make/scripts/normalizer.pl` that can be run on modified sources to fix up whitespace and CRLF issues when jcheck

RFR: 8302659: Modernize Windows native code for NetworkInterface

2023-02-16 Thread Rich DiCroce
Improves performance and correctness, as discussed on the net-dev mailing list. - Commit messages: - Fix whitespace issues - Remove executable bit from NetworkInterface.c - Rewrite Windows native code for NetworkInterface to improve performance and correctness Changes: https://gi

Re: RFR: 8292914: Drop the counter from lambda class names [v5]

2023-02-16 Thread David M . Lloyd
> The class generated for lambda proxies is now defined as a hidden class. This > means that the counter, which was used to ensure a unique class name and > avoid clashes, is now redundant. In addition to performing redundant work, > this also impacts build reproducibility for native image gener

Re: RFR: 8294982: Implementation of Classfile API [v20]

2023-02-16 Thread Maurizio Cimadamore
On Thu, 16 Feb 2023 12:46:09 GMT, Maurizio Cimadamore wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> added 4-byte Unicode text to Utf8EntryTest > > src/java.base/share/classes/jdk/internal/classfile/impl/SplitCons

Re: RFR: 8294982: Implementation of Classfile API [v20]

2023-02-16 Thread Maurizio Cimadamore
On Thu, 16 Feb 2023 10:41:33 GMT, Adam Sotona wrote: >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests consolidating JDK class files parsing, generating, >> and transforming >> ([JDK-8294957](https://bu

Re: RFR: 8292914: Drop the counter from lambda class names [v4]

2023-02-16 Thread David M . Lloyd
On Thu, 16 Feb 2023 01:42:16 GMT, David M. Lloyd wrote: >> The class generated for lambda proxies is now defined as a hidden class. >> This means that the counter, which was used to ensure a unique class name >> and avoid clashes, is now redundant. In addition to performing redundant >> work,

Re: RFR: 8294982: Implementation of Classfile API [v20]

2023-02-16 Thread Jens Lidestrom
On Thu, 16 Feb 2023 10:41:33 GMT, Adam Sotona wrote: >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests consolidating JDK class files parsing, generating, >> and transforming >> ([JDK-8294957](https://bu

Re: RFR: 8294982: Implementation of Classfile API [v20]

2023-02-16 Thread Maurizio Cimadamore
On Thu, 16 Feb 2023 11:27:18 GMT, Maurizio Cimadamore wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> added 4-byte Unicode text to Utf8EntryTest > > src/java.base/share/classes/jdk/internal/classfile/components/Cod

Re: RFR: 8294982: Implementation of Classfile API [v20]

2023-02-16 Thread Maurizio Cimadamore
On Thu, 16 Feb 2023 10:41:33 GMT, Adam Sotona wrote: >> This is root pull request with Classfile API implementation, tests and >> benchmarks initial drop into JDK. >> >> Following pull requests consolidating JDK class files parsing, generating, >> and transforming >> ([JDK-8294957](https://bu

Re: RFR: 8294982: Implementation of Classfile API [v15]

2023-02-16 Thread Adam Sotona
On Thu, 16 Feb 2023 10:25:04 GMT, Maurizio Cimadamore wrote: >> I'm not quite sure what exactly do you propose. >> `ConstantPool` should not accept anything as it is read-only, so "accept" >> would be confusing. >> `ConstantPoolBuilder::maybeClone` is rather a `Function`, where the name >> mig

Re: RFR: 8294982: Implementation of Classfile API [v15]

2023-02-16 Thread Adam Sotona
On Thu, 16 Feb 2023 10:46:23 GMT, Adam Sotona wrote: >> As I read the javadoc (I have not looked at impl yet), this method can >> effectively be used to add an entry to the constant pool (if the entry does >> not yet exist - in which case existing entry is returned). >> >> After having looked

Re: RFR: 8294982: Implementation of Classfile API [v20]

2023-02-16 Thread Adam Sotona
> This is root pull request with Classfile API implementation, tests and > benchmarks initial drop into JDK. > > Following pull requests consolidating JDK class files parsing, generating, > and transforming ([JDK-8294957](https://bugs.openjdk.org/browse/JDK-8294957)) > will chain to this one. >

Re: RFR: 8294982: Implementation of Classfile API [v15]

2023-02-16 Thread Maurizio Cimadamore
On Wed, 15 Feb 2023 08:20:19 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/constantpool/ConstantPoolBuilder.java >> line 537: >> >>> 535: * @param the type of the entry >>> 536: */ >>> 537: T maybeClone(T entry); >> >> This feels a more primitive

Re: RFR: 8294982: Implementation of Classfile API [v15]

2023-02-16 Thread Adam Sotona
On Fri, 10 Feb 2023 11:16:22 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/constantpool/Utf8Entry.java >> line 47: >> >>> 45: * @param s the string to compare to >>> 46: */ >>> 47: boolean equalsString(String s); >> >> Whatif the provided string co