[foreign-abi] RFR: Turn on downcall intrinsics by default

Maurizio Cimadamore mcimadamore at openjdk.java.net
Tue Sep 22 14:20:26 UTC 2020


On Tue, 22 Sep 2020 13:59:02 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Hi,
> 
> This PR turns on down call intrinsics by default.
> 
> Since the time they were turned off some fixes have been done in the area of GC handling of optimized native calls, and
> no further problems in that area have been found. What currently works is:
> 1. All TestDowncall and TestUpcall tests, where each function is invoked in a 20_000 iteration loop with -Xbatch,
> making sure these calls are intrinsified. 2. TestIntrinsics tests which intrinsifies calls the same way.
> 3. All jextract samples with intrinsics turned on, which from the logs also leads to calls being intrinsified,
> especially on large extraction runs like Windows.h.
> There is one more case that is known to be problematic: TestUpcallHighArity crashes/fails when the call is intrinsified
> (using same method as 1 and 2). This seems to be caused by a known problem with the handling on stack arguments for
> intrinsified calls. So, for now, intrinsification of calls that pass arguments on the stack will be turned off.  If
> there are other cases you would like to make sure work, please take the test for a spin.
> Thanks,
> Jorn

Looks good - I wonder if we should add (either here, or in a separate changeset) a test for high arity downcalls - we
can verify correctness by generating all combinations:

m1(a1, a2 ..... an) { return a1; }
...
mn(a1, a2 ..... an) { return an; }

What do you think?

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

Marked as reviewed by mcimadamore (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/354


More information about the panama-dev mailing list