RFR: 8078743: AARCH64: Extend use of stlr to cater for volatile object stores

Andrew Dinn adinn at redhat.com
Wed Jul 29 10:55:48 UTC 2015

The following webrev is a follow-on to the fix posted for JDK-8078263.
The earlier fix optimized *non-object* volatile puts/gets to use
stlr/ldar and elide the associated leading/trailing dmb instructions.
This one extends the previous optimization to cover volatile object puts.


The fix involves identifying certain Ideal Graph configurations in which
generation of leading and trailing dmb can be avoided in favour of
generating an stlr instruction. As a consequence the fix is sensitive to
the current GC configs and also to whether the value being written is
null, potentially null or known notnull. I have tested it using 5 GC


The last two configs are much of a muchness as regards what the patch
code does since with Parallel (or Serial) GC the patch code does not
need to look at the code which does the card mark -- but I tested
against both just to be sure.

Testing involved

  i) eyeballing the code generated for normal and unsafe volatile puts
with null, possibly null and notnull values

  ii) exercising a large program (build and run sample project in
netbeans) and eyeballing the code generated for methods of ConcurrentHashMap

  iii) running the full jcstress suite

Comments and reviews very welcome

n.b. I have a 3rd patch queued which performs a similar optimization for
CAS operations (drop the dmbs in favour of an ldaxr/stlxr pair).


Andrew Dinn
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in UK and Wales under Company Registration No. 3798903
Directors: Michael Cunningham (USA), Matt Parson (USA), Charlie Peters
(USA), Michael O'Neill (Ireland)

More information about the hotspot-compiler-dev mailing list