RFR: 8256189: Exact VarHandle tests should test withInvokeBehavior() works as expected

Chris Hegarty chegar at openjdk.java.net
Wed Nov 18 09:34:03 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).

Marked as reviewed by chegar (Reviewer).

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

PR: https://git.openjdk.java.net/jdk/pull/1267


More information about the core-libs-dev mailing list