[foreign-memaccess+abi] RFR: Simplify ValueLayouts

Per Minborg pminborg at openjdk.org
Wed Feb 15 16:14:39 UTC 2023


This PR proposes a more shortened and simplified scheme when implementing value layouts. 

This provides a significant reduction of the code size. A new threeary duplicator is introduced. In the solution below, I sugest using a function (`ValueLayoutDuplicator<V>`) which reduces code but arguably makes it a bit more complicated. Another alternative would be to simply mandate a corresponding abstract method and Implement an explicit delegator to the constructor for each type. 

Let me know your thoughts around how to balance this.

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

Commit messages:
 - Simplify ValueLayouts

Changes: https://git.openjdk.org/panama-foreign/pull/798/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=798&range=00
  Stats: 149 lines in 2 files changed: 12 ins; 94 del; 43 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/798.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign pull/798/head:pull/798

PR: https://git.openjdk.org/panama-foreign/pull/798


More information about the panama-dev mailing list