On Mon, 28 Nov 2022 20:13:35 GMT, Jorn Vernee <jver...@openjdk.org> wrote:
> 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. Looks good ------------- Marked as reviewed by mcimadamore (Reviewer). PR: https://git.openjdk.org/jdk/pull/11397