-
Enhancement
-
Resolution: Fixed
-
P4
-
23
-
b20
Dump GC-specific barrier information (via BarrierSetC2::dump_barrier_data()) for all Mach nodes, not just MachType ones. This makes it possible to e.g. write IR tests that verify barrier properties of CompareAndSwap/WeakCompareAndSwap implementations, which do not necessarily inherit from MachTypeNode. See an example of such tests here (ongoing implementation of JDK-8322295):
https://github.com/robcasloz/jdk/blob/e9b3c2a4cb5dd80d85af8320e559acea5920b2ff/test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java#L283-L292.
The attached program illustrates the missing barrier info (a "barrier(strong)" field):
$ java -Xbatch -XX:+UseZGC -XX:+ZGenerational -XX:CompileOnly=Example::testCompareAndSwap -XX:CompileCommand=PrintIdealPhase,Example::testCompareAndSwap,FINAL_CODE Example.java | grep zCompareAndSwapP
R10 37 zCompareAndSwapP === 28 35 38 54 22 41 [[ 40 42 36 27 56 25 ]] !jvms: VarHandleReferences$FieldInstanceReadWrite::compareAndSet @ bci:44 (line 180) VarHandleGuards::guard_LLL_Z @ bci:50 (line 68) Example::testCompareAndSwap @ bci:6 (line 20)
https://github.com/robcasloz/jdk/blob/e9b3c2a4cb5dd80d85af8320e559acea5920b2ff/test/hotspot/jtreg/compiler/gcbarriers/TestG1BarrierGeneration.java#L283-L292.
The attached program illustrates the missing barrier info (a "barrier(strong)" field):
$ java -Xbatch -XX:+UseZGC -XX:+ZGenerational -XX:CompileOnly=Example::testCompareAndSwap -XX:CompileCommand=PrintIdealPhase,Example::testCompareAndSwap,FINAL_CODE Example.java | grep zCompareAndSwapP
R10 37 zCompareAndSwapP === 28 35 38 54 22 41 [[ 40 42 36 27 56 25 ]] !jvms: VarHandleReferences$FieldInstanceReadWrite::compareAndSet @ bci:44 (line 180) VarHandleGuards::guard_LLL_Z @ bci:50 (line 68) Example::testCompareAndSwap @ bci:6 (line 20)
- relates to
-
JDK-8330862 GCBarrierIRExample fails when a different GC is selected via the command line
- Resolved