[foreign-memaccess+abi] RFR: Deduplicate layouts and simplify value layout implementations [v2]

Maurizio Cimadamore mcimadamore at openjdk.org
Wed Feb 15 18:10:04 UTC 2023


On Wed, 15 Feb 2023 17:54:27 GMT, Per Minborg <pminborg at openjdk.org> wrote:

> Running a large number of tests and collecting deduplication information reveals the following:
> 
I suggest running same stats on the output of e.g. a jextract project - I don't think JDK tests are necessarily indicative of idiomatic usages. If you look at jextract, you will see that we only generate few root layouts (C_INT, C_FLOAT, ...) which might use some calls to `bitAlignment` and `order`. But these should be < 10 layout objects. Everything else that is built, is built on top of these layouts. So, when we build a struct layout with two ints, we will do `structLayout(C_INT.withName("x"), C_INT.withName("y"))`. There is no further call to `bitAlignment` or `order`, so I think the potential for deduplication is quite low in jextract bindings.

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

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


More information about the panama-dev mailing list