RFR: fix for alias analysis with ShenandoahBarriersForConst
Roland Westrelin
rwestrel at redhat.com
Wed Mar 14 16:16:54 UTC 2018
http://cr.openjdk.java.net/~roland/shenandoah/ShenandoahBarriersForConst-alias-analysis/webrev.00/
This is a fix for the issues that Lennart reported with traversal GC
which are actually issues with ShenandoahBarriersForConst.
C2's alias analysis allocates slices for static fields based not only on
the class and offset, but also on the actual constant class oop so a
static field at some offset doesn't use the same slice as a different
static field in a different class but at the same offset.
When we put barriers on constants, the barriers hide the constant
oops. So for a static field, alias analysis uses the same slice for 2
different static fields in 2 different classes but at the same
offset. This:
- prevents us from taking full advantage of alias analysis
- can cause incorrect executions because the same static field access
could use 2 different slices: 1 at parse time when the compiler is
able to compute the slice based on the constant oop + offset and
another one after parsing, when the compiler doesn't see the constant
behing the barriers.
The fix above adds code that looks for constant oops beyond barriers.
Roland.
More information about the shenandoah-dev
mailing list