Integrated: 8325373: Improve StackCounter error reporting for bad switch cases

2024-04-25 Thread Adam Sotona
On Tue, 23 Apr 2024 12:59:18 GMT, Adam Sotona wrote: > ClassFile API `StackMapGenerator` attaches print or hex dump of the method to > an error message. > However there is no such attachment when the stack maps generation is turned > off. > > This patch moves class print/

Re: RFR: 8325373: Improve StackCounter error reporting for bad switch cases [v2]

2024-04-25 Thread Adam Sotona
by `StackMapGenerator` and `StackCounter` to provide the same level of > details in case of an error. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: applied suggested changes

Re: RFR: 8325373: Improve StackCounter error reporting for bad switch cases [v2]

2024-04-25 Thread Adam Sotona
On Wed, 24 Apr 2024 22:48:30 GMT, Paul Sandoz wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> applied suggested changes > > src/java.base/share/classes/jdk/internal/classfile/impl

Re: RFR: 8322847: java.lang.classfile.BufWriter should specify @throws for its writeXXX methods

2024-04-25 Thread Adam Sotona
On Wed, 24 Apr 2024 22:43:21 GMT, Paul Sandoz wrote: > This looks good, but for completeness it will need a CSR. CSR created, thanks. - PR Comment: https://git.openjdk.org/jdk/pull/18913#issuecomment-2076498451

Re: RFR: 8330684: ClassFile API runs into StackOverflowError while parsing certain class' bytes

2024-04-24 Thread Adam Sotona
On Wed, 24 Apr 2024 21:52:11 GMT, Paul Sandoz wrote: > Rather than duplicating some checks I wonder if it is possible to add a > private method `entryByIndex(int index, int expectedTag)` that the existing > `entryByIndex` defers to. If the `expectedTag` is non-negative then it checks > `tag`

RFR: 8325373: Improve StackCounter error reporting for bad switch cases

2024-04-23 Thread Adam Sotona
ClassFile API `StackMapGenerator` attaches print or hex dump of the method to an error message. However there is no such attachment when the stack maps generation is turned off. This patch moves class print/dump to `impl.Util::dumpMethod`, so it is shared by `StackMapGenerator` and

RFR: 8322847: java.lang.classfile.BufWriter should specify @throws for its writeXXX methods

2024-04-23 Thread Adam Sotona
This patch adds missing `@throws` javadoc annotations to `java.lang.classfile.BufWriter`. Please review. Thank you, Adam - Commit messages: - 8322847: java.lang.classfile.BufWriter should specify @throws for its writeXXX methods Changes:

RFR: 8330684: ClassFile API runs into StackOverflowError while parsing certain class' bytes

2024-04-23 Thread Adam Sotona
ClassFile API dives into the nested constant pool entries without type restrictions, while parsing a class file. Validation of the entry is performed post-parsing. Specifically corrupted constant pool entry may cause infinite loop during parsing and throws SOE. This patch resolves the issue by

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v7]

2024-04-18 Thread Adam Sotona
come. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 13 commits: - Merge branch 'master' into JDK-8294960-invoke # Conflicts: # src/j

Re: RFR: 8330458: Add missing @since tag to ClassFile.JAVA_23_VERSION

2024-04-17 Thread Adam Sotona
On Wed, 17 Apr 2024 20:46:26 GMT, Joe Darcy wrote: > 8330458: Add missing @since tag to ClassFile.JAVA_23_VERSION Marked as reviewed by asotona (Reviewer). - PR Review: https://git.openjdk.org/jdk/pull/18828#pullrequestreview-2007907265

Integrated: 8330467: NoClassDefFoundError when lambda is in a hidden class

2024-04-17 Thread Adam Sotona
On Wed, 17 Apr 2024 08:46:59 GMT, Adam Sotona wrote: > Current implementation of `LambdaMetafactory` does not allow to use lambdas > in hidden classes. Invocation throws `NoClassDefFoundError` instead. > > This patch includes lambda implementation in a hidden class under

Re: RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class [v4]

2024-04-17 Thread Adam Sotona
ch also fixes `j/l/i/defineHiddenClass/BasicTest::testLambda` to > correctly cover this test case. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update src/java

Re: RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class [v2]

2024-04-17 Thread Adam Sotona
On Wed, 17 Apr 2024 15:39:11 GMT, Paul Sandoz wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> applied suggested changes > > test/jdk/java/lang/invoke/defineHiddenClass/src/Lambda.

Re: RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class [v3]

2024-04-17 Thread Adam Sotona
ch also fixes `j/l/i/defineHiddenClass/BasicTest::testLambda` to > correctly cover this test case. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with two additional commits since the last revision: - typo in comm

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v6]

2024-04-17 Thread Adam Sotona
On Wed, 17 Apr 2024 15:21:32 GMT, Adam Sotona wrote: >> java.base java.lang.invoke package heavily uses ASM to generate lambdas and >> method handles. >> >> This patch converts ASM calls to Classfile API. >> >> This PR is continuation of https://github.c

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v6]

2024-04-17 Thread Adam Sotona
come. > > Please review. > > Thank you, > Adam Adam Sotona 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 12 additional commits since the last

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v5]

2024-04-17 Thread Adam Sotona
On Tue, 16 Apr 2024 22:49:28 GMT, Mandy Chung wrote: >> Adam Sotona 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 10 addi

Re: RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class [v2]

2024-04-17 Thread Adam Sotona
ch also fixes `j/l/i/defineHiddenClass/BasicTest::testLambda` to > correctly cover this test case. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: applied suggested changes --

Re: RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class

2024-04-17 Thread Adam Sotona
On Wed, 17 Apr 2024 09:14:31 GMT, Chen Liang wrote: >> Current implementation of `LambdaMetafactory` does not allow to use lambdas >> in hidden classes. Invocation throws `NoClassDefFoundError` instead. >> >> This patch includes lambda implementation in a hidden class under the >> special

Re: RFR: 8330182: Start of release updates for JDK 24 [v2]

2024-04-17 Thread Adam Sotona
On Wed, 17 Apr 2024 05:43:12 GMT, Joe Darcy wrote: >> Get JDK 24 underway. > > Joe Darcy has updated the pull request incrementally with two additional > commits since the last revision: > > - Correct release date as observed in review feedback. > - Improve javadoc of class file update.

RFR: 8330467: NoClassDefFoundError when lambda is in a hidden class

2024-04-17 Thread Adam Sotona
Current implementation of `LambdaMetafactory` does not allow to use lambdas in hidden classes. Invocation throws `NoClassDefFoundError` instead. This patch includes lambda implementation in a hidden class under the special handling of `useImplMethodHandle`. The patch also fixes

Integrated: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode

2024-04-16 Thread Adam Sotona
On Tue, 2 Apr 2024 09:37:52 GMT, Adam Sotona wrote: > `IllegalArgumentException` thrown by some static factory methods of the > following `java.lang.classfile.instruction` interfaces are not documented: > > - `ArrayLoadInstruction` > - `ArrayStoreInstruction` > -

Re: RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v6]

2024-04-15 Thread Adam Sotona
ind and some methods > have low practical use. > > This patch revisits the `CodeBuilder` API methods and introduces some changes. > > For more details, please, visit the [CSR > ](https://bugs.openjdk.org/browse/JDK-8323067) > > Please review. > > Thank you, > A

Integrated: 8329955: Class-File API ClassPrinter does not print bootstrap methods arguments

2024-04-09 Thread Adam Sotona
On Tue, 9 Apr 2024 13:39:47 GMT, Adam Sotona wrote: > Class-File API `ClassPrinter` prints many useful info about bootstrap methods > and invoke dynamic instructions, however bootstrap methods arguments are > missing. > This patch fixes bootstrap methods and invoke dynamic

Re: RFR: 8329955: Class-File API ClassPrinter does not print bootstrap methods arguments

2024-04-09 Thread Adam Sotona
On Tue, 9 Apr 2024 14:21:59 GMT, Brian Goetz wrote: >> Class-File API `ClassPrinter` prints many useful info about bootstrap >> methods and invoke dynamic instructions, however bootstrap methods arguments >> are missing. >> This patch fixes bootstrap methods and invoke dynamic instructions

Integrated: 8325371: Missing ClassFile.Option in package summary

2024-04-09 Thread Adam Sotona
On Wed, 3 Apr 2024 08:48:43 GMT, Adam Sotona wrote: > Some of the Class-File API options were not mentioned in the package summary > and one exception mentioned `ClassFile.DeadLabelsOption` javadoc was wrong. > This patch fixes the javadoc. > > Please review. > > Thank y

Re: RFR: 8325371: Missing ClassFile.Option in package summary

2024-04-09 Thread Adam Sotona
On Tue, 9 Apr 2024 14:22:37 GMT, Brian Goetz wrote: >> Some of the Class-File API options were not mentioned in the package summary >> and one exception mentioned `ClassFile.DeadLabelsOption` javadoc was wrong. >> This patch fixes the javadoc. >> >> Please review. >> >> Thank you, >> Adam > >

Re: RFR: 8323707: Adjust Classfile API's type arg model to better represent the embodied type [v4]

2024-04-09 Thread Adam Sotona
` to `NONE` > > Chen Liang has updated the pull request with a new target base due to a merge > or a rebase. The pull request now contains 13 commits: > > - Merge branch 'master' of https://github.com/openjdk/jdk into > fix/typearg-model > - Missed renaming in tests, thanks to

Re: RFR: JDK-8326836 Incorrect `@since` Tags for ClassSignature methods [v2]

2024-04-09 Thread Adam Sotona
On Wed, 20 Mar 2024 02:10:35 GMT, Nizar Benalla wrote: >> # Issue >> - [JDK-8326836](https://bugs.openjdk.org/browse/JDK-8326836): changes were >> made to the method signatures but this modification isn't reflected in the @ >> since tags. The @ since tags need to be updated. >> >> I changed

RFR: 8329955: Class-File API ClassPrinter does not print bootstrap methods arguments

2024-04-09 Thread Adam Sotona
Class-File API `ClassPrinter` prints many useful info about bootstrap methods and invoke dynamic instructions, however bootstrap methods arguments are missing. This patch fixes bootstrap methods and invoke dynamic instructions printing. `ClassPrinterTest` is extended to print bootstrap method

Integrated: 8325485: IncrementInstructions.of(int, int) is not storing the args

2024-04-09 Thread Adam Sotona
On Thu, 8 Feb 2024 13:18:41 GMT, Adam Sotona wrote: > ClassFile API provides two sets of instructions implementations (bound and > unbound). > Unbound implementation of `IncrementInstruction::constant` returns invalid > value. > This bug discovered a hole in the ClassFile AP

Integrated: 8329527: Opcode.IFNONNULL.primaryTypeKind() is not ReferenceType

2024-04-09 Thread Adam Sotona
On Wed, 3 Apr 2024 08:15:52 GMT, Adam Sotona wrote: > `Opcode.IFNONNULL.primaryTypeKind()` wrongly returned `IntType` instead of > the right `ReferenceType`. > Primary type kinds of `BRANCH` opcodes have yet no functional effect in the > Class-File API. > This simple patch

Re: RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode [v4]

2024-04-09 Thread Adam Sotona
> > `NewPrimitiveArrayInstruction::of` factory method also does not perform the > check for invalid argument. > > This patch adds all the missing `@throws` Javadoc tags and fixes > `NewPrimitiveArrayInstruction::of` factory method to perform the argument > check. > >

Integrated: 8326744: Class-File API transition to Second Preview

2024-04-09 Thread Adam Sotona
On Tue, 27 Feb 2024 08:45:12 GMT, Adam Sotona wrote: > Task providing Class-File API transition to Second Preview. This pull request has now been integrated. Changeset: 19a99d02 Author: Adam Sotona URL: https://git.openjdk.org/jdk/commit/19a99d023e32fa9f4d26b76bd36993719e1df

Re: RFR: 8294960: Convert java.base/java.lang.invoke package to use the Classfile API to generate lambdas and method handles [v5]

2024-04-04 Thread Adam Sotona
come. > > Please review. > > Thank you, > Adam Adam Sotona 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 10 additional commits since the last

Re: RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode [v3]

2024-04-03 Thread Adam Sotona
> > `NewPrimitiveArrayInstruction::of` factory method also does not perform the > check for invalid argument. > > This patch adds all the missing `@throws` Javadoc tags and fixes > `NewPrimitiveArrayInstruction::of` factory method to perform the argument > check. > >

Re: RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode [v2]

2024-04-03 Thread Adam Sotona
On Wed, 3 Apr 2024 11:42:04 GMT, ExE Boss wrote: > The following factory methods are also missing `@throws  > IllegalArgumentException`: > > * `ConstantInstruction::ofIntrinsic` > * `ConstantInstruction::ofArgument` > * `ConstantInstruction::ofLoad` Great catch, I'll add them, thank you!

Re: RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode [v2]

2024-04-03 Thread Adam Sotona
> > `NewPrimitiveArrayInstruction::of` factory method also does not perform the > check for invalid argument. > > This patch adds all the missing `@throws` Javadoc tags and fixes > `NewPrimitiveArrayInstruction::of` factory method to perform the argument > check. > >

RFR: 8325371: Missing ClassFile.Option in package summary

2024-04-03 Thread Adam Sotona
Some of the Class-File API options were not mentioned in the package summary and one exception mentioned `ClassFile.DeadLabelsOption` javadoc was wrong. This patch fixes the javadoc. Please review. Thank you, Adam - Commit messages: - 8325371: Missing ClassFile.Option in package

RFR: 8329527: Opcode.IFNONNULL.primaryTypeKind() is not ReferenceType

2024-04-03 Thread Adam Sotona
`Opcode.IFNONNULL.primaryTypeKind()` wrongly returned `IntType` instead of the right `ReferenceType`. Primary type kinds of `BRANCH` opcodes have yet no functional effect in the Class-File API. This simple patch fixes the typo. Please review. Thank you, Adam - Commit messages: -

RFR: 8329099: Undocumented exception thrown by Instruction factory methods accepting Opcode

2024-04-02 Thread Adam Sotona
`IllegalArgumentException` thrown by some static factory methods of the following `java.lang.classfile.instruction` interfaces are not documented: - `ArrayLoadInstruction` - `ArrayStoreInstruction` - `BranchInstruction` - `ConvertInstruction` - `DiscontinuedInstruction` - `FieldInstruction` -

Re: RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v2]

2024-03-22 Thread Adam Sotona
On Fri, 22 Mar 2024 02:17:58 GMT, David Holmes wrote: >> Adam Sotona has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains 26 commits: >> >> - Merge remote-tracking branch 'openjdk/master' into >>

Re: RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v3]

2024-03-22 Thread Adam Sotona
. > > Also new `VerifierSelfTest::testParserVerifier` has been added. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: added references to jvms - Changes: - all: ht

Re: RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v2]

2024-03-22 Thread Adam Sotona
On Thu, 21 Mar 2024 14:40:37 GMT, Adam Sotona wrote: >> ClassFile API `jdk.internal.classfile.verifier.VerifierImpl` performed only >> bytecode-level class verification. >> This patch adds `jdk.internal.classfile.verifier.ParserVerifier` with >> additional class checks

Re: RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp [v2]

2024-03-21 Thread Adam Sotona
. > > Also new `VerifierSelfTest::testParserVerifier` has been added. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 26 commits: - Merge remote-tracking branch 'openjd

RFR: 8320396: Class-File API ClassModel::verify should include checks from hotspot/share/classfile/classFileParser.cpp

2024-03-21 Thread Adam Sotona
ClassFile API `jdk.internal.classfile.verifier.VerifierImpl` performed only bytecode-level class verification. This patch adds `jdk.internal.classfile.verifier.ParserVerifier` with additional class checks inspired by `hotspot/share/classfile/classFileParser.cpp`. Also new

Re: RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v4]

2024-03-06 Thread Adam Sotona
On Wed, 6 Mar 2024 15:31:40 GMT, Chen Liang wrote: > Looking at 8326836 #18030, we might need `@since` tags on the new API methods. Thanks for pointing it out, I've added them. - PR Comment: https://git.openjdk.org/jdk/pull/17282#issuecomment-1981230434

Re: RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v5]

2024-03-06 Thread Adam Sotona
ind and some methods > have low practical use. > > This patch revisits the `CodeBuilder` API methods and introduces some changes. > > For more details, please, visit the [CSR > ](https://bugs.openjdk.org/browse/JDK-8323067) > > Please review. > > Thank you, > A

Re: RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v4]

2024-03-06 Thread Adam Sotona
ind and some methods > have low practical use. > > This patch revisits the `CodeBuilder` API methods and introduces some changes. > > For more details, please, visit the [CSR > ](https://bugs.openjdk.org/browse/JDK-8323067) > > Please review. > > Thank you, > A

Re: RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v3]

2024-03-05 Thread Adam Sotona
ind and some methods > have low practical use. > > This patch revisits the `CodeBuilder` API methods and introduces some changes. > > For more details, please, visit the [CSR > ](https://bugs.openjdk.org/browse/JDK-8323067) > > Please review. > > Thank you, > A

Integrated: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes

2024-03-05 Thread Adam Sotona
On Fri, 15 Dec 2023 12:54:27 GMT, Adam Sotona wrote: > java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any com

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v12]

2024-03-04 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcome. > > Please review. &

Integrated: 8323183: ClassFile API performance improvements

2024-03-04 Thread Adam Sotona
On Mon, 8 Jan 2024 13:38:16 GMT, Adam Sotona wrote: > ClassFile API performance related improvements have been separated from > #17121 into this PR. > > These improvements are important to minimize performance regression of > 8294961: Convert java.base/java.lang.reflect.ProxyG

Re: RFR: 8323183: ClassFile API performance improvements [v7]

2024-03-04 Thread Adam Sotona
On Mon, 4 Mar 2024 10:08:27 GMT, Claes Redestad wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Update >> src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecod

Re: RFR: 8323183: ClassFile API performance improvements [v8]

2024-03-04 Thread Adam Sotona
oxy classes #17121 > > Please review. > > Thanks, > Adam Adam Sotona 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 24 additional

Re: RFR: 8323183: ClassFile API performance improvements [v7]

2024-03-04 Thread Adam Sotona
On Mon, 15 Jan 2024 12:01:37 GMT, Adam Sotona wrote: >> ClassFile API performance related improvements have been separated from >> #17121 into this PR. >> >> These improvements are important to minimize performance regression of >> 8294961: Convert java.base/ja

RFR: 8326744: Class-File API transition to Second Preview

2024-02-27 Thread Adam Sotona
Task providing Class-File API transition to Second Preview. - Commit messages: - 8326744: Class-File API transition to Second Preview Changes: https://git.openjdk.org/jdk/pull/18021/files Webrev: https://webrevs.openjdk.org/?repo=jdk=18021=00 Issue:

Re: RFR: 8323707: Adjust Classfile API's type arg model to better represent the embodied type [v3]

2024-02-26 Thread Adam Sotona
On Thu, 22 Feb 2024 05:38:19 GMT, Chen Liang wrote: >> API changes as discussed on the mailing list: >> https://mail.openjdk.org/pipermail/classfile-api-dev/2023-November/000419.html >> >> Additional questions: >> 1. Whether to rename `WildcardIndicator.DEFAULT` to `NONE` > > Chen Liang has

Re: RFR: 8325485: IncrementInstructions.of(int, int) is not storing the args [v2]

2024-02-09 Thread Adam Sotona
ngTransformation`. Second pass has been > added to discover bugs in unbound-to-unbound instruction conversions. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update tes

RFR: 8325485: IncrementInstructions.of(int, int) is not storing the args

2024-02-08 Thread Adam Sotona
ClassFile API provides two sets of instructions implementations (bound and unbound). Unbound implementation of `IncrementInstruction::constant` returns invalid value. This bug discovered a hole in the ClassFile API test coverage. This patch provides very simple fix of `IncrementInstruction`

Re: RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v2]

2024-02-05 Thread Adam Sotona
On Mon, 5 Feb 2024 17:23:54 GMT, Paul Sandoz wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> removed CodeBuilder::newObject methods > > src/java.base/share/classes/java/lang/class

Re: RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface [v2]

2024-02-05 Thread Adam Sotona
ind and some methods > have low practical use. > > This patch revisits the `CodeBuilder` API methods and introduces some changes. > > For more details, please, visit the [CSR > ](https://bugs.openjdk.org/browse/JDK-8323067) > > Please review. > > Thank you, > A

RFR: 8323058: Revisit j.l.classfile.CodeBuilder API surface

2024-02-01 Thread Adam Sotona
`java.lang.classfile.CodeBuilder` contains more than 230 API methods. Existing ClassFile API use cases proved the concept one big CodeBuilder is comfortable. However there are some redundancies, glitches in the naming conventions, some frequently used methods are hard to find and some methods

Re: RFR: 8294977: Convert test/jdk/java tests from ASM library to Classfile API [v11]

2024-01-17 Thread Adam Sotona
On Sun, 17 Dec 2023 23:11:10 GMT, Chen Liang wrote: >> Summaries: >> 1. A few recommendations about updating the constant API is made at >> https://mail.openjdk.org/pipermail/classfile-api-dev/2023-March/000233.html >> and I may update this patch shall the API changes be integrated before >>

Re: RFR: 8323183: ClassFile API performance improvements [v7]

2024-01-15 Thread Adam Sotona
oxy classes #17121 > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/jdk/internal/classfile/impl/StackMapDecoder.java Co-authored-by: Andrey

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v11]

2024-01-10 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcome. > > Please review. &

Re: RFR: 8323183: ClassFile API performance improvements [v6]

2024-01-09 Thread Adam Sotona
On Tue, 9 Jan 2024 13:30:58 GMT, Adam Sotona wrote: >> ClassFile API performance related improvements have been separated from >> #17121 into this PR. >> >> These improvements are important to minimize performance regression of >> 8294961: Convert java.base/ja

Re: RFR: 8323183: ClassFile API performance improvements [v6]

2024-01-09 Thread Adam Sotona
oxy classes #17121 > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with three additional commits since the last revision: - updated copyright year - reverted custom method slots counting in StackCounter - improved and extended Generat

Re: RFR: 8323183: ClassFile API performance improvements [v5]

2024-01-09 Thread Adam Sotona
oxy classes #17121 > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update src/java.base/share/classes/jdk/internal/classfile/impl/StackCounter.java Co-authored-by: liach <78

Re: RFR: 8323183: ClassFile API performance improvements

2024-01-08 Thread Adam Sotona
On Mon, 8 Jan 2024 14:43:58 GMT, Chen Liang wrote: > You need to update the slot counting from `DirectCodeBuilder` and > `StackMapDecoder` to fully avoid creating any MethodTypeDesc. It would be good to avoid all bottlenecks, however not all of them have equal effect. This patch avoids MTD

Re: RFR: 8323183: ClassFile API performance improvements [v4]

2024-01-08 Thread Adam Sotona
On Mon, 8 Jan 2024 14:19:12 GMT, Maurizio Cimadamore wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> applied suggested changes > > src/java.base/share/classes/jdk/internal/classfile/

Re: RFR: 8323183: ClassFile API performance improvements [v4]

2024-01-08 Thread Adam Sotona
oxy classes #17121 > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: applied suggested changes - Changes: - all: https://git.openjdk.org/jdk/pull/17306/files - new:

Re: RFR: 8323183: ClassFile API performance improvements [v2]

2024-01-08 Thread Adam Sotona
oxy classes #17121 > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: improved StackMapDescoder::initFrameLocals performance - Changes: - all: https://git.openjdk.org/jd

Re: RFR: 8323183: ClassFile API performance improvements [v3]

2024-01-08 Thread Adam Sotona
On Mon, 8 Jan 2024 14:20:17 GMT, Maurizio Cimadamore wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> applied suggested changes > > src/java.base/share/classes/jdk/internal/classfile/

Re: RFR: 8323183: ClassFile API performance improvements [v3]

2024-01-08 Thread Adam Sotona
oxy classes #17121 > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: applied suggested changes - Changes: - all: https://git.openjdk.org/jdk/pull/17306/files - new:

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Sun, 7 Jan 2024 18:24:02 GMT, Chen Liang wrote: > Also `StackMapDecoder::initFrameFromLocals(ClassEntry, ...)` can benefit from > 2 changes: > > 1. Iterate MTD by index instead of creating copies I'll add this fix to the performance improvements PR, thanks! > 2. Pass ClassEntry from

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v3]

2024-01-08 Thread Adam Sotona
On Fri, 5 Jan 2024 23:55:53 GMT, Mandy Chung wrote: > > Profiling of the benchmarks revealed several slowdowns: > > ``` > > * many expensive conversions from `Class` to `ClassDesc` to > > `ClassEntry`, or even more expensive `MethodTypeDesc` > > > > * building proxy class from scratch from

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Fri, 5 Jan 2024 21:03:28 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> StackCounter fix > > src/java.base/share/classes/java/lang/reflect/ProxyGene

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v10]

2024-01-08 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcome. > > Please review. &

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v9]

2024-01-08 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcome. > > Please review. &

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Fri, 5 Jan 2024 21:23:02 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> StackCounter fix > > src/java.base/share/classes/java/lang/reflect/ProxyGene

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Fri, 5 Jan 2024 20:50:16 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> StackCounter fix > > src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java li

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Fri, 5 Jan 2024 20:45:22 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> StackCounter fix > > src/java.base/share/classes/java/lang/reflect/ProxyGenerator.java li

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v5]

2024-01-08 Thread Adam Sotona
On Sun, 7 Jan 2024 18:16:05 GMT, Chen Liang wrote: >> Original code has been significant in profiler. >> >> >> MethodTypeDesc desc = MethodTypeDesc.of(toClassDesc(returnType), >> >> Arrays.stream(parameterTypes).map(ProxyGenerator::toClassDesc).toArray(ClassDesc[]::new));

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Fri, 5 Jan 2024 20:43:00 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> StackCounter fix > > src/java.base/share/classes/java/lang/reflect/ProxyGenerator.j

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v8]

2024-01-08 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcome. > > Please review. &

RFR: 8323183: ClassFile API performance improvements

2024-01-08 Thread Adam Sotona
ClassFile API performance related improvements have been separated from #17121 into this PR. These improvements are important to minimize performance regression of 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes #17121 Please

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Wed, 3 Jan 2024 12:36:26 GMT, Adam Sotona wrote: >> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy >> classes. >> >> This patch converts it to use Classfile API. >> >> It is continuation of https://github.com/openjdk/jdk/pull/10991

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-08 Thread Adam Sotona
On Sun, 7 Jan 2024 18:18:32 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> StackCounter fix > > src/java.base/share/classes/jdk/internal/classfile/impl/StackCount

Re: RFR: 8319463: ClassSignature should have superclass and superinterfaces as ClassTypeSig [v4]

2024-01-08 Thread Adam Sotona
On Fri, 5 Jan 2024 23:06:30 GMT, Chen Liang wrote: >> Discovered while writing a test for #16513 that >> `ClassSignature.superclassSignature()` does not return a `ClassTypeSig`, yet >> [JVM >> Spec](https://docs.oracle.com/javase/specs/jvms/se21/html/jvms-4.html#jvms-4.7.9.1-4100) >>

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v7]

2024-01-03 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcome. > > Please review. &

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v5]

2024-01-03 Thread Adam Sotona
On Sun, 24 Dec 2023 03:14:44 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> minor StackCounter fix > > src/java.base/share/classes/java/lang/reflect/ProxyGene

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v5]

2024-01-03 Thread Adam Sotona
On Sun, 24 Dec 2023 04:07:07 GMT, Chen Liang wrote: >> This code is part of the **ClassFile API**’s internals, and so it doesn’t >> have access to `ProxyGenerator`’s cached `MethodTypeDesc`s, only the  >> underlying `Utf8Entry`, so it’d need to be parsed. > > I see that now Class return type

Re: RFR: 8294961: Convert java.base/java.lang.reflect.ProxyGenerator to use the Classfile API to generate proxy classes [v6]

2024-01-03 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes. > > This patch converts it to use Classfile API. > > It is continuation of https://github.com/openjdk/jdk/pull/10991 > > Any comments and suggestions are welcome. > > Please review. &

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Thu, 7 Dec 2023 07:53:58 GMT, Adam Sotona wrote: >> ClassFile API throws `IndexOutOfBoundsException` when classfile structure is >> corrupted so the parser attempts to read beyond the classfile bounds. >> General contract is that only `IllegalArgumentException`

Integrated: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown

2024-01-02 Thread Adam Sotona
On Tue, 21 Nov 2023 13:59:23 GMT, Adam Sotona wrote: > ClassFile API throws `IndexOutOfBoundsException` when classfile structure is > corrupted so the parser attempts to read beyond the classfile bounds. > General contract is that only `IllegalArgumentException` or its subclasses is &

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Tue, 2 Jan 2024 07:03:55 GMT, Jaikiran Pai wrote: >> Adam Sotona has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains three commits: >> >> - Merge branch 'master' into JDK-8320360-bounds >> >&

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v3]

2024-01-02 Thread Adam Sotona
his patch wraps `IndexOutOfBoundsExceptions` thrown from all > `ClassReaderImpl.buffer` manipulations into an > `IllegalArgumentException("Reading beyond classfile bounds", iOOBECause)`. > Relevant tests are added. > > Please review. > > Thanks, > Adam Adam Sotona ha

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Tue, 2 Jan 2024 12:41:08 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/ClassReaderImpl.java >> line 283: >> >>> 281: public void copyBytesTo(BufWriter buf, int p, int len) { >>> 282: try { >>> 2

Re: RFR: 8320360: ClassFile.parse: Some defect class files cause unexpected exceptions to be thrown [v2]

2024-01-02 Thread Adam Sotona
On Tue, 2 Jan 2024 07:05:22 GMT, Jaikiran Pai wrote: >> Adam Sotona has updated the pull request with a new target base due to a >> merge or a rebase. The pull request now contains three commits: >> >> - Merge branch 'master' into JDK-8320360-bounds >> >&

<    1   2   3   4   5   6   7   8   9   10   >