[foreign-memaccess+abi] RFR: 8313680: Disallow combining caputreCallState with isTrivial
Jorn Vernee
jvernee at openjdk.org
Fri Aug 4 11:07:06 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.
src/java.base/share/classes/java/lang/foreign/Linker.java line 733:
> 731: *
> 732: * @apiNote This linker option can not be combined with {@link #isTrivial}.
> 733: *
I'm not sure if we should a similar API note on `isTrivial`. Just having one here seems enough?
test/jdk/java/foreign/capturecallstate/TestCaptureCallState.java line 64:
> 62: }
> 63:
> 64: private record SaveValuesCase(String nativeTarget, FunctionDescriptor nativeDesc, boolean trivial, String threadLocalName, Consumer<Object> resultCheck) {}
For the changes in this file, I've just reverting things to how the were before: https://github.com/openjdk/panama-foreign/pull/848
-------------
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/856#discussion_r1283061791
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/856#discussion_r1283063010
More information about the panama-dev
mailing list