RFR: 8297733: Refactor Cast binding to enum [v2]

Jorn Vernee jvernee at openjdk.org
Mon Dec 5 14:52:16 UTC 2022


> Refactor the cast binding to an enum, which clearly enumerates all supported conversions.
> 
> This also fixes a bug where `java/foreign/normalize/TestNormalize` was failing when running in interpreted mode (`-Djdk.internal.foreign.DowncallLinker.USE_SPEC=false`), for conversions from `int` to `byte` because the `explicitCast` method handle that was used only considers the least significant bit, while we want to look at all of the least significant byte.
> 
> As mentioned in the JBS issue, doing this will also make it easier going forward to support multiple conversions with the same from and to types, but requiring different semantics.
> 
> Testing: jdk_foreign test suite.

Jorn Vernee has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains two commits:

 - Refactor cast operator to enum
 - 8296477: Foreign linker implementation update following JEP 434
   
   Co-authored-by: Jorn Vernee <jvernee at openjdk.org>
   Co-authored-by: Nick Gasson <ngasson at openjdk.org>
   Co-authored-by: Per Minborg <pminborg at openjdk.org>
   Reviewed-by: rehn, mcimadamore, vlivanov

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

Changes: https://git.openjdk.org/jdk/pull/11397/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=11397&range=01
  Stats: 2986 lines in 74 files changed: 2025 ins; 332 del; 629 mod
  Patch: https://git.openjdk.org/jdk/pull/11397.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/11397/head:pull/11397

PR: https://git.openjdk.org/jdk/pull/11397


More information about the core-libs-dev mailing list