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

Jorn Vernee jvernee at openjdk.java.net
Wed Nov 18 19:05:01 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).

This pull request has now been integrated.

Changeset: 03e84ef7
Author:    Jorn Vernee <jvernee at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/03e84ef7
Stats:     173 lines in 3 files changed: 48 ins; 80 del; 45 mod

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

Reviewed-by: mcimadamore, chegar

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

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


More information about the core-libs-dev mailing list