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

2023-03-08 Thread Adam Sotona
On Tue, 7 Mar 2023 16:06:17 GMT, Paul Sandoz  wrote:

>> `Long:numberOfLeadingZeros` implementation uses more method calls, 
>> conditional statements and binary operations. I would prefer to stick with 
>> the current implementation for its speed and simplicity.
>
> `numberOfLeadingZeros` is an intrinsic, so it will compile down to a machine 
> instruction. Up to you.

Oh, I've changed it, thanks.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-07 Thread Paul Sandoz
On Tue, 7 Mar 2023 14:35:22 GMT, Adam Sotona  wrote:

>> src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java line 
>> 176:
>> 
>>> 174: }
>>> 175: 
>>> 176: public static long nextPowerOfTwo( long x ) {
>> 
>> If you like you can change the implementation to be:
>> 
>> x = -1 >>> Long.numberOfLeadingZeros(x - 1);
>> return x + 1;
>> 
>> See `ConcurrentHashMap`.
>
> `Long:numberOfLeadingZeros` implementation uses more method calls, 
> conditional statements and binary operations. I would prefer to stick with 
> the current implementation for its speed and simplicity.

`numberOfLeadingZeros` is an intrinsic, so it will compile down to a machine 
instruction. Up to you.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-07 Thread Adam Sotona
On Fri, 3 Mar 2023 22:48:23 GMT, Paul Sandoz  wrote:

>> Adam Sotona has updated the pull request incrementally with three additional 
>> commits since the last revision:
>> 
>>  - fixed AccessFlags javadoc
>>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>>  - removed obsolete generic parameter from AbstractDirectBuilder
>
> src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java line 
> 176:
> 
>> 174: }
>> 175: 
>> 176: public static long nextPowerOfTwo( long x ) {
> 
> If you like you can change the implementation to be:
> 
> x = -1 >>> Long.numberOfLeadingZeros(x - 1);
> return x + 1;
> 
> See `ConcurrentHashMap`.

`Long:numberOfLeadingZeros` implementation uses more method calls, conditional 
statements and binary operations. I would prefer to stick with the current 
implementation for its speed and simplicity.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-06 Thread Adam Sotona
On Fri, 3 Mar 2023 22:35:48 GMT, Paul Sandoz  wrote:

>> Adam Sotona has updated the pull request incrementally with three additional 
>> commits since the last revision:
>> 
>>  - fixed AccessFlags javadoc
>>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>>  - removed obsolete generic parameter from AbstractDirectBuilder
>
> src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java line 52:
> 
>> 50: static final Instruction[] SINGLETON_INSTRUCTIONS = new 
>> Instruction[256];
>> 51: 
>> 52: static {
> 
> Can we loop through all `Opcode` values filter for `sizeIfFixed == 1` and 
> switch on the kind? If so that would avoid the need for explicit lists and 
> simplify the code.

Yes, that is good idea.
Fixed, thanks.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-06 Thread Adam Sotona
The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.

--
On Fri, 3 Mar 2023 23:12:17 GMT, Paul Sandoz  wrote:

>> Adam Sotona has updated the pull request incrementally with three additional 
>> commits since the last revision:
>> 
>>  - fixed AccessFlags javadoc
>>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>>  - removed obsolete generic parameter from AbstractDirectBuilder
>
> src/java.base/share/classes/jdk/internal/classfile/impl/Util.java line 161:
> 
>> 159: var desc = cd.descriptorString();
>> 160: return switch (desc.charAt(0)) {
>> 161: case '[' -> desc;
> 
> Is this correct? Arrays don't have an internal name.

It is a workaround to get CP class entry name string from descriptor, so the  
`toInternalName` is not exact.
I'll handle the array descriptors separately and let this method to handle real 
class internal names only.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-06 Thread Adam Sotona
The message from this sender included one or more files
which could not be scanned for virus detection; do not
open these files unless you are certain of the sender's intent.

--
On Fri, 3 Mar 2023 21:44:24 GMT, Paul Sandoz  wrote:

>> Adam Sotona has updated the pull request incrementally with three additional 
>> commits since the last revision:
>> 
>>  - fixed AccessFlags javadoc
>>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>>  - removed obsolete generic parameter from AbstractDirectBuilder
>
> src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java
>  line 683:
> 
>> 681: public UnboundInstruction(Opcode op, int size) {
>> 682: super(op, size);
>> 683: }
> 
> Unused?

fixed, thanks.

> src/java.base/share/classes/jdk/internal/classfile/impl/AnnotationReader.java 
> line 99:
> 
>> 97: }
>> 98: 
>> 99: public static List> 
>> readParameterAnnotations(ClassReader classReader, int p, boolean isVisible) {
> 
> Parameter `isVisible` is unused, but method is called with true/false values.

fixed, thanks.

> src/java.base/share/classes/jdk/internal/classfile/impl/AttributeHolder.java 
> line 76:
> 
>> 74: }
>> 75: 
>> 76: List> attributes() {
> 
> Unused

fixed, thanks.

> src/java.base/share/classes/jdk/internal/classfile/impl/BufferedMethodBuilder.java
>  line 54:
> 
>> 52: private final List elements = new ArrayList<>();
>> 53: private final SplitConstantPool constantPool;
>> 54: private final ClassEntry thisClass;
> 
> Unused. Can be removed as can the associated constructor parameter.

fixed, thanks.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-06 Thread Adam Sotona
On Fri, 3 Mar 2023 21:56:39 GMT, Paul Sandoz  wrote:

>> Adam Sotona has updated the pull request incrementally with three additional 
>> commits since the last revision:
>> 
>>  - fixed AccessFlags javadoc
>>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>>  - removed obsolete generic parameter from AbstractDirectBuilder
>
> src/java.base/share/classes/jdk/internal/classfile/impl/AttributeHolder.java 
> line 73:
> 
>> 71: if (a.attributeMapper() == am)
>> 72: iterator.remove();
>> 73: }
> 
> Suggestion:
> 
> attributes.removeIf(a -> a.attributeMappter() == am);
> 
> But presumably use an inner class instead. I can understand because of that 
> if you want to keep the existing code instead.

It seems to be OK to use lambda here (not on critical JDK bootstrap path), 
thanks.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

This is a significant amount of work over a long period of time. Well done to 
all involved.

Initially it's easy to get overwhelmed with the quantity of new classes. There 
are lots of "things" in a classfile and to properly model a classfile there 
will naturally be lots of classes for those "things". It's all very logically 
structured and very disciplined.

For me the most powerful aspect of the design is that of the builder, which can 
be combined with a flatmap transformation and pattern matching. A clean, 
functional, and immutable design. When transforming a classfile the developer 
has a choice to apply composed transformations  to a stream of elements or 
obtain a list of all elements and apply more globally (perhaps building up a 
transformation plan that is then applied to the stream), depending on their 
needs.

It's slightly awkward that composed transformers (resulting from `andThen` and 
`ofStateful`) cannot be operated on and the resolved artifact is exposed, but i 
don't think anyone will likely notice given the usage. (I cannot off the top of 
my head suggest anything better. Maybe as this soaks internally new ideas 
emerge.)

-

Marked as reviewed by psandoz (Reviewer).

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/Util.java line 161:

> 159: var desc = cd.descriptorString();
> 160: return switch (desc.charAt(0)) {
> 161: case '[' -> desc;

Is this correct? Arrays don't have an internal name.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/CodeImpl.java line 52:

> 50: static final Instruction[] SINGLETON_INSTRUCTIONS = new 
> Instruction[256];
> 51: 
> 52: static {

Can we loop through all `Opcode` values filter for `sizeIfFixed == 1` and 
switch on the kind? If so that would avoid the need for explicit lists and 
simplify the code.

src/java.base/share/classes/jdk/internal/classfile/impl/EntryMap.java line 176:

> 174: }
> 175: 
> 176: public static long nextPowerOfTwo( long x ) {

If you like you can change the implementation to be:

x = -1 >>> Long.numberOfLeadingZeros(x - 1);
return x + 1;

See `ConcurrentHashMap`.

src/java.base/share/classes/jdk/internal/classfile/impl/Util.java line 84:

> 82: }
> 83: }
> 84: }

Suggestion:

loop: for (int i = 1; i < type.length(); ++i) {
switch (type.charAt(i)) {
case '[':
bs.set(i);
while (type.charAt(++i) == '[')
;
if (type.charAt(i) == 'L') {
while (type.charAt(++i) != ';')
;
}
break;
case ')':
break loop;
default:
bs.set(i);
if (type.charAt(i) == 'L') {
while (type.charAt(++i) != ';')
;
}
}
}

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/ClassPrinterImpl.java 
line 570:

> 568: fieldToTree(f, verbosity
> 569: .with(new ListNodeImpl(BLOCK, "methods", 
> clm.methods().stream().map(mm ->
> 570: (Node)methodToTree(mm, verbosity;

Suggestion:

methodToTree(mm, verbosity;

(Note as i go through the code i am looking at the IDEs report of problems and 
making note as comments. Likely be more productive for you to do that directly.)

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/BufferedMethodBuilder.java
 line 54:

> 52: private final List elements = new ArrayList<>();
> 53: private final SplitConstantPool constantPool;
> 54: private final ClassEntry thisClass;

Unused. Can be removed as can the associated constructor parameter.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/BootstrapMethodEntryImpl.java
 line 83:

> 81: }
> 82: else
> 83: return false;

Suggestion:

return obj instanceof BootstrapMethodEntry e
&& e.bootstrapMethod().equals(handle)
&& e.arguments().equals(arguments);

? I am uncertain about the use of reference equality, since it indicates an 
instance is only equal to itself?

src/java.base/share/classes/jdk/internal/classfile/impl/BootstrapMethodEntryImpl.java
 line 91:

> 89: for (LoadableConstantEntry a : arguments) {
> 90: hash = 31 * hash + a.hashCode();
> 91: }

Suggestion:

hash = 31 * hash + arguments.hashCode();

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/AttributeHolder.java 
line 73:

> 71: if (a.attributeMapper() == am)
> 72: iterator.remove();
> 73: }

Suggestion:

attributes.removeIf(a -> a.attributeMappter() == am);

But presumably use an inner class instead. I can understand because of that if 
you want to keep the existing code instead.

src/java.base/share/classes/jdk/internal/classfile/impl/AttributeHolder.java 
line 76:

> 74: }
> 75: 
> 76: List> attributes() {

Unused

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/AnnotationReader.java 
line 99:

> 97: }
> 98: 
> 99: public static List> 
> readParameterAnnotations(ClassReader classReader, int p, boolean isVisible) {

Parameter `isVisible` is unused, but method is called with true/false values.

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 Thread Paul Sandoz
On Fri, 3 Mar 2023 16:39:41 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://bugs.openjdk.org/browse/JDK-8294957)) will chain to 
>> this one.
>> 
>> Classfile API development is tracked at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
>> 
>> Development branch of consolidated JDK class files parsing, generating, and 
>> transforming is at:
>> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
>> 
>> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
>> API 
>> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>>  is also available.
>> 
>> Please take you time to review this non-trivial JDK addition.
>> 
>> Thank you,
>> Adam
>
> Adam Sotona has updated the pull request incrementally with three additional 
> commits since the last revision:
> 
>  - fixed AccessFlags javadoc
>  - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
>  - removed obsolete generic parameter from AbstractDirectBuilder

src/java.base/share/classes/jdk/internal/classfile/impl/AbstractInstruction.java
 line 683:

> 681: public UnboundInstruction(Opcode op, int size) {
> 682: super(op, size);
> 683: }

Unused?

-

PR: https://git.openjdk.org/jdk/pull/10982


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

2023-03-03 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.
> 
> Classfile API development is tracked at:
> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-branch
> 
> Development branch of consolidated JDK class files parsing, generating, and 
> transforming is at:
> https://github.com/openjdk/jdk-sandbox/tree/classfile-api-dev-branch
> 
> Classfile API [JEP](https://bugs.openjdk.org/browse/JDK-8280389) and [online 
> API 
> documentation](https://htmlpreview.github.io/?https://raw.githubusercontent.com/openjdk/jdk-sandbox/classfile-api-javadoc-branch/doc/classfile-api/javadoc/java.base/jdk/internal/classfile/package-summary.html)
>  is also available.
> 
> Please take you time to review this non-trivial JDK addition.
> 
> Thank you,
> Adam

Adam Sotona has updated the pull request incrementally with three additional 
commits since the last revision:

 - fixed AccessFlags javadoc
 - TransformImpl.FakeXyzTransform renamed to UnresolvedXyzTransform
 - removed obsolete generic parameter from AbstractDirectBuilder

-

Changes:
  - all: https://git.openjdk.org/jdk/pull/10982/files
  - new: https://git.openjdk.org/jdk/pull/10982/files/8561d134..173dc1e7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk=10982=42
 - incr: https://webrevs.openjdk.org/?repo=jdk=10982=41-42

  Stats: 24 lines in 7 files changed: 0 ins; 0 del; 24 mod
  Patch: https://git.openjdk.org/jdk/pull/10982.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10982/head:pull/10982

PR: https://git.openjdk.org/jdk/pull/10982