[foreign-abi] RFR: 8253255: Investigate replacing ABI layout attributes with custom subtypes of ValueLayout [v2]

Jorn Vernee jvernee at openjdk.java.net
Tue Sep 29 11:18:55 UTC 2020


> 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

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

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/358/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/358/files/620725b9..09d75f25

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=358&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=panama-foreign&pr=358&range=00-01

  Stats: 102 lines in 3 files changed: 100 ins; 0 del; 2 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/358.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/358/head:pull/358

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


More information about the panama-dev mailing list