Code Review for ldst-2-hotspot

Prepared by:goetz on Tue Nov 12 17:22:02 CET 2013
Workspace:/net/usr.work/d045726/oJ/ldst-2-hotspot
Compare against: http://hg.openjdk.java.net/ppc-aix-port/stage/hotspot
Compare against version:5660
Summary of changes: 375 lines changed: 128 ins; 9 del; 238 mod; 32342 unchg
Changeset: ldst-2-hotspot.changeset
Author comments:

Some platforms support special load/store intsturctions to do memory ordering. These can be cheaper than a normal load/store instruction followed by an according memory barrier instruction. E.g., IA64 has ld.acq and st.rel, and PPC has the ld-twi-isync combination that is better than 'ld lwsync'.

HotSpots C2 inserts MemBarAcquire and MemBarRelease nodes into the IR if memory ordering is needed for a load/store operation. This is not well suited to use above described load/store instructions.

This change extends the load/store nodes of the IR by a field that indicates whether the load/store should do an acquire/release. The field is either set to 'unordered', if the node may be reordered with others, or to 'acquire' for Loads and 'release' for Stores. Checking for this field in the matcher allows to issue the proper operation. If a platform does so, MemBarAcquire and MemBarRelease can be implemented empty, i.e., they basically serve to avoid reordering by the c2 compiler.

This change also removes default parameters from the affected load/store factory methods. Maintaining this change has shown very error prone if the defaults for the new field are ::unordered. If the default would be ::acquire/::release this would be safe, but then most places would need the parameter, anyways.

Legend: Modified file
Deleted file
New file

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/generateOptoStub.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
10 lines changed: 0 ins; 2 del; 8 mod; 302 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/graphKit.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
34 lines changed: 6 ins; 0 del; 28 mod; 4091 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/graphKit.hpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
32 lines changed: 18 ins; 0 del; 14 mod; 901 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/idealKit.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
6 lines changed: 0 ins; 0 del; 6 mod; 572 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/idealKit.hpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
2 lines changed: 1 ins; 0 del; 1 mod; 259 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/library_call.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
48 lines changed: 23 ins; 0 del; 25 mod; 6077 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/macro.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
11 lines changed: 2 ins; 0 del; 9 mod; 2535 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/matcher.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
7 lines changed: 0 ins; 1 del; 6 mod; 2424 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/memnode.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
38 lines changed: 1 ins; 0 del; 37 mod; 4547 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/memnode.hpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
124 lines changed: 60 ins; 6 del; 58 mod; 1314 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/mulnode.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
8 lines changed: 3 ins; 0 del; 5 mod; 1347 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/parse1.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
13 lines changed: 0 ins; 0 del; 13 mod; 2180 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/parse2.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
7 lines changed: 0 ins; 0 del; 7 mod; 2396 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/parse3.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
17 lines changed: 12 ins; 0 del; 5 mod; 533 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/parseHelper.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
9 lines changed: 0 ins; 0 del; 9 mod; 588 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/stringopts.cpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
7 lines changed: 2 ins; 0 del; 5 mod; 1640 unchg

Cdiffs Udiffs Wdiffs Sdiffs Frames Old New ----- Raw src/share/vm/opto/vectornode.hpp

rev 5661 : 8024921: PPC64 (part 113): Extend Load and Store nodes to know about memory ordering.
2 lines changed: 0 ins; 0 del; 2 mod; 636 unchg

This code review page was prepared using /sapmnt/home1/d045726/bin/webrev.ksh (vers 24.0-hg+jbs).