RFR: 8205694: AArch64: Add test to validate volatile load, store and CAS code generation
Andrew Dinn
adinn at redhat.com
Tue Jun 26 16:55:42 UTC 2018
Reviews are welcome for the following webrev
webrev: http://cr.openjdk.java.net/~adinn/8205694/webrev.00/
JIRA: https://bugs.openjdk.java.net/browse/JDK-8205694
The patch:
----------
This AArch64-only patch adds tests to ensure that volatile load, store
and CAS operations are either:
translated to correctly replace memory barriers with combinations of
acquiring loads and releasing
left untransformed with all necessary memory barriers in place
The test requires a debug, aarch64 vm and is disabled if graal is being
used (debug is necessary because it relies on -XX:+PrintOptoAssembly to
provide evidence of what is in the compiler output).
The main driver test program creates subordinate JVMs to execute
subordinate programs which perform:
normal and unsafe volatile loads,
normal and unsafe volatile stores
unsafe volatile CASes
in each of 5 GC configurations:
G1
CMS+CondCardMark
CMS-CondCardMark
Parallel
Serial
Arguments -XXCompileCommand,compileonly and XX:+PrintOptoAssembly are
used to generate Assembly listings and the driver test program parses
these to ensure the correct sequences of instructions are generated
(including omitted memory barriers which are flagged in the output).
A few changes were made to the aarch64.ad file to ensure that the
PrintOptoAssembly output accurately represented the generated code.
These were necessary to ensure that the test could be sure that the
generated code sequences really were what was intended.
Also, some of the comments in aarch64.ad describing the code
transformation were updated following feedback from Zhongwei Yao that
arrived too late to get checked in with the fix for JDK-8204331.
Testing:
--------
The test itself passes when run on an AArch64 debug vm. It is ignored
when run on an AArch64 product vm.
No other testing is needed. Nothing significant in the aarch64.ad file
has been modified (only comments of format sequences which have been
exercised running the new test).
regards,
Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander
More information about the hotspot-compiler-dev
mailing list