[foreign-abi] RFR: 8253255: Investigate replacing ABI layout attributes with custom subtypes of ValueLayout [v2]
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue Sep 29 11:55:48 UTC 2020
On Tue, 29 Sep 2020 11:18:55 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Hi,
>>
>> This patch removes ABI attributes, and replaces them with a custom ValueLayout subtype, called CValueLayout.
>>
>> This, for one, allows us to override the describeConstable method to return a dynamic constant descriptor that will
>> load the public constant field in CLinker. This avoids getting illegal access errors when trying to resolve the
>> internal ABI attributes. The illegal access error was forcing clients, like jextract, to basically re-implement the
>> describeConstable methods for FunctionDescriptor, GroupLayout, SequenceLayout and ValueLayout in order the
>> 'cannonicalize' these constant descriptors to reference the fields. Most of the needed changes were in the TypeClass
>> classes, which now need to map the CValueLayout.Kind into the appropriate ABI classes (though doing this was pretty
>> straight forward). I've also added a test to make sure it is possible to resolve constant descriptors with these
>> CValueLayouts inside with a public Lookup object. Thanks, Jorn
>
> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>
> Add equals and hashCode mehtods to CValueLayout, and make sure CValueLayout and ValueLayout are not equal
Looks good!
-------------
Marked as reviewed by mcimadamore (Committer).
PR: https://git.openjdk.java.net/panama-foreign/pull/358
More information about the panama-dev
mailing list