[foreign-memaccess+abi] RFR: 8289285: Use records for binding classes

Jorn Vernee jvernee at openjdk.org
Tue Jun 28 10:47:43 UTC 2022


This PR switches the Binding classes to use records. This results in a clean simplification of the code due to the no longer having the need to implement equals/hashcode/toString as well. When we have type patterns for switch, we will also be able to remove the tag, and just switch on the type.

I also noticed that the UnboxAddress binding had 2 fields that were not being used. In practice this binding always operates on Addressable instances (both in the interpreter and specializer). So, I've cleaned up these 2 fields as well, and related factory method.

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

Commit messages:
 - Clean up UnboxAddress
 - Use records for Binding classes

Changes: https://git.openjdk.org/panama-foreign/pull/690/files
 Webrev: https://webrevs.openjdk.org/?repo=panama-foreign&pr=690&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8289285
  Stats: 415 lines in 9 files changed: 15 ins; 280 del; 120 mod
  Patch: https://git.openjdk.org/panama-foreign/pull/690.diff
  Fetch: git fetch https://git.openjdk.org/panama-foreign pull/690/head:pull/690

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


More information about the panama-dev mailing list