[foreign-memaccess+abi] Integrated: Simplify ValueLayouts

Per Minborg pminborg at openjdk.org
Thu Feb 16 11:40:49 UTC 2023


On Wed, 15 Feb 2023 16:06:21 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> 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.

This pull request has now been integrated.

Changeset: 8dd8ba53
Author:    Per Minborg <pminborg at openjdk.org>
URL:       https://git.openjdk.org/panama-foreign/commit/8dd8ba53215c35adfed472d2a89aa6a7bcdfd48d
Stats:     145 lines in 2 files changed: 7 ins; 96 del; 42 mod

Simplify ValueLayouts

Reviewed-by: mcimadamore

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

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


More information about the panama-dev mailing list