RFR(S): 8238780: [lworld] C2: Partially initialized value type buffer might be observed by other thread
tobias.hartmann at oracle.com
Wed Feb 12 15:33:28 UTC 2020
please review the following patch:
Similar to what we have for the clone intrinsic , the inline type buffer initialization in
ValueTypeNode::allocate, ValueTypeNode::finish_larval and LateInlineCallGenerator::do_late_inline()
needs a barrier to not let C2 reorder initializing stores with a subsequent store that would make
this buffer accessible by other threads. TestBufferTearing.java triggers this reliably for both
cases with the help of -XX:+Stress(G/L)CM. It disables field and array element flattening to ensure
that writes are atomic (we could also use nullable containers).
This change also includes some refactoring, an additional test and a new test suite option to
run the tests without compile commands for extended testing.
Thanks to John for finding and debugging this issue !
More information about the valhalla-dev