[foreign-abi] [Rev 04] RFR: 8241504: Expose MemoryLayout annotations/attributes in the public API

Maurizio Cimadamore mcimadamore at openjdk.java.net
Thu Mar 26 12:03:13 UTC 2020


On Thu, 26 Mar 2020 11:24:18 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

>> Hi,
>> 
>> This PR exposed MemoryLayout attributes in the public API.
>> 
>> A summary of the changes:
>> - Renamed annotation -> attribute everywhere to avoid confusion with Java language annotations
>> - Made sure that annotations were being serialized as part of a MemoryLayout's ConstantDesc, as well as the alignment
>>   which was previously left out. (The latter also meant changing PaddingLayout::hasNaturalAlignment to always return
>>   `true`, so serializing alignment is skipped for padding). Removed special casing for the abiType attribute. This can
>>   now instead be handled through the generic attribute mechanism.
>> 
>> Thanks,
>> Jorn
>
> Jorn Vernee 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 17 additional commits since
> the last revision:
>  - Merge branch 'Attributes' of https://github.com/JornVernee/panama-foreign into Attributes
>  - Don't filter by type when looking up layout attributes, and instead fail with a CCE by casting directly if the type is
>    incorrect, to avoid silent errors.
>  - Update src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SystemABI.java
>    
>    Co-Authored-By: Maurizio Cimadamore <54672762+mcimadamore at users.noreply.github.com>
>  - Remove ML::attribute(String, Class) helper method.
>  - Addressed review comments + added basic tests
>  - Removed trailing whitespace
>  - Clean up diff
>  - Removed abiType, added type-casting helper for attribute
>  - Rename annotations to attributes, and expose them in the public API.
>  - Merge branch 'Attributes' of https://github.com/JornVernee/panama-foreign into Attributes
>  - Remove ML::attribute(String, Class) helper method.
>  - Update src/jdk.incubator.foreign/share/classes/jdk/incubator/foreign/SystemABI.java
>    
>    Co-Authored-By: Maurizio Cimadamore <54672762+mcimadamore at users.noreply.github.com>
>  - Addressed review comments + added basic tests
>  - Removed trailing whitespace
>  - Clean up diff
>  - Removed abiType, added type-casting helper for attribute
>  - Rename annotations to attributes, and expose them in the public API.

Looks good

-------------

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/64


More information about the panama-dev mailing list