[foreign-memaccess+abi] RFR: 8313680: Disallow combining caputreCallState with isTrivial
Jorn Vernee
jvernee at openjdk.org
Mon Aug 7 06:55:51 UTC 2023
On Sat, 5 Aug 2023 23:09:01 GMT, Maurizio Cimadamore <mcimadamore 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.
>
> 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).
I like that suggestion.
-------------
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/856#discussion_r1285447214
More information about the panama-dev
mailing list