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

Maurizio Cimadamore mcimadamore at openjdk.org
Mon Jul 11 15:26:24 UTC 2022


On Tue, 28 Jun 2022 10:42:39 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

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

Nice use of records 👍

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

Marked as reviewed by mcimadamore (Committer).

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


More information about the panama-dev mailing list