CLinker migration from jdk17 to jdk18

Lev Serebryakov lev at serebryakov.spb.ru
Tue Apr 5 17:39:39 UTC 2022


On 05.04.2022 20:30, Maurizio Cimadamore wrote:
> 

> It is very possible to insert return/argument filters on a method handle only conditionally, which will give you more or less the same result as what you have in JNI.
> 
> ```
> MethodHandle strlen = ... // this will return `int` on LLP64 and `long` on LP64
> if (IS_X86) {

  I don't like this condition. Because tomorrow JDK will be ported to some TISC-128 platform, which is LLP64 too, and my code will not be ready for it, as it knows only about "official" platforms. It is what I've tried to say in previous message.

  It will be great, if Foreign API can provide some flags not for exact platforms (x86, Windows, Linux, SysV) but for capabilities: sizes of native types and such.

>     strlen = MethodHandles.filterReturnValue(...) // cast return to `long`
> }
> // now strlen always return `long`
>```


-- 
// Black Lion AKA Lev Serebryakov


More information about the panama-dev mailing list