The PPC port adds some minor extensions to the C2 compiler to support the PPC architecture. We also implemented some new optimizations.
*** currently under work ***
Handling ordered loads and stores
The C2 compiler represents Java loads and stores that require memory ordering as a load/store node and a memory barrrier node. If necessary the memory barrier node emits an assembler operation establishing the desired memory ordering. Further the compiler does not reorder memory operations wrt. this operation.
On IA64, there are special memory operations for acquiring loads and releasing stores. On PPC, there is a special instructions sequence implementing an effective load acquire that must know about the registers used in the load.
To support these operations, we extend the ideal load and store nodes to know whether they must acquire or release. They now have a flag set if they should acquire/release All graph kit methods have an additional argument setting the corresponding field.
http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/rev/fb70eef44b05
On PPC, we only use this extension for loads, but we propose to also add this change for stores to OpenJDK for symmetry.
The C2 compiler does not know that it should not reorder wrt. to memory operations with the acquire/release flag set. Therefore we still issue the corresponding MemBar instructions after the memory operations, but they do not generate any assembly.
Unfortunately this raises problems if the MemBar nodes are used without corresponding loads, as in LibraryCallKit::inline_unsafe_fence().
http://hg.openjdk.java.net/ppc-aix-port/jdk8/hotspot/rev/bc97850c4977
To overcome this problem, we propose to generate the MemBar in the load/store factory methods if required. This could be omitted locally on PPC and IA64 or other platforms that emit the ordering operation along with the load. Instead, a MemBarCPUOrder could be emitted. Then, on these platforms, we can properly emit ordering operations for the MemBar nodes.
Trap based null checks
Trampoline relocations
etc.