c2: logic that drops write barrier projection is not accurate
Roland Westrelin
rwestrel at redhat.com
Wed Sep 21 12:41:51 UTC 2016
I think the logic that removes a write barrier projection when it has
not read or write barrier use is broken: it stops at a MergeMem but it's
not sufficient. Behind the MergeMem there could be a barrier (igvn would
change that barrier's memory to bypass the MergeMem but there's no
guarantee the barrier is processed before the write barrier for which we
remove the projection), but also a not yet inlined call, an allocation,
memory barrier, lock/unlock code or arraycopy that will later be
removed. A following read barrier could then float above the write
barrier.
I haven't found a satisfying way to fix this and removing that logic
doesn't seem to cause a performance regression so I'd like to remove it,
at least for now:
http://cr.openjdk.java.net/~roland/shenandoah/always-keep-wb-proj/webrev.00/
Roland.
More information about the shenandoah-dev
mailing list