RFR: 8256189: Exact VarHandle tests should test withInvokeBehavior() works as expected
Maurizio Cimadamore
mcimadamore at openjdk.java.net
Tue Nov 17 19:07:04 UTC 2020
On Tue, 17 Nov 2020 18:32:30 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
> This PR sharpens the testing done by test/jdk/java/lang/invoke/VarHandles/VarHandleTestExact.java after @mcimadamore reported that the test was not catching an issue with memory access var handles; namely that the implementation of withInvokeBehavior was incorrect.
>
> After some debugging it turned out that the test never actually tested:
> (1) going back to invoke behavior from a var handle with invoke exact behavior
> (2) the memory access handle implementation of withInvoke(Exact)Behavior, due to memory handles always being adapted.
>
> The patch adds testing for (1), and adds a flag to jdk.internal.foreign.Utils to turn off the adaptation, so that we can test the 'naked' memory access var handles as well for (2).
>
> I've also tried to reduce some of the code duplication by creating the higher order doTest function, that does most of the testing (besides setting up var handles and test values).
Looks good -thanks for catching the issue in the memory access var handle template
-------------
Marked as reviewed by mcimadamore (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/1267
More information about the core-libs-dev
mailing list