[foreign-memaccess+abi] RFR: 8302346: Lift upcall sharing mechanism to AbstractLinker [v2]
Jorn Vernee
jvernee at openjdk.org
Fri Feb 17 20:54:32 UTC 2023
On Wed, 15 Feb 2023 15:27:27 GMT, Maurizio Cimadamore <mcimadamore at openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> use fake MH for adaptation
>
> src/java.base/share/classes/jdk/internal/foreign/abi/SharedUtils.java line 166:
>
>> 164:
>> 165: // this just computes the adjusted type
>> 166: private static MethodType computeUpcallIMRType(MethodType targetType, boolean dropReturn) {
>
> Crazy idea - what if we created a fake method handle of the given target type - then just called adaptUpcallForIMR on it, and got the resulting type? I'm a bit worried for the type logic and the MH adaptation logic to go out of sync, and require changing things in two places.
Nice idea! This is trivial to implement as well using `MethodHandles::empty`.
Pushed that update.
-------------
PR: https://git.openjdk.org/panama-foreign/pull/791
More information about the panama-dev
mailing list