[foreign-memaccess+abi] RFR: 8313680: Disallow combining caputreCallState with isTrivial

Maurizio Cimadamore mcimadamore at openjdk.org
Sat Aug 5 23:11:52 UTC 2023


On Thu, 3 Aug 2023 11:26:05 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:

> Native functions that modify call state (errno) are by definition not 'trivial'. Capturing call state would also prevent intrinsification of a trivial call. I think to be on the safe side, we just want to disallow combining these two for now.

Marked as reviewed by mcimadamore (Committer).

src/java.base/share/classes/jdk/internal/foreign/abi/LinkerOptions.java line 68:

> 66:         LinkerOptions linkerOptions = new LinkerOptions(optionMap);
> 67:         if (linkerOptions.hasCapturedCallState() && linkerOptions.isTrivial()) {
> 68:             throw new IllegalArgumentException("captureCallState and isTrivial are mutually exclusive");

The message is good. I wonder if we could get it to scale better with something like "incompatible linker options: <option list>" which is sometimes what we use e.g. in the Java compiler (e.g. for flags). I wonder e.g. if there might be other set of incompatible options we might need to worry about in the future - seems a possibility. (In any case, we can always change the message later, so this is not a big priority).

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

PR Review: https://git.openjdk.org/panama-foreign/pull/856#pullrequestreview-1564029844
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/856#discussion_r1285132523


More information about the panama-dev mailing list