[foreign-abi] RFR: 8253796: Consider making CValueLayout public. [v2]

Jorn Vernee jvernee at openjdk.java.net
Tue Sep 29 16:39:01 UTC 2020


> Hi,
> 
> This PR makes CValueLayout a public nested class of CLinker, meant to be extended. To quote the motivation from the JBS
> issue:
>> Jextract uses an attribute to attach temporary information to layouts regarding the canonical layout field in CLinker
>> they correspond to.
>> But, creating a dynamic constant out of these layouts is a complex process, since we need to recursively filter out
>> this internal jextract attribute, which requires us to recreate GroupLayouts, SequenceLayouts, FunctionDescriptors, and
>> ValueLayouts.  It would be easier if we could extend CValueLayout with a custom jextract layout class, which has an
>> extract field to indicate which CLinker constant they correspond to. In that case e.g. SourceConstantHelper can cast to
>> this custom class and retrieve this extra field, removing the need to use attributes, and the difficulties associated
>> with them.
> 
> Thanks,
> Jorn

Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:

  - Add javadoc to CValueLayout
  - Add an isFloat method to CValueLayout.Kind, to complete the set

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

Changes:
  - all: https://git.openjdk.java.net/panama-foreign/pull/359/files
  - new: https://git.openjdk.java.net/panama-foreign/pull/359/files/096e9090..3ed3d58d

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

  Stats: 156 lines in 1 file changed: 153 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/panama-foreign/pull/359.diff
  Fetch: git fetch https://git.openjdk.java.net/panama-foreign pull/359/head:pull/359

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


More information about the panama-dev mailing list