Re: RFR: 8294969: Convert jdk.jdeps javap to use the Classfile API [v2]

2023-05-09 Thread Adam Sotona
> javap uses proprietary com.sun.tools.classfile library to parse class files. > > This patch converts javap to use Classfile API. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base due to a merge or a rebase. The p

Re: RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Adam Sotona
On Wed, 26 Apr 2023 15:04:50 GMT, Adam Sotona wrote: > Following improvements implemented: > - Switch over `String` replaced with switch single char > - Binary search for frames in `StackMapGenerator` > - `StackMapGenerator.rawHandlers` with pre-calculated offsets > - `ClassEn

RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Adam Sotona
Following improvements implemented: - Switch over `String` replaced with switch single char - Binary search for frames in `StackMapGenerator` - `StackMapGenerator.rawHandlers` with pre-calculated offsets - `ClassEntry` is caching `ClassDesc` symbol - Caching of type symbols in `NameAndTypeEntry`

Re: RFR: 8306842: Classfile API performance improvements

2023-05-09 Thread Adam Sotona
On Wed, 26 Apr 2023 16:00:07 GMT, Chen Liang wrote: > 1. CodeBuilder.invokeInstruction and CodeBuilder.fieldInstruction can pass > their symbols to the NameAndTypeEntry as well, since it's almost always going > to be used by stack map generation later. Yes, they actually do. CodeBuilder

Integrated: 8305990: Stripping debug info of ASM 9.5 fails

2023-05-09 Thread Adam Sotona
On Fri, 14 Apr 2023 14:02:46 GMT, Adam Sotona wrote: > Classfile API didn't handle transformations of class files version 50 and > below correctly. > > Proposed fix have two parts: > 1. Inflation of branch targets does not depend on StackMapTable attribute > presence for

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v14]

2023-05-09 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with tw

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v13]

2023-05-09 Thread Adam Sotona
On Tue, 9 May 2023 11:59:08 GMT, Maurizio Cimadamore 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 cont

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v13]

2023-05-09 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v12]

2023-05-05 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v11]

2023-05-05 Thread Adam Sotona
On Thu, 4 May 2023 16:19:04 GMT, Adam Sotona wrote: >> Classfile API didn't handle transformations of class files version 50 and >> below correctly. >> >> Proposed fix have two parts: >> 1. Inflation of branch targets does not depend on StackMapTable attribu

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v11]

2023-05-05 Thread Adam Sotona
On Fri, 5 May 2023 02:50:45 GMT, Chen Liang wrote: > Since we want an option to toggle stackmap generation, will you add it to the > Classfile options as a temporary measure, before we keep track of these > options in a stateful object (with hierarchy resolver etc.) like brian > envisioned?

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v11]

2023-05-04 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v10]

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 15:19:02 GMT, Chen Liang wrote: > Also, has brian reviewed the DiscontinuedInstruction API changes? https://mail.openjdk.org/pipermail/classfile-api-dev/2023-April/000292.html - PR Comment: https://git.openjdk.org/jdk/pull/13478#issuecomment-1535028314

Re: RFR: 8304937: BufferedFieldBuilder.Model missing writeTo(DirectClassBuilder)

2023-05-04 Thread Adam Sotona
On Sun, 26 Mar 2023 20:35:20 GMT, Chen Liang wrote: > Please review this simple patch to Classfile API that fixes a missing > override that otherwise affects usage of chained class transforms. A test is > included, that it fails on the missing method without this patch. > > Please review a

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 06:47:50 GMT, Alan Bateman wrote: > Also are you planning to add a test for this? I've added code to `exeJliLaunchTest.c` (executed by `JliLaunchTest`) to test non null terminated arguments. - PR Comment:

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array [v2]

2023-05-04 Thread Adam Sotona
in the while loops instead of looking for zero > termination. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: added test - Changes: - all: https://git.open

Re: RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-04 Thread Adam Sotona
On Thu, 4 May 2023 06:26:53 GMT, David Holmes wrote: >> libjli/java.c's SelectVersion method receives argc and argv but ignores argc >> in some circumstances an instead checks if *argv == 0 in its while loop, >> which results in a segmentation fault if the provided array is not NULL >>

RFR: 8303669: SelectVersion indexes past the end of the argv array

2023-05-03 Thread Adam Sotona
libjli/java.c's SelectVersion method receives argc and argv but ignores argc in some circumstances an instead checks if *argv == 0 in its while loop, which results in a segmentation fault if the provided array is not NULL terminated. This patch counts down argc in the while loops instead of

Integrated: 8306729: Add nominal descriptors of modules and packages to Constants API

2023-05-03 Thread Adam Sotona
On Mon, 24 Apr 2023 11:59:03 GMT, Adam Sotona wrote: > Constants API already provides models for all loadable constants to help > programs manipulating class files and modelling bytecode instructions. > However no models of module and package constants are provided by Constants >

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v10]

2023-05-02 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request with a new target base

Re: RFR: 8306455: Wrong majorVersion for multiple attributes in Classfile API

2023-05-02 Thread Adam Sotona
On Wed, 19 Apr 2023 14:31:36 GMT, Chen Liang wrote: > Spotted the typo for BootstrapMethods, and another review over the API > exposed the typo on PermittedSubclasses. BootstrapMethods is a good catch, however I would rather recommend to remove the `AttributeMapper::validSince` from the API

Re: RFR: 8306697: Add method to obtain String for CONSTANT_Class_info in ClassDesc [v2]

2023-04-28 Thread Adam Sotona
On Sat, 22 Apr 2023 18:40:45 GMT, Chen Liang wrote: >> Add a method `internalName` to `ClassDesc`, and unifies handling of string >> representation of a class constant in CONSTANT_Class_info via >> `ofInternalName` and `internalName` APIs, documented in `ClassDesc` itself. >> In particular,

Re: RFR: 8306697: Add method to obtain String for CONSTANT_Class_info in ClassDesc [v2]

2023-04-28 Thread Adam Sotona
On Thu, 27 Apr 2023 18:49:03 GMT, Brian Goetz wrote: > With the upcoming refactor to make parse/build instance methods, there is a > logical place and lifetime for caches. > […](#) @briangoetz This is a different level of caches than the discussed ClassHierarchyResolver cache. Most of the

Re: RFR: 8306697: Add method to obtain String for CONSTANT_Class_info in ClassDesc [v2]

2023-04-27 Thread Adam Sotona
On Sat, 22 Apr 2023 18:40:45 GMT, Chen Liang wrote: >> Add a method `internalName` to `ClassDesc`, and unifies handling of string >> representation of a class constant in CONSTANT_Class_info via >> `ofInternalName` and `internalName` APIs, documented in `ClassDesc` itself. >> In particular,

Re: RFR: 8306697: Add method to obtain String for CONSTANT_Class_info in ClassDesc [v2]

2023-04-27 Thread Adam Sotona
On Sat, 22 Apr 2023 18:40:45 GMT, Chen Liang wrote: >> Add a method `internalName` to `ClassDesc`, and unifies handling of string >> representation of a class constant in CONSTANT_Class_info via >> `ofInternalName` and `internalName` APIs, documented in `ClassDesc` itself. >> In particular,

Re: RFR: 8306697: Add method to obtain String for CONSTANT_Class_info in ClassDesc [v2]

2023-04-27 Thread Adam Sotona
On Sat, 22 Apr 2023 18:40:45 GMT, Chen Liang wrote: >> Add a method `internalName` to `ClassDesc`, and unifies handling of string >> representation of a class constant in CONSTANT_Class_info via >> `ofInternalName` and `internalName` APIs, documented in `ClassDesc` itself. >> In particular,

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v13]

2023-04-27 Thread Adam Sotona
On Wed, 26 Apr 2023 18:15:34 GMT, Alan Bateman wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> removed prefixes from name methods > > src/java.base/share/classes/java/lang/consta

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v15]

2023-04-27 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: tests update - Changes: - all: https://git

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v14]

2023-04-27 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Apply suggestions from code review Co-authored-by: Mand

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v13]

2023-04-26 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: removed prefixes from name methods - Changes: - a

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v10]

2023-04-26 Thread Adam Sotona
On Tue, 25 Apr 2023 21:53:44 GMT, Mandy Chung wrote: > I wonder if `packageName()` and `packageInternalName()` methods can simply be > `name()` and `internalName()` as the type name is `PackageDesc` and `package` > prefix seems to be unnecessary. Similarly, `moduleName()` can be `name()`. >

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v12]

2023-04-26 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update PackageDesc.java - Changes: - all: https://git

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v11]

2023-04-26 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with two additional commits since the last revision: - Update ModuleDesc.java - Apply suggestions fro

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v10]

2023-04-26 Thread Adam Sotona
On Tue, 25 Apr 2023 21:45:57 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Update ModuleDesc.java >> - Update PackageDesc.java > > src/java.b

Re: RFR: 8304425: ClassHierarchyResolver from Reflection [v6]

2023-04-26 Thread Adam Sotona
On Mon, 20 Mar 2023 15:21:57 GMT, Adam Sotona wrote: >> Marked as reviewed by asotona (Committer). > >> @asotona So should I simply throw an `IllegalAccessError` when the Lookup >> encounters a `IllegalAccessException`, or should I return null? I favor >> thro

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v10]

2023-04-25 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with two additional commits since the last revision: - Update ModuleDesc.java - Update PackageDesc.java - Ch

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v4]

2023-04-25 Thread Adam Sotona
On Tue, 25 Apr 2023 16:26:01 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> added custom toString() methods > > src/java.base/share/classes/java/lang/constant/Pack

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]

2023-04-25 Thread Adam Sotona
On Mon, 24 Apr 2023 22:05:18 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Doc fixes + added null and empty tests > > src/java.base/share/classes/java/lang/co

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v9]

2023-04-25 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with two additional commits since the last revision: - Update ModuleDesc.java - Update PackageDesc.java - Ch

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]

2023-04-25 Thread Adam Sotona
On Mon, 24 Apr 2023 20:56:03 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Doc fixes + added null and empty tests > > src/java.base/share/classes/java/lang/con

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v8]

2023-04-25 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update PackageDesc.java - Changes: - all: https://git

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]

2023-04-25 Thread Adam Sotona
On Mon, 24 Apr 2023 21:59:29 GMT, Mandy Chung wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Doc fixes + added null and empty tests > > src/java.base/share/classes/java/lang/co

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v7]

2023-04-25 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update ModuleDesc.java - Changes: - all: https://git

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v6]

2023-04-25 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Update PackageDesc.java - Changes: - all: https://git

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v5]

2023-04-25 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Apply suggestions from code review Co-authored-by: Mand

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v9]

2023-04-25 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v8]

2023-04-25 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v3]

2023-04-25 Thread Adam Sotona
On Thu, 20 Apr 2023 08:24:40 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/BufWriterImpl.java >> line 86: >> >>> 84: } >>> 85: >>> 86: public void setMajorVersion(int majorVersion) { >> >>

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

2023-04-25 Thread Adam Sotona
On Mon, 27 Mar 2023 16:43:17 GMT, Adam Sotona wrote: >> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy >> classes and this patch converts it to use Classfile API. >> >> Please review. >> >> Thank you, >> Adam > > Adam S

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v4]

2023-04-25 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: added custom toString() methods - Changes: - all: http

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]

2023-04-25 Thread Adam Sotona
On Tue, 25 Apr 2023 07:38:41 GMT, Adam Sotona wrote: > Note that other `*Impl` classes in `java.lang.constant` perform validation in  > their constructors and provide custom `toString()` formatting and they also > don’t use records. BTW: for example `ClassDesc:of(String name)`

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]

2023-04-25 Thread Adam Sotona
On Mon, 24 Apr 2023 16:33:58 GMT, Chen Liang wrote: > Note that other `*Impl` classes in `java.lang.constant` perform validation in  > their constructors and provide custom `toString()` formatting and they also > don’t use records. Performing validation in constructors I see as a blocker for

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v3]

2023-04-24 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Doc fixes + added null and empty tests - Changes: - a

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v2]

2023-04-24 Thread Adam Sotona
On Mon, 24 Apr 2023 14:35:30 GMT, Roger Riggs wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> added links to JVMS and utility methods moved to ConstantUtils > > src/java.base/sh

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v2]

2023-04-24 Thread Adam Sotona
On Mon, 24 Apr 2023 14:30:46 GMT, Roger Riggs wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> added links to JVMS and utility methods moved to ConstantUtils > > src/java.base/sh

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v2]

2023-04-24 Thread Adam Sotona
On Mon, 24 Apr 2023 12:28:37 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> added links to JVMS and utility methods moved to ConstantUtils > > src/java.base/sh

Re: RFR: 8306729: Add nominal descriptors of modules and packages to Constants API [v2]

2023-04-24 Thread Adam Sotona
gt; `PackageDesc` and `ModuleDesc`. > > Please review this pull request and attached CSR. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: added links to JVMS and utility methods moved to Const

RFR: 8306729: Add nominal descriptors of modules and packages to Constants API

2023-04-24 Thread Adam Sotona
Constants API already provides models for all loadable constants to help programs manipulating class files and modelling bytecode instructions. However no models of module and package constants are provided by Constants API. Every program manipulating class files must implement own models and

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v7]

2023-04-21 Thread Adam Sotona
On Thu, 20 Apr 2023 17:21:49 GMT, Adam Sotona wrote: >> Classfile API didn't handle transformations of class files version 50 and >> below correctly. >> >> Proposed fix have two parts: >> 1. Inflation of branch targets does not depend on StackMapTable attribu

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v7]

2023-04-20 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v2]

2023-04-20 Thread Adam Sotona
On Wed, 19 Apr 2023 13:30:44 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> DiscontinuedInstruction implementation + test > > src/java.base/share/class

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v6]

2023-04-20 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v5]

2023-04-20 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v4]

2023-04-20 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with tw

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v3]

2023-04-20 Thread Adam Sotona
On Wed, 19 Apr 2023 17:08:53 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> fixed ClassPrinterImpl > > src/java.base/share/classes/jdk/internal/classfile/impl

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v3]

2023-04-19 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v2]

2023-04-19 Thread Adam Sotona
On Wed, 19 Apr 2023 13:06:20 GMT, Adam Sotona wrote: >> Classfile API didn't handle transformations of class files version 50 and >> below correctly. >> >> Proposed fix have two parts: >> 1. Inflation of branch targets does not depend on StackMapTable attribu

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails [v2]

2023-04-19 Thread Adam Sotona
> implementation is provided. > 2. StackMapTable attribute is not generated for class file versions below 50. > > StackMapsTest is also extended to test this patch. > > Please review. > > Thanks, > Adam Adam Sotona has updated the pull request incrementally with o

Re: RFR: 8305990: Stripping debug info of ASM 9.5 fails

2023-04-18 Thread Adam Sotona
On Fri, 14 Apr 2023 14:02:46 GMT, Adam Sotona wrote: > Classfile API didn't handle transformations of class files version 50 and > below correctly. > > Proposed fix have two parts: > 1. Inflation of branch targets does not depend on StackMapTable attribute > presence for

Re: RFR: 8294969: Convert jdk.jdeps javap to use the Classfile API

2023-04-17 Thread Adam Sotona
On Sat, 1 Apr 2023 20:31:05 GMT, Chen Liang wrote: > It's quite complicated to safeguard every potentially erroneous call. I agree, it is complicated, however possible. The question however is whether it is desirable. See for example silently failing `ClhsdbDumpclass` test with many

Re: RFR: 8294969: Convert jdk.jdeps javap to use the Classfile API

2023-04-17 Thread Adam Sotona
On Tue, 29 Nov 2022 10:26:31 GMT, Adam Sotona wrote: > javap uses proprietary com.sun.tools.classfile library to parse class files. > > This patch converts javap to use Classfile API. > > Please review. > > Thanks, > Adam failing `hotspot/jtreg/serviceability/sa/Cl

RFR: 8294969: Convert jdk.jdeps javap to use the Classfile API

2023-04-17 Thread Adam Sotona
javap uses proprietary com.sun.tools.classfile library to parse class files. This patch converts javap to use Classfile API. Please review. Thanks, Adam - Commit messages: - fixed TestClassNameWarning - Merge branch 'master' into JDK-8294969-javap - consolidated safeguarding of

Re: RFR: 8304932: MethodTypeDescImpl can be mutated by argument passed to MethodTypeDesc.of [v2]

2023-04-17 Thread Adam Sotona
On Sun, 26 Mar 2023 20:45:19 GMT, Chen Liang wrote: >> Fixed the bug where if a caller keeps a reference to the array passed into >> `MethodTypeDesc.of`, the caller may mutate the Desc via the array and can >> create invalid MethodTypeDesc. >> >> Unfortunately, since the input array now needs

RFR: 8305990: Stripping debug info of ASM 9.5 fails

2023-04-14 Thread Adam Sotona
Classfile API didn't handle transformations of class files version 50 and below correctly. Proposed fix have two parts: 1. Inflation of branch targets does not depend on StackMapTable attribute presence for class file version 50 and below. Alternative fallback implementation is provided. 2.

Re: RFR: 8304937: BufferedFieldBuilder.Model missing writeTo(DirectClassBuilder)

2023-04-04 Thread Adam Sotona
On Sun, 26 Mar 2023 20:35:20 GMT, Chen Liang wrote: > Please review this simple patch to Classfile API that fixes a missing > override that otherwise affects usage of chained class transforms. A test is > included, that it fails on the missing method without this patch. > > Please review a

Re: RFR: 8301703: java.base jdk.internal.foreign.abi.BindingSpecializer uses ASM to generate classes [v2]

2023-03-31 Thread Adam Sotona
On Thu, 30 Mar 2023 19:55:15 GMT, Jorn Vernee wrote: >> Rewrite BindingSpecializer to use the new class file API. >> >> Note: There is a big try/catch/finally block generated in the `specialize` >> method that currently uses labels. I looked at replacing this with a call to >>

Re: RFR: 8301703: java.base jdk.internal.foreign.abi.BindingSpecializer uses ASM to generate classes [v2]

2023-03-31 Thread Adam Sotona
On Fri, 31 Mar 2023 12:20:49 GMT, Adam Sotona wrote: >> I believe that, in order to generate the actual bytecodes, the classfile API >> does a full verification pass (as it needs to infer the stackmap >> information). This leads me to believe that, yes, most (but probably all

Re: RFR: 8301703: java.base jdk.internal.foreign.abi.BindingSpecializer uses ASM to generate classes [v2]

2023-03-31 Thread Adam Sotona
On Fri, 31 Mar 2023 11:22:46 GMT, Maurizio Cimadamore wrote: >> I'm not really looking for anything specific. I'm just trying to figure out >> if it's worth it to keep the `PERFORM_VERIFICATION` flag, and change it to >> call the verifier in the new impl. i.e. does it catch more errors than

Re: RFR: 8304425: ClassHierarchyResolver from Reflection [v5]

2023-03-28 Thread Adam Sotona
On Mon, 27 Mar 2023 14:34:06 GMT, Chen Liang wrote: >> Add API to explore Class Hierarchy with a `ClassLoader` or a `Lookup` with >> proper privileges, with tests. >> >> This addition is useful in case classes at runtime are not loaded from the >> system class loader, such as Proxy. This is

Re: RFR: 8304425: ClassHierarchyResolver from Reflection [v5]

2023-03-28 Thread Adam Sotona
On Mon, 27 Mar 2023 14:34:06 GMT, Chen Liang wrote: >> Add API to explore Class Hierarchy with a `ClassLoader` or a `Lookup` with >> proper privileges, with tests. >> >> This addition is useful in case classes at runtime are not loaded from the >> system class loader, such as Proxy. This is

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

2023-03-27 Thread Adam Sotona
On Mon, 27 Mar 2023 15:07:42 GMT, Adam Sotona wrote: >> src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java >> line 256: >> >>> 254: >>> 255: private Frame getFrame(int offset) { >>> 256: for (var f :

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

2023-03-27 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit si

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

2023-03-27 Thread Adam Sotona
On Mon, 27 Mar 2023 13:17:35 GMT, Chen Liang wrote: >> Adam Sotona has updated the pull request incrementally with one additional >> commit since the last revision: >> >> SplitConstantPool performance improvement > > src/java.base/share/class

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

2023-03-27 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit si

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

2023-03-27 Thread Adam Sotona
On Wed, 22 Mar 2023 17:46:37 GMT, Chen Liang 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 201 commits: >> >> - Merge branch 'master' into JDK-8294961 >> >># Co

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

2023-03-27 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last

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

2023-03-27 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the la

Re: RFR: 8304837: Classfile API throws IOOBE for MethodParameters attribute without parameter names [v3]

2023-03-24 Thread Adam Sotona
On Fri, 24 Mar 2023 06:42:30 GMT, Hannes Greule wrote: >> After merging master into https://github.com/openjdk/jdk/pull/9862, we >> encountered test failures (e.g., >> https://github.com/SirYwell/jdk/actions/runs/4500940829/jobs/7923018438#step:9:2541). >> The Classfile API tries to read from

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

2023-03-23 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with one additional commit si

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

2023-03-22 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > 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

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

2023-03-22 Thread Adam Sotona
> java.base java.lang.reflect.ProxyGenerator uses ASM to generate proxy classes > and this patch converts it to use Classfile API. > > Please review. > > Thank you, > Adam Adam Sotona has updated the pull request incrementally with two additional commits si

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

2023-03-22 Thread Adam Sotona
On Thu, 9 Mar 2023 17:53:05 GMT, Mandy Chung 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 195 commits: >> >> - Merge branch 'master' into JDK-8294961-proxy >> - Merge

Re: RFR: 8304148: Remapping a class with Invokedynamic constant loses static bootstrap arguments [v2]

2023-03-22 Thread Adam Sotona
On Wed, 22 Mar 2023 11:59:30 GMT, Thiago Henrique Hüpner wrote: >> 8304148: Remapping a class with Invokedynamic constant loses static >> bootstrap arguments > > Thiago Henrique Hüpner has updated the pull request incrementally with one > additional commit since the last revision: > > Add

Integrated: 8294972: Convert jdk.jlink internal plugins to use the Classfile API

2023-03-22 Thread Adam Sotona
On Thu, 9 Mar 2023 11:35:32 GMT, Adam Sotona wrote: > jdk.jlink internal plugins are heavily using ASM > > This patch converts ASM calls to Classfile API. > > Please review. > Thanks, > Adam This pull request has now been integrated. Changeset: 358c61b5 Author

Re: RFR: 8304148: Remapping a class with Invokedynamic constant loses static bootstrap arguments

2023-03-22 Thread Adam Sotona
On Tue, 14 Mar 2023 14:51:34 GMT, Thiago Henrique Hüpner wrote: > 8304148: Remapping a class with Invokedynamic constant loses static bootstrap > arguments Suggested patch to test the args lost: diff --git a/test/jdk/jdk/classfile/AdvancedTransformationsTest.java

Re: RFR: 8304148: Remapping a class with Invokedynamic constant loses static bootstrap arguments

2023-03-22 Thread Adam Sotona
On Tue, 14 Mar 2023 14:51:34 GMT, Thiago Henrique Hüpner wrote: > 8304148: Remapping a class with Invokedynamic constant loses static bootstrap > arguments Thanks for discovering the bug. Proposed fix looks good to me, however it would be good to cover it with a test. - PR

Re: RFR: 8294972: Convert jdk.jlink internal plugins to use the Classfile API [v12]

2023-03-22 Thread Adam Sotona
On Sat, 18 Mar 2023 13:15:01 GMT, ExE Boss wrote: >> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/IncludeLocalesPlugin.java >> line 309: >> >>> 307: TAG_INVOKEDYNAMIC -> offset += 5; >>> 308: case TAG_LONG, >>> 309:

Re: RFR: 8294972: Convert jdk.jlink internal plugins to use the Classfile API [v18]

2023-03-22 Thread Adam Sotona
> jdk.jlink internal plugins are heavily using ASM > > This patch converts ASM calls to Classfile API. > > Please review. > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: improved exception

Re: RFR: 8294972: Convert jdk.jlink internal plugins to use the Classfile API [v14]

2023-03-22 Thread Adam Sotona
On Tue, 21 Mar 2023 11:54:38 GMT, Adam Sotona wrote: >> Yes, I think so. If `java -XX:+UnlockDiagnosticVMOptions >> -XX:+BytecodeVerificationLocal -version` doesn't fail and you've run all the >> tests then it should be okay to drop it. > > I can confirm `java -XX:+U

Re: RFR: 8294972: Convert jdk.jlink internal plugins to use the Classfile API [v17]

2023-03-22 Thread Adam Sotona
> jdk.jlink internal plugins are heavily using ASM > > This patch converts ASM calls to Classfile API. > > Please review. > Thanks, > Adam Adam Sotona has updated the pull request incrementally with one additional commit since the last revision: Apply suggestions fro

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