-
Enhancement
-
Resolution: Unresolved
-
P4
-
25
Currently, C2 can only elide pre-and post-barriers of G1 stores that follow immediately a newly allocated object. This RFE proposes analyzing C2's IR platform-dependent representation right before code emission (at PhaseOutput::perform_mach_node_analysis()) to elide barriers in stores as long as there is no safepoint poll between these and their corresponding allocations. Existing ZGC logic to perform a similar analysis can hopefully by generalized and reused.
The additional optimization would make it possible to remove barriers e.g. in conditional stores:
MyObject o = new MyObject();
if (c) {
o.myField = ..; // elidable barrier
}
or in array initialization stores in small loops such as this:
Object[] a = new Object[64];
for (int i = 0; i < a.length; i++) {
a[i] = ..; // elidable barrier (small counted loop without safepoint polls)
}
The additional optimization would make it possible to remove barriers e.g. in conditional stores:
MyObject o = new MyObject();
if (c) {
o.myField = ..; // elidable barrier
}
or in array initialization stores in small loops such as this:
Object[] a = new Object[64];
for (int i = 0; i < a.length; i++) {
a[i] = ..; // elidable barrier (small counted loop without safepoint polls)
}
- is blocked by
-
JDK-8348562 ZGC: segmentation fault due to missing node type check in barrier elision analysis
- Resolved
- relates to
-
JDK-8348656 [PPC64] Check effectiveness of C2 barrier elision
- Open
-
JDK-8322295 JEP 475: Late Barrier Expansion for G1
- Closed
- links to
-
Review(master) openjdk/jdk/23235