[aarch64-port-dev ] RFR: 8205694: AArch64: Add test to validate volatile load, store and CAS code generation

Zhongwei Yao Zhongwei.Yao at arm.com
Wed Jun 27 07:41:41 UTC 2018


Hi, Andrew,

Look good to me.

Just nits: the "import java.lang.reflect.Field; import jdk.internal.misc.Unsafe;" in TestVolatileLoad.java and TestVolatileStore.java are unnecessary.

--
Best regards,
Zhongwei

________________________________________
From: aarch64-port-dev <aarch64-port-dev-bounces at openjdk.java.net> on behalf of Andrew Dinn <adinn at redhat.com>
Sent: Wednesday, June 27, 2018 12:55 AM
To: aarch64-port-dev at openjdk.java.net; hotspot compiler
Subject: [aarch64-port-dev ] RFR: 8205694: AArch64: Add test to validate volatile load, store and CAS code generation

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
IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.


More information about the hotspot-compiler-dev mailing list