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

Per Minborg pminborg at openjdk.org
Wed Feb 15 09:14:47 UTC 2023


This PR proposes adding deduplication of the immutable value layout where one provides a value that is equal to the one already at hand. For example, `JAVA_INT.withBitAlignment(32)` will return the same object. There is no general caching mechanism that guarantees a layout will never repeat. 

Another part of this PR relates to simplifying value layouts so they only have a single constructor. This will reduce size slightly. Related to this is the replacement of certain magic numbers which are now represented by constants.

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

Commit messages:
 - Deduplicate layouts and simplify value layout implementations

Changes: https://git.openjdk.org/panama-foreign/pull/795/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=795&range=00
  Stats: 101 lines in 2 files changed: 16 ins; 54 del; 31 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/795.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign pull/795/head:pull/795

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


More information about the panama-dev mailing list